Learn R Programming

smooth (version 1.4.4)

auto.ces: Complex Exponential Smoothing Auto

Description

Function estimates CES in state-space form with information potential equal to errors with different seasonality types and chooses the one with the lowest IC value.

Usage

auto.ces(data, C=c(1.1, 1), models=c("none","simple","partial","full"), initial=c("backcasting","optimal"), ic=c("AICc","AIC","BIC"), cfType=c("MSE","MAE","HAM","MLSTFE","MSTFE","MSEh"), h=10, holdout=FALSE, intervals=FALSE, level=0.95, intervalsType=c("parametric","semiparametric","nonparametric"), intermittent=c("none","auto","fixed","croston","tsb"), bounds=c("admissible","none"), silent=c("none","all","graph","legend","output"), xreg=NULL, updateX=FALSE, ...)

Arguments

data
Either numeric vector or time series vector.
C
The initial value of complex smoothing parameter, where C[1] = a0, C[2] = a1.
models
The vector containing several types of seasonality that should be used in CES selection. See ces for more details about the possible types of seasonal models.
initial
Can be either character or a vector of initial states. If it is character, then it can be "optimal", meaning that the initial states are optimised, or "backcasting", meaning that the initials are produced using backcasting procedure.
ic
The information criterion used in the model selection procedure.
cfType
Type of Cost Function used in optimization. cfType can be: MSE (Mean Squared Error), MAE (Mean Absolute Error), HAM (Half Absolute Moment), MLSTFE - Mean Log Squared Trace Forecast Error, MSTFE - Mean Squared Trace Forecast Error and MSEh - optimisation using only h-steps ahead error. If cfType!="MSE", then likelihood and model selection is done based on equivalent MSE. Model selection in this cases becomes not optimal.

There are also available analytical approximations for multistep functions: aMSEh, aMSTFE and aMLSTFE. These can be useful in cases of small samples.

h
The forecasting horizon.
holdout
If TRUE, the holdout sample of size h will be taken from the data. If FALSE, no holdout is defined.
intervals
If TRUE, the prediction intervals are constructed.
level
Confidence level. Defines width of prediction interval.
intervalsType
Type of intervals to construct. First letter can be used instead of the whole word. This can be:

  • 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.
  • intermittent
    Defines type of intermittent model used. Can be: 1. none, meaning that the data should be considered as non-intermittent; 2. fixed, taking into account constant Bernoulli distribution of demand occurancies; 3. croston, based on Croston, 1972 method with SBA correction; 4. tsb, based on Teunter et al., 2011 method. 5. auto - automatic selection of intermittency type based on data. The first letter can be used instead of the full words.
    bounds
    What type of bounds to use for the smoothing parameters. The first letter can be used instead of the whole word.
    silent
    If 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").
    xreg
    Vector (either numeric or time series) or matrix (or data.frame) of exogenous variables that should be included in the model. If matrix included than columns should contain variables and rows - observations. Note that xreg should have number of observations equal either to in-sample or to the whole series. If the number of observations in xreg is equal to in-sample, then values for the holdout sample are produced using Naive.
    updateX
    If TRUE, transition matrix for exogenous variables is estimated, introducing non-linear interractions between parameters. Prerequisite - non-NULL xreg.
    ...
    Other non-documented parameters. For example FI=TRUE will make the function also produce Fisher Information matrix, which then can be used to calculated variances of parameters of the model.

    Value

    Object of class "smooth" is returned. See ces for details.

    Details

    The function estimates several Complex Exponential Smoothing in the state-space 2 described in Svetunkov, Kourentzes (2015) with the information potential equal to the approximation error using different types of seasonality and chooses the one with the lowest value of information criterion.

    References

    • Svetunkov, I., Kourentzes, N. (February 2015). Complex exponential smoothing. Working Paper of Department of Management Science, Lancaster University 2015:1, 1-31.
    • Svetunkov I., Kourentzes N. (2015) Complex Exponential Smoothing for Time Series Forecasting. Not yet published.
    • Hyndman, R.J., Koehler, A.B., Ord, J.K., and Snyder, R.D. (2008) Forecasting with exponential smoothing: the state space approach, Springer-Verlag. http://www.exponentialsmoothing.net.
    • Svetunkov S. (2012) Complex-Valued Modeling in Economics and Finance. SpringerLink: Bucher. Springer.

    See Also

    ces, ets, forecast, ts

    Examples

    Run this code
    y <- ts(rnorm(100,10,3),frequency=12)
    # CES with and without holdout
    auto.ces(y,h=20,holdout=TRUE)
    auto.ces(y,h=20,holdout=FALSE)
    
    library("Mcomp")
    ## Not run: y <- ts(c(M3$N0740$x,M3$N0740$xx),start=start(M3$N0740$x),frequency=frequency(M3$N0740$x))
    # # Selection between "none" and "full" seasonalities
    # auto.ces(y,h=8,holdout=TRUE,models=c("n","f"),intervals=TRUE,level=0.8,ic="AIC")## End(Not run)
    
    y <- ts(c(M3$N1683$x,M3$N1683$xx),start=start(M3$N1683$x),frequency=frequency(M3$N1683$x))
    test <- auto.ces(y,h=18,holdout=TRUE,intervals=TRUE)
    
    summary(test)
    forecast(test)
    plot(forecast(test))
    

    Run the code above in your browser using DataLab