smooth
The package smooth contains several smoothing (exponential and not) functions that are used in forecasting.
Here is the list of the included functions:
- es - the ETS function. It can handle exogenous variables and has a handy "holdout" parameter. There are several cost function implemented, including trace forecast based ones. Model selection is done via branch and bound algorithm and there's a possibility to use AIC weights in order to produce combined forecasts. Finally, all the possible ETS functions are implemented here.
- ces - Complex Exponential Smoothing. Function estimates CES and makes forecast. See documentation for details.
- gum - Generalised Exponential Smoothing. Next step from CES. The paper on this is in the process.
- sma - Simple Moving Average in state space form.
- ves - Vector Exponential Smoothing. Vector form of the ETS model.
- ssarima - SARIMA estimated in state space framework. Allows multiple seasonalities.
- auto.ces - selection between seasonal and non-seasonal CES models.
- auto.ssarima - selection between different State-Space ARIMA models.
- auto.gum - automatic selection of the most appropriate GUM model.
- sim.es - simulation of data using ETS framework with a predefined (or random) smoothing parameters and initial values.
- sim.ssarima - simulation of data using State-Space ARIMA framework with a predefined (or randomly generated) parameters and initial values.
- sim.ces - simulation of data using CES with a predefined (or random) complex smoothing parameters and initial values.
- sim.gum - simulation functions for GUM.
- sim.sma - simulates data from SMA.
- sim.ves - simulates data from VES.
- iss - intermittent data state space model. This function models the part with data occurrences using one of the following methods: Croston's, TSB, fixed, SBA or logistic probability.
- viss - the vector counterpart of iss.
- Accuracy - the vector of the error measures for the provided forecasts and the holdout.
- sowhat - returns the ultimate answer to any question.
- smoothCombine - the function that combines forecasts from es(), ces(), gum(), ssarima() and sma() functions.
- cma - Centred Moving Average. This is the function used for smoothing of time series, not for forecasting.
Future works:
- nus - Non-uniform Smoothing. The estimation method used in order to update parameters of regression models.
- sofa - Survival of the fittest algorithm applied to state space models.
Available methods:
- AICc, BICc;
- coef;
- covar - covariance matrix of multiple steps ahead forecast errors;
- errorType - the type of the error in the model: either additive or multiplicative;
- fitted;
- forecast;
- getResponse;
- lags - lags of the model (mainly needed for ARIMA and GUM);
- logLik;
- modelType - type of the estimated model (mainly needed for ETS and CES);
- nobs;
- nParam - number of the estimated parameters in the model;
- orders - orders of the components of the model (mainly needed for ARIMA, GUM and SMA);
- plot;
- pls - Prediction Likelihood Score for the model and the provided holdout;
- pointLik - the vector of the individual likelihoods for each in-sample observation;
- pAIC - point AIC, based on pointLik
- print;
- sigma;
- simulate;
- summary;
Installation
The stable version of the package is available on CRAN, so you can install it by running:
install.packages("smooth")
A recent, development version, is available via github and can be installed using "devtools" in R. First, make sure that you have devtools:
if (!require("devtools")){install.packages("devtools")}
and after that run:
devtools::install_github("config-i1/smooth")
Notes
The package depends on Rcpp and RcppArmadillo, which will be installed automatically.
However Mac OS users may need to install gfortran libraries in order to use Rcpp. Follow the link for the instructions: http://www.thecoatlessprofessor.com/programming/rcpp-rcpparmadillo-and-os-x-mavericks-lgfortran-and-lquadmath-error/
Sometimes after upgrade of smooth from previous versions some functions stop working. This is because C++ functions are occasionally stored in deeper unknown corners of R's mind. Restarting R usually solves the problem. If it doesn't, completely remove smooth (uninstall + delete the folder "smooth" from R packages folder), restart R and reinstall smooth.