sma(data, order=NULL, ic=c("AICc","AIC","BIC"), h=10, holdout=FALSE, intervals=FALSE, level=0.95, intervalsType=c("parametric","semiparametric","nonparametric"), silent=c("none","all","graph","legend","output"), ...)NULL, then it is selected automatically using information criteria.
TRUE, holdout sample of size h is taken from the end of the data.
TRUE, prediction intervals are constructed.
parametric use state-space structure of ETS. For multiplicative models they are approximated using the same function as for additive. As a result they are a bit wider than should be but are still efficient. In case of mixed models this is done using simulations, which may take longer time than for the pure additive and pure multiplicative models.
semiparametric are based on covariance matrix of 1 to h steps ahead errors and assumption of normal distribution.
nonparametric intervals use values from a quantile regression on error matrix (see Taylor and Bunn, 1999). The model used in this process is e[j] = a j^b, where j=1,..,h.
silent="none", then nothing is silent, everything is printed out and drawn. silent="all" means that nothing is produced or drawn (except for warnings). In case of silent="graph", no graph is produced. If silent="legend", then legend of the graph is skipped. And finally silent="output" means that nothing is printed out in the console, but the graph is produced. silent also accepts TRUE and FALSE. In this case silent=TRUE is equivalent to silent="all", while silent=FALSE is equivalent to silent="none". The parameter also accepts first letter of words ("n", "a", "g", "l", "o").
model can accept a previously estimated SMA model and use its parameters.
model - the name of the estimated model.
timeElapsed - time elapsed for the construction of the model.
states - the matrix of the fuzzy components of ssarima, where rows correspond to time and cols to states.
transition - matrix F.
persistence - the persistence vector. This is the place, where smoothing parameters live.
order - order of moving average.
initialType - Typetof initial values used.
nParam - number of estimated parameters.
fitted - the fitted values of ETS.
forecast - the point forecast of ETS.
lower - the lower bound of prediction interval. When intervals=FALSE then NA is returned.
upper - the higher bound of prediction interval. When intervals=FALSE then NA is returned.
residuals - the residuals of the estimated model.
errors - The matrix of 1 to h steps ahead errors.
s2 - standard deviation of the residuals (taking degrees of freedom into account).
intervalsType - type of intervals asked by user.
level - confidence level for intervals.
actuals - the original data.
holdout - the holdout part of the original data.
ICs - values of information criteria of the model. Includes AIC, AICc and BIC.
cf - Cost function value.
cfType - Type of cost function used in the estimation.
accuracy - the vector or accuracy measures for the holdout sample. Includes MPE, MAPE, SMAPE, MASE, MAE/mean, RelMAE and Bias coefficient (based on complex numbers). Available only when holdout=TRUE.
$y_[t] = w' v_[t-l] + \epsilon_[t]$
$v_[t] = F v_[t-1] + g \epsilon_[t]$
Where $v_[t]$ is a state vector (defined using order).
ma, es, ssarima
# SMA of specific order
test <- sma(rnorm(118,100,3),order=12,h=18,holdout=TRUE,intervals=TRUE)
# SMA of arbitrary order
test <- sma(rnorm(118,100,3),h=18,holdout=TRUE,intervals=TRUE)
summary(test)
forecast(test)
plot(forecast(test))
Run the code above in your browser using DataLab