knitr::opts_chunk$set(fig.width=6, fig.height=4, fig.path='Figs/', fig.show='hold',
                      warning=FALSE, message=FALSE)

This vignette covers ces() and auto.ces() functions, which are part of smooth package.

Let's load the necessary packages:

require(smooth)

ces() function allows constructing Complex Exponential Smoothing either with no seasonality, or with simple / partial / full seasonality. A simple call for ces() results in estimation of non-seasonal model:

For the same series from M3 dataset ces() can be constructed using:

ces(BJsales, h=12, holdout=TRUE, silent=FALSE)

This output is very similar to ones printed out by es() function. The only difference is complex smoothing parameter values which are printed out instead of persistence vector in es().

If we want automatic model selection, then we use auto.ces() function:

auto.ces(BJsales, h=12, holdout=TRUE, interval="p", silent=FALSE)

Note that prediction interval are too narrow and do not include 95% of values. This is because CES is pure additive model and it cannot take into account possible heteroscedasticity.

If for some reason we want to optimise initial values then we call:

auto.ces(BJsales, h=12, holdout=TRUE, initial="o", interval="sp")

Now let's introduce some artificial exogenous variables:

x <- cbind(rnorm(length(BJsales),50,3),rnorm(length(BJsales),100,7))

ces() allows using exogenous variables and different types of prediction interval in exactly the same manner as es():

auto.ces(BJsales, h=12, holdout=TRUE, xreg=x, regressors="select", interval="p")


config-i1/smooth documentation built on Jan. 3, 2024, 11:31 p.m.