| Type: | Package |
| Title: | Forecasting Using Multivariate Models |
| Version: | 0.2.1 |
| Date: | 2025-02-03 |
| URL: | https://github.com/config-i1/legion |
| BugReports: | https://github.com/config-i1/legion/issues |
| Language: | en-GB |
| Description: | Functions implementing multivariate state space models for purposes of time series analysis and forecasting. The focus of the package is on multivariate models, such as Vector Exponential Smoothing, Vector ETS (Error-Trend-Seasonal model) etc. It currently includes Vector Exponential Smoothing (VES, de Silva et al., 2010, <doi:10.1177/1471082X0901000401>), Vector ETS (Svetunkov et al., 2023, <doi:10.1016/j.ejor.2022.04.040>) and simulation function for VES. |
| License: | LGPL-2.1 |
| Depends: | R (≥ 3.5.0), greybox (≥ 1.0.4), smooth (≥ 3.1.0) |
| Imports: | Rcpp (≥ 0.12.3), stats, generics (≥ 0.1.2), graphics,grDevices, Matrix, nloptr, utils, zoo |
| LinkingTo: | Rcpp, RcppArmadillo (≥ 0.8.100.0.0) |
| Suggests: | numDeriv, testthat, knitr, rmarkdown, doMC, doParallel,foreach |
| VignetteBuilder: | knitr |
| RoxygenNote: | 7.3.2 |
| Encoding: | UTF-8 |
| NeedsCompilation: | yes |
| Packaged: | 2025-02-03 14:14:35 UTC; config |
| Author: | Ivan Svetunkov [aut, cre] (Senior Lecturer, Centre for Marketing Analytics and Forecasting, Lancaster University, UK), Kandrika Fadhlan Pritularga [aut] (Lecturer, Centre for Marketing Analytics and Forecasting, Lancaster University, UK) |
| Maintainer: | Ivan Svetunkov <ivan@svetunkov.com> |
| Repository: | CRAN |
| Date/Publication: | 2025-02-03 16:10:02 UTC |
Legion package
Description
Package contains functions for multivariate time series forecasting
Details
| Package: | legion |
| Type: | Package |
| Date: | 2021-02-18 - Inf |
| License: | GPL-2 |
The following functions areincluded in the package:
ves - Vector Exponential Smoothing.
vets - Vector ETS-PIC model.
oves - Multivariate occurrence ETS model.
Author(s)
Ivan Svetunkov,ivan@svetunkov.com
Kandrika Pritularga
References
de Silva A., Hyndman R.J. and Snyder, R.D. (2010). The vectorinnovations structural time series framework: a simple approach tomultivariate forecasting. Statistical Modelling, 10 (4), pp.353-374
Hyndman, R.J., Koehler, A.B., Ord, J.K., and Snyder, R.D. (2008)Forecasting with exponential smoothing: the state space approach,Springer-Verlag.
Lütkepohl, H. (2005). New Introduction to Multiple Time SeriesAnalysis. New introduction to Multiple Time Series Analysis. Berlin,Heidelberg: Springer Berlin Heidelberg.doi:10.1007/978-3-540-27752-1
Svetunkov, I., Chen, H., & Boylan, J. E. (2023).A new taxonomy for vector exponential smoothing and its applicationto seasonal time series. European Journal of Operational Research,304(3), 964–980.doi:10.1016/j.ejor.2022.04.040
See Also
Examples
## Not run: y <- cbind(rnorm(100,10,3),rnorm(100,10,3))ves(y,h=20,holdout=TRUE)## End(Not run)Vector ETS-PIC model
Description
Function constructs vector ETS model based on VETS-PIC taxonomy and returnsforecast, fitted values, errors and matrix of states along with other useful variables.
Usage
auto.vets(data, model = "PPP", lags = c(frequency(data)), loss = c("likelihood", "diagonal", "trace"), ic = c("AICc", "AIC", "BIC", "BICc"), h = 10, holdout = FALSE, occurrence = c("none", "fixed", "logistic"), bounds = c("admissible", "usual", "none"), silent = TRUE, parallel = FALSE, ...)vets(data, model = "PPP", lags = c(frequency(data)), parameters = c("level", "trend", "seasonal", "damped"), initials = c("seasonal"), components = c("none"), loss = c("likelihood", "diagonal", "trace"), ic = c("AICc", "AIC", "BIC", "BICc"), h = 10, holdout = FALSE, occurrence = c("none", "fixed", "logistic"), bounds = c("admissible", "usual", "none"), silent = TRUE, ...)Arguments
data | The matrix with the data, where series are in columns andobservations are in rows. |
model | The type of ETS model. Can consist of 3 or 4 chars: Also |
lags | The lags of the model. Needed for seasonal models. |
loss | Type of Loss Function used in optimization.
An example of the latter option is: |
ic | The information criterion used in the model selection procedure. |
h | Length of forecasting horizon. |
holdout | If |
occurrence | Defines type of occurrence model used. Can be:
In this case, the ETS model inside the occurrence part will correspond to |
bounds | What type of bounds to use in the model estimation. The firstletter can be used instead of the whole word. |
silent | If |
parallel | If TRUE, the estimation of ADAM models is done in parallel (used in |
... | Other non-documented parameters. For example
|
parameters | The character vector, specifying, which of the parametersshould be common between time series. This includes smoothing parameters for |
initials | The character vector, specifying, which of the initial values ofcomponents should be common. This can be |
components | The character vector, specifying, which of the componentscomponents should be shared between time series. This can be |
Details
Function estimates vector ETS in the form of the Single Source of Error state spacemodel of the following type:
\mathbf{y}_{t} = \mathbf{o}_{t} (\mathbf{W} \mathbf{v}_{t-l} + \mathbf{x}_t\mathbf{a}_{t-1} + \mathbf{\epsilon}_{t})
\mathbf{v}_{t} = \mathbf{F} \mathbf{v}_{t-l} + \mathbf{G}\mathbf{\epsilon}_{t}
\mathbf{a}_{t} = \mathbf{F_{X}} \mathbf{a}_{t-1} + \mathbf{G_{X}}\mathbf{\epsilon}_{t} / \mathbf{x}_{t}
Wherey_{t} is the vector of time series on observationt,o_{t}is the vector of Bernoulli distributed random variable (in case of normal data itbecomes unit vector for all observations),\mathbf{v}_{t} is the matrix ofstates andl is the matrix of lags,\mathbf{x}_t is the vector ofexogenous variables.\mathbf{W} is the measurement matrix,\mathbf{F}is the transition matrix and\mathbf{G} is the persistence matrix.Finally,\epsilon_{t} is the vector of error terms.
Conventionally we formulate values as:
\mathbf{y}'_t = (y_{1,t}, y_{2,t}, \dots, y_{m,t})
wherem is the number of series in the group.
\mathbf{v}'_t = (v_{1,t}, v_{2,t}, \dots, v_{m,t})
wherev_{i,t} is vector of components for i-th time series.
\mathbf{W}' = (w_{1}, \dots , 0;\vdots , \ddots , \vdots;0 , \vdots , w_{m})
is matrix of measurement vectors.
The main idea of the function is in imposing restrictions on parameters / initials /components of the model in order to capture the common dynamics between series.
In case of multiplicative model, instead of the vector y_t we use its logarithms.As a result the multiplicative model is much easier to work with.
For some more information about the model and its implementation, see thevignette:vignette("vets","legion")
Value
Object of class "legion" is returned. It contains the following list ofvalues:
model- The name of the fitted model;timeElapsed- The time elapsed for the construction of the model;states- The matrix of states with components in columns and time in rows;persistence- The persistence matrix;transition- The transition matrix;measurement- The measurement matrix;phi- The damping parameter value;B- The vector of all the estimated coefficients;lagsAll- The vector of the internal lags used in the model;nParam- The number of estimated parameters;occurrence- The occurrence model estimated with VETS;data- The matrix with the original data;fitted- The matrix of the fitted values;holdout- The matrix with the holdout values (ifholdout=TRUEinthe estimation);residuals- The matrix of the residuals of the model;Sigma- The covariance matrix of the errors (estimated with the correctionfor the number of degrees of freedom);forecast- The matrix of point forecasts;ICs- The values of the information criteria;logLik- The log-likelihood function;lossValue- The value of the loss function;loss- The type of the used loss function;lossFunction- The loss function if the custom was used in the process;accuracy- the values of the error measures. Currently not available.FI- Fisher information if user asked for it usingFI=TRUE.
Author(s)
Ivan Svetunkov,ivan@svetunkov.com
References
de Silva A., Hyndman R.J. and Snyder, R.D. (2010). The vectorinnovations structural time series framework: a simple approach tomultivariate forecasting. Statistical Modelling, 10 (4), pp.353-374
Hyndman, R.J., Koehler, A.B., Ord, J.K., and Snyder, R.D. (2008)Forecasting with exponential smoothing: the state space approach,Springer-Verlag.
Lütkepohl, H. (2005). New Introduction to Multiple Time SeriesAnalysis. New introduction to Multiple Time Series Analysis. Berlin,Heidelberg: Springer Berlin Heidelberg.doi:10.1007/978-3-540-27752-1
Svetunkov, I., Chen, H., & Boylan, J. E. (2023).A new taxonomy for vector exponential smoothing and its applicationto seasonal time series. European Journal of Operational Research,304(3), 964–980.doi:10.1016/j.ejor.2022.04.040
See Also
Examples
Y <- ts(cbind(rnorm(100,100,10),rnorm(100,75,8)),frequency=12)# The simplest model applied to the data with the default valuesvets(Y,model="ANN",h=10,holdout=TRUE)# Multiplicative damped trend model with common parameters# and initial seasonal indicesvets(Y,model="MMdM",h=10,holdout=TRUE,parameters=c("l","t","s","d"), initials="seasonal")# Automatic selection of ETS componentsvets(Y, model="PPP", h=10, holdout=TRUE, initials="seasonal")legion classes checkers
Description
Functions to check if an object is of the specified class
Usage
is.legion(x)is.oves(x)is.legion.sim(x)Arguments
x | The object to check. |
Details
The list of methods includes:
is.legion()tests if the object was produced by a vector model (e.g.ves);is.oves()tests if the object was produced byovesfunction;is.legion.sim()tests if the object was produced by the functionssim.ves;
Value
TRUE if this is the specified class andFALSE otherwise.
Author(s)
Ivan Svetunkov,ivan@svetunkov.com
Examples
ourModel <- ves(cbind(rnorm(100,100,10),rnorm(100,100,10)))is.legion(ourModel)Occurrence part of Vector State Space
Description
Function calculates the probability for the occurrence part of vector state space model.This is needed in order to forecast intermittent demand using other functions.
Usage
oves(data, occurrence = c("logistic", "none", "fixed"), ic = c("AICc", "AIC", "BIC", "BICc"), h = 10, holdout = FALSE, probability = c("dependent", "independent"), model = "ANN", persistence = NULL, transition = NULL, phi = NULL, initial = NULL, initialSeason = NULL, xreg = NULL, ...)Arguments
data | The matrix with data, where series are in columns andobservations are in rows. |
occurrence | Type of method used in probability estimation. Can be |
ic | Information criteria to use in case of model selection. |
h | Forecast horizon. |
holdout | If |
probability | Type of probability assumed in the model. If |
model | Type of ETS model used for the estimation. Normally this shouldbe either |
persistence | Persistence matrix type. If |
transition | Transition matrix type. If |
phi | Damping parameter type. If |
initial | Initial vector type. If |
initialSeason | Type of the initial vector of seasonal components.If |
xreg | Vector of matrix of exogenous variables, explaining some partsof occurrence variable (probability). |
... | Other parameters. This is not needed for now. |
Details
The function estimates probability of demand occurrence, using one of the VESstate-space models.
Value
The object of class "oves" is returned. It contains following list ofvalues:
model- the type of the estimated ETS model;fitted- fitted values of the constructed model;forecast- forecast forhobservations ahead;states- values of states (currently level only);variance- conditional variance of the forecast;logLik- likelihood value for the modelnParam- number of parameters used in the model;residuals- residuals of the model;data- actual values of probabilities (zeros and ones).persistence- the vector of smoothing parameters;initial- initial values of the state vector;initialSeason- the matrix of initials seasonal states;occurrence- type of occurrence model used;probability- type of probability used;issModel- intermittent state-space model used forcalculations. Useful only in the case ofoccurrence="l"andprobability="d".
Author(s)
Ivan Svetunkov,ivan@svetunkov.com
See Also
Examples
Y <- cbind(c(rpois(25,0.1),rpois(25,0.5),rpois(25,1),rpois(25,5)), c(rpois(25,0.1),rpois(25,0.5),rpois(25,1),rpois(25,5)))oves(Y, occurrence="l")oves(Y, occurrence="l", probability="i")Plots for the fit and states
Description
The function produces diagnostics plots for alegion model
Usage
## S3 method for class 'legion'plot(x, which = c(1, 2, 4, 6), level = 0.95, legend = FALSE, ask = prod(par("mfcol")) < length(which) * nvariate(x) && dev.interactive(), lowess = TRUE, ...)Arguments
x | Estimated legion model. |
which | Which of the plots to produce. The possible options (see details for explanations):
|
level | Confidence level. Defines width of confidence interval. Used in plots (2), (3), (7), (8),(9), (10) and (11). |
legend | If |
ask | Logical; if |
lowess | Logical; if |
... | The parameters passed to the plot functions. Recommended to use with separate plots. |
Details
The list of produced plots includes:
Actuals vs Fitted values. Allows analysing, whether there are any issues in the fit.Does the variability of actuals increase with the increase of fitted values? Is the relationwell captured? They grey line on the plot corresponds to the perfect fit of the model.
Standardised residuals vs Fitted. Plots the points and the confidence bounds(red lines) for the specified confidence
level. Useful for the analysis of outliers;Studentised residuals vs Fitted. This is similar to the previous plot, but with theresiduals divided by the scales with the leave-one-out approach. Should be more sensitiveto outliers;
Absolute residuals vs Fitted. Useful for the analysis of heteroscedasticity;
Squared residuals vs Fitted - similar to (3), but with squared values;
Q-Q plot with the specified distribution. Can be used in order to see if theresiduals follow the assumed distribution. The type of distribution depends on the one usedin the estimation (see
distributionparameter inalm);ACF of the residuals. Are the residuals autocorrelated? Seeacf fordetails;
Fitted over time. Plots actuals (black line), fitted values (purple line), point forecast(blue line) and prediction interval (grey lines). Can be used in order to make sure that the modeldid not miss any important events over time;
Standardised residuals vs Time. Useful if you want to see, if there is autocorrelation orif there is heteroscedasticity in time. This also shows, when the outliers happen;
Studentised residuals vs Time. Similar to previous, but with studentised residuals;
PACF of the residuals. No, really, are they autocorrelated? See pacf function from statspackage for details;
Plot of the states of the model. It is not recommended to produce this plot together withthe others, because there might be several states, which would cause the creation of a differentcanvas. In case of "msdecompose", this will produce the decomposition of the series into stateson a different canvas.
Which of the plots to produce, is specified via thewhich parameter.Currently onlywhich=c(1,4:7) are supported.
Value
The function produces the number of plots, specified in the parameterwhich.
Author(s)
Ivan Svetunkov,ivan@svetunkov.com
See Also
Examples
ourModel <- es(c(rnorm(50,100,10),rnorm(50,120,10)), "ANN", h=10)plot(ourModel, c(1:11))plot(ourModel, 12)Simulate Vector Exponential Smoothing
Description
Function generates data using VES model as a data generating process.
Usage
sim.ves(model = "ANN", obs = 10, nsim = 1, nvariate = 2, frequency = 1, persistence = NULL, phi = 1, transition = NULL, initial = NULL, initialSeason = NULL, seasonal = c("individual, common"), weights = rep(1/nvariate, nvariate), bounds = c("usual", "admissible", "restricted"), randomizer = c("rnorm", "rt", "rlaplace", "rs"), ...)Arguments
model | Type of ETS model. This can consist of 3 or 4 chars: |
obs | Number of observations in each generated time series. |
nsim | Number of series to generate (number of simulations to do). |
nvariate | Number of series in each generated group of series. |
frequency | Frequency of generated data. In cases of seasonal modelsmust be greater than 1. |
persistence | Matrix of smoothing parameters for all the componentsof all the generated time series. |
phi | Value of damping parameter. If trend is not chosen in the model,the parameter is ignored. If vector is provided, then several parametersare used for different series. |
transition | Transition matrix. This should have the size appropriateto the selected model and |
initial | Vector of initial states of level and trend. The minimumlength is one (in case of ETS(A,N,N), the initial is used for all theseries), the maximum length is 2 x nvariate. If |
initialSeason | Vector or matrix of initial states for seasonalcoefficients. Should have number of rows equal to |
seasonal | The type of seasonal component across the series. Can be |
weights | The weights for the errors between the series with the commonseasonal component. Ignored if |
bounds | Type of bounds to use for persistence vector if values aregenerated. |
randomizer | Type of random number generator function used for errorterm. Defaults are: |
... | Additional parameters passed to the chosen randomizer. All theparameters should be passed in the order they are used in chosen randomizer.For example, passing just |
Value
List of the following values is returned:
model- Name of ETS model.data- The matrix (or an array ifnsim>1) of thegenerated series.states- The matrix (or array ifnsim>1) of states.States are in columns, time is in rows.persistence- The matrix (or array ifnsim>1) ofsmoothing parameters used in the simulation.transition- The transition matrix (or array ifnsim>1).initial- Vector (or matrix) of initial values.initialSeason- Vector (or matrix) of initial seasonalcoefficients.residuals- Error terms used in the simulation. Either matrixor array, depending onnsim.
Author(s)
Ivan Svetunkov,ivan@svetunkov.com
References
de Silva A., Hyndman R.J. and Snyder, R.D. (2010). The vectorinnovations structural time series framework: a simple approach tomultivariate forecasting. Statistical Modelling, 10 (4), pp.353-374
Hyndman, R.J., Koehler, A.B., Ord, J.K., and Snyder, R.D. (2008)Forecasting with exponential smoothing: the state space approach,Springer-Verlag.
Lütkepohl, H. (2005). New Introduction to Multiple Time SeriesAnalysis. New introduction to Multiple Time Series Analysis. Berlin,Heidelberg: Springer Berlin Heidelberg.doi:10.1007/978-3-540-27752-1
Svetunkov, I., Chen, H., & Boylan, J. E. (2023).A new taxonomy for vector exponential smoothing and its applicationto seasonal time series. European Journal of Operational Research,304(3), 964–980.doi:10.1016/j.ejor.2022.04.040
See Also
Examples
# Create 40 observations of quarterly data using AAA model with errors# from normal distributionVESAAA <- sim.ves(model="AAA",frequency=4,obs=40,nvariate=3, randomizer="rnorm",mean=0,sd=100)# You can also use mvrnorm function from MASS package as randomizer,# but you need to provide mu and Sigma explicitly## Not run: VESANN <- sim.ves(model="ANN",frequency=4,obs=40,nvariate=2, randomizer="mvrnorm",mu=c(100,50),sigma=matrix(c(40,20,20,30),2,2))## End(Not run)# When generating the data with multiplicative model a more diligent definitiion# of parameters is needed. Here's an example with MMM model:VESMMM <- sim.ves("AAA", obs=120, nvariate=2, frequency=12, initial=c(10,0), initialSeason=runif(12,-1,1), persistence=c(0.06,0.05,0.2), mean=0, sd=0.03)VESMMM$data <- exp(VESMMM$data)# Note that smoothing parameters should be low and the standard diviation should# definitely be less than 0.1. Otherwise you might face the explosions.Vector Exponential Smoothing in SSOE state space model
Description
Function constructs vector ETS model and returns forecast, fitted values, errorsand matrix of states along with other useful variables.
Usage
ves(data, model = "PPP", lags = c(frequency(data)), persistence = c("common", "individual", "dependent"), transition = c("common", "individual", "dependent"), phi = c("common", "individual"), initial = c("individual", "common"), initialSeason = c("common", "individual"), loss = c("likelihood", "diagonal", "trace"), ic = c("AICc", "AIC", "BIC", "BICc"), h = 10, holdout = FALSE, occurrence = c("none", "fixed", "logistic"), bounds = c("admissible", "usual", "none"), silent = TRUE, ...)Arguments
data | The matrix with the data, where series are in columns andobservations are in rows. |
model | The type of ETS model. Can consist of 3 or 4 chars: Also |
lags | The lags of the model. Needed for seasonal models. |
persistence | Persistence matrix
You can also use the first letter instead of writing the full word. |
transition | Transition matrix
You can also use the first letter instead of writing the full word. |
phi | In cases of damped trend this parameter defines whether the |
initial | Can be either character or a vector / matrix of initial states.If it is character, then it can be |
initialSeason | Can be either character or a vector / matrix of initialstates. Treated the same way as |
loss | Type of Loss Function used in optimization.
An example of the latter option is: |
ic | The information criterion used in the model selection procedure. |
h | Length of forecasting horizon. |
holdout | If |
occurrence | Defines type of occurrence model used. Can be:
In this case, the ETS model inside the occurrence part will correspond to |
bounds | What type of bounds to use in the model estimation. The firstletter can be used instead of the whole word. |
silent | If |
... | Other non-documented parameters. For example
|
Details
Function estimates vector ETS in a form of the Single Source of Error state spacemodel of the following type:
\mathbf{y}_{t} = (\mathbf{W} \mathbf{v}_{t-l} + \mathbf{x}_t\mathbf{a}_{t-1} + \mathbf{\epsilon}_{t})
\mathbf{v}_{t} = \mathbf{F} \mathbf{v}_{t-l} + \mathbf{G}\mathbf{\epsilon}_{t}
\mathbf{a}_{t} = \mathbf{F_{X}} \mathbf{a}_{t-1} + \mathbf{G_{X}}\mathbf{\epsilon}_{t} / \mathbf{x}_{t}
Wherey_{t} is the vector of time series on observationt,\mathbf{v}_{t} is the matrix ofstates andl is the matrix of lags,\mathbf{x}_t is the vector ofexogenous variables.\mathbf{W} is the measurement matrix,\mathbf{F}is the transition matrix and\mathbf{G} is the persistence matrix.Finally,\epsilon_{t} is the vector of error terms.
Conventionally we formulate values as:
\mathbf{y}'_t = (y_{1,t}, y_{2,t}, \dots, y_{m,t})
wherem is the number of series in the group.
\mathbf{v}'_t = (v_{1,t}, v_{2,t}, \dots, v_{m,t})
wherev_{i,t} is vector of components for i-th time series.
\mathbf{W}' = (w_{1}, \dots , 0;\vdots , \ddots , \vdots;0 , \vdots , w_{m})
is matrix of measurement vectors.
For the details on the additive model see Hyndman et al. (2008),chapter 17.
In case of multiplicative model, instead of the vector y_t we use its logarithms.As a result the multiplicative model is much easier to work with.
For some more information about the model and its implementation, see thevignette:vignette("ves","legion")
Value
Object of class "legion" is returned. It contains the following list ofvalues:
model- The name of the fitted model;timeElapsed- The time elapsed for the construction of the model;states- The matrix of states with components in columns and time in rows;persistence- The persistence matrix;transition- The transition matrix;measurement- The measurement matrix;phi- The damping parameter value;lagsAll- The vector of the internal lags used in the model;B- The vector of all the estimated coefficients;initial- The initial values of the non-seasonal components;initialSeason- The initial values of the seasonal components;nParam- The number of estimated parameters;occurrence- The occurrence part of the model estimated with VES;data- The matrix with the original data;fitted- The matrix of the fitted values;holdout- The matrix with the holdout values (ifholdout=TRUEinthe estimation);residuals- The matrix of the residuals of the model;Sigma- The covariance matrix of the errors (estimated with the correctionfor the number of degrees of freedom);forecast- The matrix of point forecasts;ICs- The values of the information criteria;logLik- The log-likelihood function;lossValue- The value of the loss function;loss- The type of the used loss function;lossFunction- The loss function if the custom was used in the process;accuracy- the values of the error measures. Currently not available.FI- Fisher information if user asked for it usingFI=TRUE.
Author(s)
Ivan Svetunkov,ivan@svetunkov.com
References
de Silva A., Hyndman R.J. and Snyder, R.D. (2010). The vectorinnovations structural time series framework: a simple approach tomultivariate forecasting. Statistical Modelling, 10 (4), pp.353-374
Hyndman, R.J., Koehler, A.B., Ord, J.K., and Snyder, R.D. (2008)Forecasting with exponential smoothing: the state space approach,Springer-Verlag.
Lütkepohl, H. (2005). New Introduction to Multiple Time SeriesAnalysis. New introduction to Multiple Time Series Analysis. Berlin,Heidelberg: Springer Berlin Heidelberg.doi:10.1007/978-3-540-27752-1
Svetunkov, I., Chen, H., & Boylan, J. E. (2023).A new taxonomy for vector exponential smoothing and its applicationto seasonal time series. European Journal of Operational Research,304(3), 964–980.doi:10.1016/j.ejor.2022.04.040
See Also
Examples
Y <- ts(cbind(rnorm(100,100,10),rnorm(100,75,8)),frequency=12)# The simplest model applied to the data with the default valuesves(Y,model="ANN",h=10,holdout=TRUE)# Damped trend model with the dependent persistenceves(Y,model="AAdN",persistence="d",h=10,holdout=TRUE)# Multiplicative damped trend model with individual phives(Y,model="MMdM",persistence="i",h=10,holdout=TRUE,initialSeason="c")# Automatic selection between pure modelsves(Y,model="PPP",persistence="i",h=10,holdout=TRUE,initialSeason="c")# Intermittent demand vector modelY <- cbind(c(rpois(25,0.1),rpois(25,0.5),rpois(25,1),rpois(25,5)), c(rpois(25,0.1),rpois(25,0.5),rpois(25,1),rpois(25,5)))ves(Y,model="MNN",h=10,holdout=TRUE,occurrence="l")