This vignette explains how to use functions in `smooth`

package, what they produce, what each field in outputs and what returned values mean. Underlying statistical models are not discussed here, but if you want to know more about them, then there is a document “Statistical models underlying functions of ‘smooth’ package for R”. Some of the features of the package are also explained in my blog.

The package includes the following functions:

- es() - Exponential Smoothing;
- ssarima() - State-Space ARIMA, also known as Several Seasonalities ARIMA;
- ces() - Complex Exponential Smoothing;
- gum() - Generalised Univariate Model;
- ves() - Vector Exponential Smoothing;
- sma() - Simple Moving Average in state-space form;
- Simulate functions of the package.
`smoothCombine()`

- function that combines forecasts of the main univariate functions of smooth package.`iss()`

– function that estimates probability of occurrence of variable using one of the following: 10. Fixed probability; 2. Croston’s probability; 3. SBA; 4. TSB probability; 5. Logistic probability. The model produced by`iss()`

can then be used in any forecasting function as input variable for`imodel`

parameter. There is also vector counterpart of this function called`viss()`

which implements multivariate fixed and logistic probabilities.`xregExpander()`

– function that creates lags and leads of the provided exogenous variables (either vector or matrix) and forecasts the missing values. This thing returns the matrix.`stepwise()`

– the function that implements stepwise based on information criteria and partial correlations. Easier to use and works faster than`step()`

from`stats`

package.

The functions (1) - (4) and (6) return object of class `smooth`

, (5) returns the object of class `vsmooth`

, (7) returns `smooth.sim`

class and finally (8) returns `iss`

or `viss`

(depending on the function used). There are several methods for these classes in the package.

`smooth`

There are several functions that can be used together with the forecasting functions of the package. So when a model is saved to some object `ourModel`

, these function will do some things. Here’s the list of all the available methods with brief explanations:

`summary(ourModel)`

– function prints brief output with explanation of what was fitted, with what parameters and errors;`fitted(ourModel)`

– fitted values of the model;`forecast(ourModel)`

– point and interval forecasts. This is needed for compatibility with Rob Hyndman’s “forecast” package.`forecast(ourModel)`

returns object of class`forecastSmooth`

;`residuals(ourModel)`

– residuals of constructed model;`AIC(ourModel)`

,`BIC(ourModel)`

,`AICc(ourModel)`

and`BICc(ourModel)`

– information criteria of the constructed model.`AICc()`

and`BICc()`

functions are not standard`stats`

functions and are imported from`greybox`

package and modified in`smooth`

for the specific models;`plot(ourModel)`

– plots states of constructed model. If number of states is higher than 10, then several graphs are produced. In case of`iss()`

plots the actual zeroes, fitted values and the forecast.`simulate(ourModel)`

– produces data simulated from provided model;`summary(forecast(ourModel))`

– prints point and interval forecasts;`plot(forecast(ourModel))`

– produces graph with actuals, forecast, fitted and intervals using`graphmaker()`

function.`logLik(ourModel)`

– returns log-likelihood of the model;`nobs(ourModel)`

– returns number of observations in-sample we had;`nParam(ourModel)`

– number of estimated parameters (originally from`greybox`

package);`pointLik(ourModel)`

– likelihood values for each separate observation;`sigma(ourModel)`

– variance of the residuals of the model;`lags(ourModel)`

– lags of the model (used with`ssarima()`

and`gum()`

);`orders(ourModel)`

– orders of the model (can be used with`ssarima()`

,`gum()`

and`sma()`

);`modelType(ourModel)`

– returns the type of the model. Returns something like “MMM” for ETS(MMM). Can be used with`es()`

,`ces()`

,`ves()`

and`ets()`

;`errorType(ourModel)`

– the type of the error of a model (additive or multiplicative);`coef(ourModel)`

– returns the vector of all the estimated coefficients of the model;`formula(ourModel)`

– returns the formula for the measurement equation. This is just for the information and general understanding what we work with;`getResponse(ourModel)`

– returns actual values;`covar(ourModel)`

– covariance matrix of multiple steps ahead forecast errors;`pls(ourModel)`

- Prediction Likelihood Score for the model and the provided holdout.