Models Used in finnts

Model
Type
Underlying Package
Description
arima
univariate, local
modeltime, forecast
Regression model that is based on finding relationships between lagged values of the target variable you are trying to forecast.
arima-boost
multivariate, local
modeltime, forecast, xgboost
Arima model (refer to arima) that models the trend compoent of target variable, then uses xgboost model (refer to xgboost) to train on the remaining residuals.
arimax
multivariate, local
modeltime, forecast
ARIMA model that incorporates external regressors and other engineered features.
cubist
multivariate, local, global, ensemble
rules
Hybrid of tree based and linear regression approach. Many decision trees are built, but regression coefficients are used at each terminal node instead of averging values in other tree based approaches.
croston
univariate, local
modeltime, forecast
Useful for intermittent demand forecasting, aka when there are a lot of periods of zero values. Involves simple exponential smoothing on non-zero values of target variable and another application of seasonal exponential smoothing on periods between non-zero elements of the target variable. Refer to ets for more details on exponential smoothing.
ets
univariate, local
modeltime, forecast
Forecasts produced using exponential smoothing methods are weighted averages of past observations, with the weights decaying exponentially as the observations get older. Exponential smoothing models try to forecast the components of a time series which can be broken down in to error, trend, and seasonality. These components can be forecasted separately then either added or multiplied together to get the final forecast output.
glmnet
multivariate, local, global, ensemble
parsnip, glmnet
Linear regression (line of best fit) with regularization to help prevent overfitting and built in variable selection.
mars
multivariate, local, global
parsnip, earth
An extension to linear regression that captures nonlinearities and interactions between variables.
meanf
univariate, local
modeltime, forecast
Simple average of previous year of target variable values.
nnetar
univariate, local
modeltime, forecast
A neural network autoregression model is a traditional feed forward neural network (sometimes called an perceptron) that is fed by lagged values of the historical data set (similar to ARIMA).
1–10 of 22 rows

Univariate vs Multivariate Models

Global vs Local Models

Ensemble Models

Ensemble models are trained on predictions made by individual models. For example, a glmnet ensemble model takes forecasts made by each individual model and feeds them as training data into a glmnet model.

Multistep Horizon Models

By default within prep_models(), the multistep_horizon argument is set to FALSE. If set to TRUE, a multistep horizon approach is taken for specific multivariate models trained on the R1 feature engineering recipe. Below are the models that can run as multistep.

A multistep model optimizes for each period in a forecast horizon. Let’s take an example of a monthly data set with a forecast horizon of 3. When creating the features for the R1 recipe, finnts will create lags of 1, 2, 3, 6, 9, 12 months. Then when training a multistep model it will iteratively use specific features to train the model. First it will train a model on the first forecast horizon (H1), where it will use all available feature lags. Then for H2 it will use lags of 2 or more. Finally for H3 it will use lags of 3 or more. So the final model is actually a collection of multiple models that each trained on a specific horizon. This lets the model optimize for using all available data when creating the forecast. So in our example, one glmnet model actually has three separate horizon specific models under the hood.

A few more things to mention. If multistep_horizon is TRUE then other multivariate models like arima-boost or prophet-xregs will not run a multistep horizon approach. Instead they will use lags that are equal to or greater than the forecast horizon. One set of hyperparameters will be chosen for each multistep model, meaning glmnet will only use one combination of final hyperparameters and apply it to each horizon model. Multistep models are not ran for the R2 recipe, since it has it’s own way of dealing with multiple horizons. Finally if feature_selection is turned on, it will be ran for each horizon specific model, meaning for a 3 month forecast horizon the feature selection process will be ran 3 times. One for each combination of features tied to a specific horizon.

Leveraging the Tidymodels Framework

Most of the models within the package are built on a fantastic time series library called modeltime, which was built on top tidymodels. Tidymodels is a fantastic series of packages that help in feature engineering (recipes), hyperparameter tuning (tune), model training (parsnip), and back testing (resample). Big shout out to the modeltime and tidymodels teams for being the shoulders this package stands on!