SNARIMAX
SNARIMAX stands for Seasonal Non-linear Auto Regressive Integrated Moving-Average with eXogenous inputs model.
This model generalizes many established time series models in a single interface that can be trained online. It assumes that the provided training data is ordered in time and is uniformly spaced. It is made up of the following components:
- S (Seasonal)
-
N (Non-linear): Any online regression model can be used, not necessarily a linear regression as is done in textbooks.
-
AR (Autoregressive): Lags of the target variable are used as features.
-
I (Integrated): The model can be fitted on a differenced version of a time series. In this context, integration is the reverse of differencing.
-
MA (Moving average): Lags of the errors are used as features.
-
X (Exogenous): Users can provide additional features. Care has to be taken to include features that will be available both at training and prediction time.
Each of these components can be switched on and off by specifying the appropriate parameters. Classical time series models such as AR
, MA
, ARMA
, and ARIMA
can thus be seen as special parametrizations of the SNARIMAX model.
This model is tailored for time series that are homoskedastic. In other words, it might not work well if the variance of the time series varies widely along time.
Parameters
-
p(
int
) → Order of the autoregressive part. This is the number of past target values that will be included as features. -
d(
int
) → Differencing order. -
q(
int
) → Order of the moving average part. This is the number of past error terms that will be included as features. -
m(
int
, Default:1
) → Season length used for extracting seasonal features. If you believe your data has a seasonal pattern, then set this accordingly. For instance, if the data seems to exhibit a yearly seasonality, and that your data is spaced by month, then you should set this to 12. Note that for this parameter to have any impact you should also set at least one of thep
,d
, andq
parameters. -
sp(
int
, Default:0
) → Seasonal order of the autoregressive part. This is the number of past target values that will be included as features. -
sd(
int
, Default:0
) → Seasonal differencing order. -
sq(
int
, Default:0
) → Seasonal order of the moving average part. This is the number of past error terms that will be included as features. -
base_model(
Model
) → The online regression model to use.
Example Usage
We can create an instance and deploy SNARIMAX model like this.
import turboml as tb
snarimax_model = tb.SNARIMAX(p = 12, q = 12, m = 12, sd = 1, base_model = tb.HoeffdingTreeRegressor())