Models
Models currently supported by StatsForecast
StatsForecast offers a wide variety of models grouped in the following categories:
-
Auto Forecast: Automatic forecasting tools search for the best parameters and select the best possible model for a series of time series. These tools are useful for large collections of univariate time series. Includes automatic versions of: Arima, ETS, Theta, CES.
-
Exponential Smoothing: Uses a weighted average of all past observations where the weights decrease exponentially into the past. Suitable for data with clear trend and/or seasonality. Use the
SimpleExponential
family for data with no clear trend or seasonality. Examples: SES, Holt’s Winters, SSO. -
Benchmark models: classical models for establishing baselines. Examples: Mean, Naive, Random Walk
-
Intermittent or Sparse models: suited for series with very few non-zero observations. Examples: CROSTON, ADIDA, IMAPA
-
Multiple Seasonalities: suited for signals with more than one clear seasonality. Useful for low-frequency data like electricity and logs. Examples: MSTL and TBATS.
-
Theta Models: fit two theta lines to a deseasonalized time series, using different techniques to obtain and combine the two theta lines to produce the final forecasts. Examples: Theta, DynamicTheta
-
GARCH Model: suited for modeling time series that exhibit non-constant volatility over time. Commonly used in finance to model stock prices, exchange rates, interest rates, and other financial instruments. The ARCH model is a particular case of GARCH.
Automatic Forecasting
AutoARIMA
source
AutoARIMA
*AutoARIMA model.
Automatically selects the best ARIMA (AutoRegressive Integrated Moving Average) model using an information criterion. Default is Akaike Information Criterion (AICc).*
Type | Default | Details | |
---|---|---|---|
d | Optional | None | Order of first-differencing. |
D | Optional | None | Order of seasonal-differencing. |
max_p | int | 5 | Max autorregresives p. |
max_q | int | 5 | Max moving averages q. |
max_P | int | 2 | Max seasonal autorregresives P. |
max_Q | int | 2 | Max seasonal moving averages Q. |
max_order | int | 5 | Max p+q+P+Q value if not stepwise selection. |
max_d | int | 2 | Max non-seasonal differences. |
max_D | int | 1 | Max seasonal differences. |
start_p | int | 2 | Starting value of p in stepwise procedure. |
start_q | int | 2 | Starting value of q in stepwise procedure. |
start_P | int | 1 | Starting value of P in stepwise procedure. |
start_Q | int | 1 | Starting value of Q in stepwise procedure. |
stationary | bool | False | If True, restricts search to stationary models. |
seasonal | bool | True | If False, restricts search to non-seasonal models. |
ic | str | aicc | Information criterion to be used in model selection. |
stepwise | bool | True | If True, will do stepwise selection (faster). |
nmodels | int | 94 | Number of models considered in stepwise search. |
trace | bool | False | If True, the searched ARIMA models is reported. |
approximation | Optional | False | If True, conditional sums-of-squares estimation, final MLE. |
method | Optional | None | Fitting method between maximum likelihood or sums-of-squares. |
truncate | Optional | None | Observations truncated series used in model selection. |
test | str | kpss | Unit root test to use. See ndiffs for details. |
test_kwargs | Optional | None | Unit root test additional arguments. |
seasonal_test | str | seas | Selection method for seasonal differences. |
seasonal_test_kwargs | Optional | None | Seasonal unit root test arguments. |
allowdrift | bool | True | If True, drift models terms considered. |
allowmean | bool | True | If True, non-zero mean models considered. |
blambda | Optional | None | Box-Cox transformation parameter. |
biasadj | bool | False | Use adjusted back-transformed mean Box-Cox. |
season_length | int | 1 | Number of observations per unit of time. Ex: 24 Hourly data. |
alias | str | AutoARIMA | Custom name of the model. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. By default, the model will compute the native prediction intervals. |
source
AutoARIMA.fit
*Fit the AutoARIMA model.
Fit an AutoARIMA to a time series (numpy array) y
and optionally
exogenous variables (numpy array) X
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | Optional exogenous of shape (t, n_x). |
Returns | AutoARIMA fitted model. |
source
AutoARIMA.predict
Predict with fitted AutoArima.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
AutoARIMA.predict_in_sample
Access fitted AutoArima insample predictions.
Type | Default | Details | |
---|---|---|---|
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries fitted for point predictions and level_* for probabilistic predictions. |
source
AutoARIMA.forecast
*Memory Efficient AutoARIMA predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenpus of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x) optional exogenous. |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not returns insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
AutoARIMA.forward
Apply fitted ARIMA model to a new time series.
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels for prediction intervals. |
fitted | bool | False | Whether or not returns insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
AutoETS
source
AutoETS
*Automatic Exponential Smoothing model.
Automatically selects the best ETS (Error, Trend, Seasonality) model
using an information criterion. Default is Akaike Information Criterion
(AICc), while particular models are estimated using maximum likelihood.
The state-space equations can be determined based on their
multiplicative, additive, optimized or ommited components.
The model
string parameter defines the ETS equations: E in
[], T in [], and S in [].
For example when model=‘ANN’ (additive error, no trend, and no seasonality), ETS will explore only a simple exponential smoothing.
If the component is selected as ‘Z’, it operates as a placeholder to ask the AutoETS model to figure out the best parameter.*
Type | Default | Details | |
---|---|---|---|
season_length | int | 1 | Number of observations per unit of time. Ex: 24 Hourly data. |
model | str | ZZZ | Controlling state-space-equations. |
damped | Optional | None | A parameter that ‘dampens’ the trend. |
phi | Optional | None | Smoothing parameter for trend damping. Only used when damped=True . |
alias | str | AutoETS | Custom name of the model. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. By default, the model will compute the native prediction intervals. |
source
AutoETS.fit
*Fit the Exponential Smoothing model.
Fit an Exponential Smoothing model to a time series (numpy array) y
and optionally exogenous variables (numpy array) X
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | Optional exogenous of shape (t, n_x). |
Returns | Exponential Smoothing fitted model. |
source
AutoETS.predict
Predict with fitted Exponential Smoothing.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Optional exogenpus of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
AutoETS.predict_in_sample
Access fitted Exponential Smoothing insample predictions.
Type | Default | Details | |
---|---|---|---|
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries fitted for point predictions and level_* for probabilistic predictions. |
source
AutoETS.forecast
*Memory Efficient Exponential Smoothing predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenpus of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not returns insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
AutoETS.forward
Apply fitted Exponential Smoothing model to a new time series.
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenpus of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
AutoCES
source
AutoCES
*Complex Exponential Smoothing model.
Automatically selects the best Complex Exponential Smoothing model using
an information criterion. Default is Akaike Information Criterion
(AICc), while particular models are estimated using maximum likelihood.
The state-space equations can be determined based on their simple,
parial, optimized or ommited components. The model
string
parameter defines the kind of CES model: for simple CES (withous
seasonality), for simple seasonality (lagged CES), for partial
seasonality (without complex part), for full seasonality (lagged CES
with real and complex seasonal parts).
If the component is selected as ‘Z’, it operates as a placeholder to ask the AutoCES model to figure out the best parameter.*
Type | Default | Details | |
---|---|---|---|
season_length | int | 1 | Number of observations per unit of time. Ex: 24 Hourly data. |
model | str | Z | Controlling state-space-equations. |
alias | str | CES | Custom name of the model. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. By default, the model will compute the native prediction intervals. |
source
AutoCES.fit
*Fit the Complex Exponential Smoothing model.
Fit the Complex Exponential Smoothing model to a time series (numpy
array) y
and optionally exogenous variables (numpy array) X
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | Optional exogenous of shape (t, n_x). |
Returns | Complex Exponential Smoothing fitted model. |
source
AutoCES.predict
Predict with fitted Exponential Smoothing.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
AutoCES.predict_in_sample
Access fitted Exponential Smoothing insample predictions.
Type | Default | Details | |
---|---|---|---|
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries fitted for point predictions and level_* for probabilistic predictions. |
source
AutoCES.forecast
*Memory Efficient Complex Exponential Smoothing predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenpus of shape (h, n_x). |
level | Optional | None | |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
AutoCES.forward
Apply fitted Complex Exponential Smoothing to a new time series.
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenpus of shape (h, n_x). |
level | Optional | None | |
fitted | bool | False | Whether or not returns insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
AutoTheta
source
AutoTheta
*AutoTheta model.
Automatically selects the best Theta (Standard Theta Model (‘STM’), Optimized Theta Model (‘OTM’), Dynamic Standard Theta Model (‘DSTM’), Dynamic Optimized Theta Model (‘DOTM’)) model using mse.*
Type | Default | Details | |
---|---|---|---|
season_length | int | 1 | Number of observations per unit of time. Ex: 24 Hourly data. |
decomposition_type | str | multiplicative | Sesonal decomposition type, ‘multiplicative’ (default) or ‘additive’. |
model | Optional | None | Controlling Theta Model. By default searchs the best model. |
alias | str | AutoTheta | Custom name of the model. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. By default, the model will compute the native prediction intervals. |
source
AutoTheta.fit
*Fit the AutoTheta model.
Fit an AutoTheta model to a time series (numpy array) y
and optionally
exogenous variables (numpy array) X
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | Optional exogenous of shape (t, n_x). |
Returns | AutoTheta fitted model. |
source
AutoTheta.predict
Predict with fitted AutoTheta.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
AutoTheta.predict_in_sample
Access fitted AutoTheta insample predictions.
Type | Default | Details | |
---|---|---|---|
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries fitted for point predictions and level_* for probabilistic predictions. |
source
AutoTheta.forecast
*Memory Efficient AutoTheta predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not returns insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
AutoTheta.forward
Apply fitted AutoTheta to a new time series.
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
AutoMFLES
source
AutoMFLES
AutoMFLES
Type | Default | Details | |
---|---|---|---|
test_size | int | Forecast horizon used during cross validation. | |
season_length | Union | None | Number of observations per unit of time. Ex: 24 Hourly data. |
n_windows | int | 2 | Number of windows used for cross validation. |
config | Optional | None | Mapping from parameter name (from the init arguments of MFLES) to a list of values to try. If None , will use defaults. |
step_size | Optional | None | Step size between each cross validation window. If None will be set to test_size. |
metric | str | smape | Metric used to select the best model. Possible options are: ‘smape’, ‘mape’, ‘mse’ and ‘mae’. |
verbose | bool | False | Print debugging information. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. This is required for generating future prediction intervals. |
alias | str | AutoMFLES | Custom name of the model. |
source
AutoMFLES.fit
Fit the model
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | Exogenous of shape (t, n_x). |
Returns | AutoMFLES | Fitted AutoMFLES object. |
source
AutoMFLES.predict
Predict with fitted AutoMFLES.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Exogenous of shape (h, n_x). |
level | Optional | None | |
Returns | Dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
AutoMFLES.predict_in_sample
Access fitted AutoMFLES insample predictions.
Type | Default | Details | |
---|---|---|---|
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | Dict | Dictionary with entries fitted for point predictions and level_* for probabilistic predictions. |
source
AutoMFLES.forecast
*Memory Efficient AutoMFLES predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Insample exogenous of shape (t, n_x). |
X_future | Optional | None | Exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | Dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
AutoTBATS
source
AutoTBATS
*AutoTBATS model.
Automatically selects the best TBATS model from all feasible combinations of the parameters use_boxcox, use_trend, use_damped_trend, and use_arma_errors. Selection is made using the AIC. Default value for use_arma_errors is True since this enables the evaluation of models with and without ARMA errors.*
Type | Default | Details | |
---|---|---|---|
season_length | Union | ||
use_boxcox | Optional | None | Whether or not to use a Box-Cox transformation. By default tries both. |
bc_lower_bound | float | 0.0 | Lower bound for the Box-Cox transformation. |
bc_upper_bound | float | 1.0 | Upper bound for the Box-Cox transformation. |
use_trend | Optional | None | Whether or not to use a trend component. By default tries both. |
use_damped_trend | Optional | None | Whether or not to dampen the trend component. By default tries both. |
use_arma_errors | bool | True | Whether or not to use a ARMA errors. Default is True and this evaluates both models. |
alias | str | AutoTBATS | Custom name of the model. |
source
AutoTBATS.fit
*Fit TBATS model.
Fit TBATS model to a time series (numpy array) y
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | Ignored |
Returns | TBATS model. |
source
AutoTBATS.predict
Predict with fitted TBATS model.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
AutoTBATS.predict_in_sample
Access fitted TBATS model predictions.
Type | Default | Details | |
---|---|---|---|
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
AutoTBATS.forecast
*Memory Efficient TBATS model.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | |
X_future | Optional | None | |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not returns insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
ARIMA family
ARIMA
source
ARIMA
*ARIMA model.
AutoRegressive Integrated Moving Average model.*
Type | Default | Details | |
---|---|---|---|
order | Tuple | (0, 0, 0) | A specification of the non-seasonal part of the ARIMA model: the three components (p, d, q) are the AR order, the degree of differencing, and the MA order. |
season_length | int | 1 | Number of observations per unit of time. Ex: 24 Hourly data. |
seasonal_order | Tuple | (0, 0, 0) | A specification of the seasonal part of the ARIMA model. (P, D, Q) for the AR order, the degree of differencing, the MA order. |
include_mean | bool | True | Should the ARIMA model include a mean term? The default is True for undifferenced series, False for differenced ones (where a mean would not affect the fit nor predictions). |
include_drift | bool | False | Should the ARIMA model include a linear drift term? (i.e., a linear regression with ARIMA errors is fitted.) |
include_constant | Optional | None | If True, then includ_mean is set to be True for undifferenced series and include_drift is set to be True for differenced series. Note that if there is more than one difference taken, no constant is included regardless of the value of this argument. This is deliberate as otherwise quadratic and higher order polynomial trends would be induced. |
blambda | Optional | None | Box-Cox transformation parameter. |
biasadj | bool | False | Use adjusted back-transformed mean Box-Cox. |
method | str | CSS-ML | Fitting method: maximum likelihood or minimize conditional sum-of-squares. The default (unless there are missing values) is to use conditional-sum-of-squares to find starting values, then maximum likelihood. |
fixed | Optional | None | Dictionary containing fixed coefficients for the arima model. Example: {'ar1': 0.5, 'ma2': 0.75} .For autoregressive terms use the ar{i} keys. For its seasonal version use sar{i} .For moving average terms use the ma{i} keys. For its seasonal version use sma{i} .For intercept and drift use the intercept and drift keys.For exogenous variables use the ex_{i} keys. |
alias | str | ARIMA | Custom name of the model. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. By default, the model will compute the native prediction intervals. |
source
ARIMA.fit
Fit the model to a time series (numpy array) y
and optionally
exogenous variables (numpy array) X
.
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | Optional exogenous of shape (t, n_x). |
Returns | Fitted model. |
source
ARIMA.predict
Predict with fitted model.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
ARIMA.predict_in_sample
Access fitted insample predictions.
Type | Default | Details | |
---|---|---|---|
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries fitted for point predictions and level_* for probabilistic predictions. |
source
ARIMA.forecast
*Memory efficient predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x) optional exogenous. |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not returns insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
ARIMA.forward
Apply fitted model to a new time series.
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels for prediction intervals. |
fitted | bool | False | Whether or not returns insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
AutoRegressive
source
AutoRegressive
Simple Autoregressive model.
Type | Default | Details | |
---|---|---|---|
lags | Tuple | Number of lags to include in the model. If an int is passed then all lags up to lags are considered.If a list, only the elements of the list are considered as lags. | |
include_mean | bool | True | Should the AutoRegressive model include a mean term? The default is True for undifferenced series, False for differenced ones (where a mean would not affect the fit nor predictions). |
include_drift | bool | False | Should the AutoRegressive model include a linear drift term? (i.e., a linear regression with AutoRegressive errors is fitted.) |
blambda | Optional | None | Box-Cox transformation parameter. |
biasadj | bool | False | Use adjusted back-transformed mean Box-Cox. |
method | str | CSS-ML | Fitting method: maximum likelihood or minimize conditional sum-of-squares. The default (unless there are missing values) is to use conditional-sum-of-squares to find starting values, then maximum likelihood. |
fixed | Optional | None | Dictionary containing fixed coefficients for the AutoRegressive model. Example: {'ar1': 0.5, 'ar5': 0.75} .For autoregressive terms use the ar{i} keys. |
alias | str | AutoRegressive | Custom name of the model. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. By default, the model will compute the native prediction intervals. |
source
AutoRegressive.fit
Fit the model to a time series (numpy array) y
and optionally
exogenous variables (numpy array) X
.
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | Optional exogenous of shape (t, n_x). |
Returns | Fitted model. |
source
AutoRegressive.predict
Predict with fitted model.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
AutoRegressive.predict_in_sample
Access fitted insample predictions.
Type | Default | Details | |
---|---|---|---|
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries fitted for point predictions and level_* for probabilistic predictions. |
source
AutoRegressive.forecast
*Memory efficient predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x) optional exogenous. |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not returns insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
AutoRegressive.forward
Apply fitted model to a new time series.
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels for prediction intervals. |
fitted | bool | False | Whether or not returns insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
ExponentialSmoothing
SimpleSmooth
source
SimpleExponentialSmoothing
*SimpleExponentialSmoothing model.
Uses a weighted average of all past observations where the weights decrease exponentially into the past. Suitable for data with no clear trend or seasonality. Assuming there are observations, the one-step forecast is given by:
The rate at which the weights decrease is called the smoothing parameter. When , SES is equal to the naive method.*
Type | Default | Details | |
---|---|---|---|
alpha | float | Smoothing parameter. | |
alias | str | SES | Custom name of the model. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. By default, the model will compute the native prediction intervals. |
source
SimpleExponentialSmoothing.forecast
*Memory Efficient SimpleExponentialSmoothing predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
SimpleExponentialSmoothing.fit
*Fit the SimpleExponentialSmoothing model.
Fit an SimpleExponentialSmoothing to a time series (numpy array) y
and
optionally exogenous variables (numpy array) X
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | Optional exogenous of shape (t, n_x). |
Returns | SimpleExponentialSmoothing fitted model. |
source
SimpleExponentialSmoothing.predict
Predict with fitted SimpleExponentialSmoothing.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
SimpleExponentialSmoothing.predict_in_sample
Access fitted SimpleExponentialSmoothing insample predictions.
SimpleSmoothOptimized
source
SimpleExponentialSmoothingOptimized
*SimpleExponentialSmoothing model.
Uses a weighted average of all past observations where the weights decrease exponentially into the past. Suitable for data with no clear trend or seasonality. Assuming there are observations, the one-step forecast is given by:
The smoothing parameter is optimized by square error minimization.*
Type | Default | Details | |
---|---|---|---|
alias | str | SESOpt | |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. This is required for generating future prediction intervals. |
source
SimpleExponentialSmoothingOptimized.fit
*Fit the SimpleExponentialSmoothingOptimized model.
Fit an SimpleExponentialSmoothingOptimized to a time series (numpy
array) y
and optionally exogenous variables (numpy array) X
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | Optional exogenous of shape (t, n_x). |
Returns | SimpleExponentialSmoothingOptimized fitted model. |
source
SimpleExponentialSmoothingOptimized.predict
Predict with fitted SimpleExponentialSmoothingOptimized.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
SimpleExponentialSmoothingOptimized.predict_in_sample
Access fitted SimpleExponentialSmoothingOptimized insample predictions.
source
SimpleExponentialSmoothingOptimized.forecast
*Memory Efficient SimpleExponentialSmoothingOptimized predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
SeasonalSmooth
source
SeasonalExponentialSmoothing
*SeasonalExponentialSmoothing model.
Uses a weighted average of all past observations where the weights decrease exponentially into the past. Suitable for data with no clear trend or seasonality. Assuming there are observations and season , the one-step forecast is given by: *
Type | Default | Details | |
---|---|---|---|
season_length | int | Number of observations per unit of time. Ex: 24 Hourly data. | |
alpha | float | Smoothing parameter. | |
alias | str | SeasonalES | Custom name of the model. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. This is required for generating future prediction intervals. |
source
SeasonalExponentialSmoothing.fit
*Fit the SeasonalExponentialSmoothing model.
Fit an SeasonalExponentialSmoothing to a time series (numpy array) y
and optionally exogenous variables (numpy array) X
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | Optional exogenous of shape (t, n_x). |
Returns | SeasonalExponentialSmoothing fitted model. |
source
SeasonalExponentialSmoothing.predict
Predict with fitted SeasonalExponentialSmoothing.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
SeasonalExponentialSmoothing.predict_in_sample
Access fitted SeasonalExponentialSmoothing insample predictions.
source
SeasonalExponentialSmoothing.forecast
*Memory Efficient SeasonalExponentialSmoothing predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not returns insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
SeasonalSmoothOptimized
source
SeasonalExponentialSmoothingOptimized
*SeasonalExponentialSmoothingOptimized model.
Uses a weighted average of all past observations where the weights decrease exponentially into the past. Suitable for data with no clear trend or seasonality. Assuming there are observations and season , the one-step forecast is given by:
The smoothing parameter is optimized by square error minimization.*
Type | Default | Details | |
---|---|---|---|
season_length | int | Number of observations per unit of time. Ex: 24 Hourly data. | |
alias | str | SeasESOpt | Custom name of the model. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. This is required for generating future prediction intervals. |
source
SeasonalExponentialSmoothingOptimized.forecast
*Memory Efficient SeasonalExponentialSmoothingOptimized predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
SeasonalExponentialSmoothingOptimized.fit
*Fit the SeasonalExponentialSmoothingOptimized model.
Fit an SeasonalExponentialSmoothingOptimized to a time series (numpy
array) y
and optionally exogenous variables (numpy array) X
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | Optional exogenous of shape (t, n_x). |
Returns | SeasonalExponentialSmoothingOptimized fitted model. |
source
SeasonalExponentialSmoothingOptimized.predict
Predict with fitted SeasonalExponentialSmoothingOptimized.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
SeasonalExponentialSmoothingOptimized.predict_in_sample
Access fitted SeasonalExponentialSmoothingOptimized insample predictions.
Holt’s method
source
Holt
*Holt’s method.
Also known as double exponential smoothing, Holt’s method is an
extension of exponential smoothing for series with a trend. This
implementation returns the corresponding ETS
model with additive (A)
or multiplicative (M) errors (so either ‘AAN’ or ‘MAN’).*
Type | Default | Details | |
---|---|---|---|
season_length | int | 1 | Number of observations per unit of time. Ex: 12 Monthly data. |
error_type | str | A | The type of error of the ETS model. Can be additive (A) or multiplicative (M). |
alias | str | Holt | Custom name of the model. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. By default, the model will compute the native prediction intervals. |
source
Holt.forecast
*Memory Efficient Exponential Smoothing predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenpus of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not returns insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
Holt.fit
*Fit the Exponential Smoothing model.
Fit an Exponential Smoothing model to a time series (numpy array) y
and optionally exogenous variables (numpy array) X
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | Optional exogenous of shape (t, n_x). |
Returns | Exponential Smoothing fitted model. |
source
Holt.predict
Predict with fitted Exponential Smoothing.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Optional exogenpus of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
Holt.predict_in_sample
Access fitted Exponential Smoothing insample predictions.
Type | Default | Details | |
---|---|---|---|
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries fitted for point predictions and level_* for probabilistic predictions. |
source
Holt.forward
Apply fitted Exponential Smoothing model to a new time series.
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenpus of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
Holt-Winters’ method
source
HoltWinters
*Holt-Winters’ method.
Also known as triple exponential smoothing, Holt-Winters’ method is an
extension of exponential smoothing for series that contain both trend
and seasonality. This implementation returns the corresponding ETS
model with additive (A) or multiplicative (M) errors (so either ‘AAA’ or
‘MAM’).*
Type | Default | Details | |
---|---|---|---|
season_length | int | 1 | season length |
error_type | str | A | error type |
alias | str | HoltWinters | Custom name of the model. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. By default, the model will compute the native prediction intervals. |
source
HoltWinters.forecast
*Memory Efficient Exponential Smoothing predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenpus of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not returns insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
HoltWinters.fit
*Fit the Exponential Smoothing model.
Fit an Exponential Smoothing model to a time series (numpy array) y
and optionally exogenous variables (numpy array) X
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | Optional exogenous of shape (t, n_x). |
Returns | Exponential Smoothing fitted model. |
source
HoltWinters.predict
Predict with fitted Exponential Smoothing.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Optional exogenpus of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
HoltWinters.predict_in_sample
Access fitted Exponential Smoothing insample predictions.
Type | Default | Details | |
---|---|---|---|
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries fitted for point predictions and level_* for probabilistic predictions. |
source
HoltWinters.forward
Apply fitted Exponential Smoothing model to a new time series.
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenpus of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
Baseline Models
HistoricAverage
source
HistoricAverage
*HistoricAverage model.
Also known as mean method. Uses a simple average of all past observations. Assuming there are observations, the one-step forecast is given by: *
Type | Default | Details | |
---|---|---|---|
alias | str | HistoricAverage | |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. By default, the model will compute the native prediction intervals. |
source
HistoricAverage.forecast
*Memory Efficient HistoricAverage predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
HistoricAverage.fit
*Fit the HistoricAverage model.
Fit an HistoricAverage to a time series (numpy array) y
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | Optional exogenous of shape (t, n_x). |
Returns | self | HistoricAverage fitted model. |
source
HistoricAverage.predict
Predict with fitted HistoricAverage.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
HistoricAverage.predict_in_sample
Access fitted HistoricAverage insample predictions.
Type | Default | Details | |
---|---|---|---|
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries fitted for point predictions. |
Naive
source
Naive
*Naive model.
All forecasts have the value of the last observation:
for all *
Type | Default | Details | |
---|---|---|---|
alias | str | Naive | |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. By default, the model will compute the native prediction intervals. |
source
Naive.forecast
*Memory Efficient Naive predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n,). | |
h | int | ||
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
Naive.fit
*Fit the Naive model.
Fit an Naive to a time series (numpy.array) y
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | Optional exogenous of shape (t, n_x). |
Returns | self: | Naive fitted model. |
source
Naive.predict
Predict with fitted Naive.
Type | Default | Details | |
---|---|---|---|
h | int | forecasting horizon | |
X | Optional | None | exogenous regressors |
level | Optional | None | confidence level |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
Naive.predict_in_sample
Access fitted Naive insample predictions.
Type | Default | Details | |
---|---|---|---|
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries fitted for point predictions. |
RandomWalkWithDrift
source
RandomWalkWithDrift
*RandomWalkWithDrift model.
A variation of the naive method allows the forecasts to change over time. The amout of change, called drift, is the average change seen in the historical data.
From the previous equation, we can see that this is equivalent to extrapolating a line between the first and the last observation.*
Type | Default | Details | |
---|---|---|---|
alias | str | RWD | Custom name of the model. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. By default, the model will compute the native prediction intervals. |
source
RandomWalkWithDrift.forecast
*Memory Efficient RandomWalkWithDrift predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n,). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | forecasts: dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
RandomWalkWithDrift.fit
*Fit the RandomWalkWithDrift model.
Fit an RandomWalkWithDrift to a time series (numpy array) y
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | ||
X | Optional | None | |
Returns | RandomWalkWithDrift fitted model. |
source
RandomWalkWithDrift.predict
Predict with fitted RandomWalkWithDrift.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
RandomWalkWithDrift.predict_in_sample
Access fitted RandomWalkWithDrift insample predictions.
Type | Default | Details | |
---|---|---|---|
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries fitted for point predictions and level_* for probabilistic predictions. |
SeasonalNaive
source
SeasonalNaive
*Seasonal naive model.
A method similar to the naive, but uses the last known observation of the same period (e.g. the same month of the previous year) in order to capture seasonal variations.*
Type | Default | Details | |
---|---|---|---|
season_length | int | Number of observations per unit of time. Ex: 24 Hourly data. | |
alias | str | SeasonalNaive | Custom name of the model. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. By default, the model will compute the native prediction intervals. |
source
SeasonalNaive.forecast
*Memory Efficient SeasonalNaive predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
SeasonalNaive.fit
*Fit the SeasonalNaive model.
Fit an SeasonalNaive to a time series (numpy array) y
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | |
Returns | SeasonalNaive fitted model. |
source
SeasonalNaive.predict
Predict with fitted Naive.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | |
level | Optional | None | |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
SeasonalNaive.predict_in_sample
Access fitted SeasonalNaive insample predictions.
Type | Default | Details | |
---|---|---|---|
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries fitted for point predictions and level_* for probabilistic predictions. |
WindowAverage
source
WindowAverage
*WindowAverage model.
Uses the average of the last observations, with the length of the window. Wider windows will capture global trends, while narrow windows will reveal local trends. The length of the window selected should take into account the importance of past observations and how fast the series changes.*
Type | Default | Details | |
---|---|---|---|
window_size | int | Size of truncated series on which average is estimated. | |
alias | str | WindowAverage | Custom name of the model. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. This is required for generating future prediction intervals. |
source
WindowAverage.forecast
*Memory Efficient WindowAverage predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
WindowAverage.fit
*Fit the WindowAverage model.
Fit an WindowAverage to a time series (numpy array) y
and optionally
exogenous variables (numpy array) X
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | Optional exogenous of shape (t, n_x). |
Returns | WindowAverage fitted model. |
source
WindowAverage.predict
Predict with fitted WindowAverage.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
SeasonalWindowAverage
source
SeasonalWindowAverage
*SeasonalWindowAverage model.
An average of the last observations of the same period, with the length of the window.*
Type | Default | Details | |
---|---|---|---|
season_length | int | ||
window_size | int | Size of truncated series on which average is estimated. | |
alias | str | SeasWA | Custom name of the model. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. This is required for generating future prediction intervals. |
source
SeasonalWindowAverage.forecast
*Memory Efficient SeasonalWindowAverage predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n,). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
SeasonalWindowAverage.fit
*Fit the SeasonalWindowAverage model.
Fit an SeasonalWindowAverage to a time series (numpy array) y
and
optionally exogenous variables (numpy array) X
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | Optional exogenpus of shape (t, n_x). |
Returns | SeasonalWindowAverage fitted model. |
source
SeasonalWindowAverage.predict
Predict with fitted SeasonalWindowAverage.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
Sparse or Intermittent
ADIDA
source
ADIDA
*ADIDA model.
Aggregate-Dissagregate Intermittent Demand Approach: Uses temporal aggregation to reduce the number of zero observations. Once the data has been agregated, it uses the optimized SES to generate the forecasts at the new level. It then breaks down the forecast to the original level using equal weights.
ADIDA specializes on sparse or intermittent series are series with very few non-zero observations. They are notoriously hard to forecast, and so, different methods have been developed especifically for them.*
Type | Default | Details | |
---|---|---|---|
alias | str | ADIDA | Custom name of the model. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. By default, the model will compute the native prediction intervals. |
source
ADIDA.forecast
*Memory Efficient ADIDA predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n,). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
ADIDA.fit
*Fit the ADIDA model.
Fit an ADIDA to a time series (numpy array) y
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | |
Returns | ADIDA fitted model. |
source
ADIDA.predict
Predict with fitted ADIDA.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
CrostonClassic
source
CrostonClassic
*CrostonClassic model.
A method to forecast time series that exhibit intermittent demand. It decomposes the original time series into a non-zero demand size and inter-demand intervals . Then the forecast is given by:
where and are forecasted using SES. The smoothing parameter of both components is set equal to 0.1*
Type | Default | Details | |
---|---|---|---|
alias | str | CrostonClassic | Custom name of the model. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. By default, the model will compute the native prediction intervals. |
source
CrostonClassic.forecast
*Memory Efficient CrostonClassic predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not returns insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
CrostonClassic.fit
*Fit the CrostonClassic model.
Fit an CrostonClassic to a time series (numpy array) y
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | |
Returns | CrostonClassic fitted model. |
source
CrostonClassic.predict
Predict with fitted CrostonClassic.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
CrostonOptimized
source
CrostonOptimized
*CrostonOptimized model.
A method to forecast time series that exhibit intermittent demand. It decomposes the original time series into a non-zero demand size and inter-demand intervals . Then the forecast is given by:
A variation of the classic Croston’s method where the smooting paramater is optimally selected from the range . Both the non-zero demand and the inter-demand intervals are smoothed separately, so their smoothing parameters can be different.*
Type | Default | Details | |
---|---|---|---|
alias | str | CrostonOptimized | Custom name of the model. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. This is required for generating future prediction intervals. |
source
CrostonOptimized.forecast
*Memory Efficient CrostonOptimized predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | |
fitted | bool | False | Whether or not returns insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
CrostonOptimized.fit
*Fit the CrostonOptimized model.
Fit an CrostonOptimized to a time series (numpy array) y
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | |
Returns | CrostonOptimized fitted model. |
source
CrostonOptimized.predict
Predict with fitted CrostonOptimized.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
CrostonSBA
source
CrostonSBA
*CrostonSBA model.
A method to forecast time series that exhibit intermittent demand. It decomposes the original time series into a non-zero demand size and inter-demand intervals . Then the forecast is given by:
A variation of the classic Croston’s method that uses a debiasing factor, so that the forecast is given by: *
Type | Default | Details | |
---|---|---|---|
alias | str | CrostonSBA | Custom name of the model. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. By default, the model will compute the native prediction intervals. |
source
CrostonSBA.forecast
*Memory Efficient CrostonSBA predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
CrostonSBA.fit
*Fit the CrostonSBA model.
Fit an CrostonSBA to a time series (numpy array) y
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | |
Returns | CrostonSBA fitted model. |
source
CrostonSBA.predict
Predict with fitted CrostonSBA.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
IMAPA
source
IMAPA
*IMAPA model.
Intermittent Multiple Aggregation Prediction Algorithm: Similar to ADIDA, but instead of using a single aggregation level, it considers multiple in order to capture different dynamics of the data. Uses the optimized SES to generate the forecasts at the new levels and then combines them using a simple average.*
Type | Default | Details | |
---|---|---|---|
alias | str | IMAPA | Custom name of the model. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. By default, the model will compute the native prediction intervals. |
source
IMAPA.forecast
*Memory Efficient IMAPA predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
IMAPA.fit
*Fit the IMAPA model.
Fit an IMAPA to a time series (numpy array) y
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | |
Returns | IMAPA fitted model. |
source
IMAPA.predict
Predict with fitted IMAPA.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | |
level | Optional | None | |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
TSB
source
TSB
*TSB model.
Teunter-Syntetos-Babai: A modification of Croston’s method that replaces the inter-demand intervals with the demand probability , which is defined as follows.
Hence, the forecast is given by
Both and are forecasted using SES. The smooting paramaters of each may differ, like in the optimized Croston’s method.*
Type | Default | Details | |
---|---|---|---|
alpha_d | float | Smoothing parameter for demand. | |
alpha_p | float | Smoothing parameter for probability. | |
alias | str | TSB | Custom name of the model. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. This is required for generating future prediction intervals. |
source
TSB.forecast
*Memory Efficient TSB predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | |
fitted | bool | False | Whether or not returns insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
TSB.fit
*Fit the TSB model.
Fit an TSB to a time series (numpy array) y
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | |
Returns | TSB fitted model. |
source
TSB.predict
Predict with fitted TSB.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
Multiple Seasonalities
MSTL
source
MSTL
*MSTL model.
The MSTL (Multiple Seasonal-Trend decomposition using LOESS) decomposes the time series in multiple seasonalities using LOESS. Then forecasts the trend using a custom non-seaonal model and each seasonality using a SeasonalNaive model.*
Type | Default | Details | |
---|---|---|---|
season_length | Union | Number of observations per unit of time. For multiple seasonalities use a list. | |
trend_forecaster | AutoETS | AutoETS | StatsForecast model used to forecast the trend component. |
stl_kwargs | Optional | None | Extra arguments to pass to statsmodels.tsa.seasonal.STL .The period and seasonal arguments are reserved. |
alias | str | MSTL | Custom name of the model. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. By default, the model will compute the native prediction intervals. |
source
MSTL.fit
*Fit the MSTL model.
Fit MSTL to a time series (numpy array) y
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | |
Returns | MSTL fitted model. |
source
MSTL.predict
Predict with fitted MSTL.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
MSTL.predict_in_sample
Access fitted MSTL insample predictions.
Type | Default | Details | |
---|---|---|---|
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries fitted for point predictions and level_* for probabilistic predictions. |
source
MSTL.forecast
*Memory Efficient MSTL predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
MSTL.forward
Apply fitted MSTL model to a new time series.
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
MFLES
source
MFLES
*MFLES model.
A method to forecast time series based on Gradient Boosted Time Series Decomposition which treats traditional decomposition as the base estimator in the boosting process. Unlike normal gradient boosting, slight learning rates are applied at the component level (trend/seasonality/exogenous).
The method derives its name from some of the underlying estimators that can enter into the boosting procedure, specifically: a simple Median, Fourier functions for seasonality, a simple/piecewise Linear trend, and Exponential Smoothing.*
Type | Default | Details | |
---|---|---|---|
season_length | Union | None | Number of observations per unit of time. Ex: 24 Hourly data. |
fourier_order | Optional | None | How many fourier sin/cos pairs to create, the larger the number the more complex of a seasonal pattern can be fitted. A lower number leads to smoother results. This is auto-set based on seasonal_period. |
max_rounds | int | 50 | The max number of boosting rounds. The boosting will auto-stop but depending on other parameters such as rs_lr you may want more rounds. Generally more rounds means a smoother fit. |
ma | Optional | None | The moving average order to use, this is auto-set based on internal logic. Passing 4 would fit a 4 period moving average on the residual component. |
alpha | float | 1.0 | The alpha which is used in fitting the underlying LASSO when using piecewise functions. |
decay | float | -1.0 | Effects the slopes of the piecewise-linear basis function. |
changepoints | bool | True | Whether to fit for changepoints if all other logic allows for it. If False, MFLES will not ever fit a piecewise trend. |
n_changepoints | Union | 0.25 | Number (if int) or proportion (if float) of changepoint knots to place. The default of 0.25 will place 0.25 * (series length) number of knots. |
seasonal_lr | float | 0.9 | A shrinkage parameter (0 < seasonal_lr <= 1) which penalizes the seasonal fit. A value of 0.9 will flatly multiply the seasonal fit by 0.9 each boosting round, this can be used to allow more signal to the exogenous component. |
trend_lr | float | 0.9 | A shrinkage parameter (0 < trend_lr <= 1) which penalizes the linear trend fit A value of 0.9 will flatly multiply the linear fit by 0.9 each boosting round, this can be used to allow more signal to the seasonality or exogenous components. |
exogenous_lr | float | 1.0 | The shrinkage parameter (0 < exogenous_lr <= 1) which controls how much of the exogenous signal is carried to the next round. |
residuals_lr | float | 1.0 | A shrinkage parameter (0 < residuals_lr <= 1) which penalizes the residual smoothing. A value of 0.9 will flatly multiply the residual fit by 0.9 each boosting round, this can be used to allow more signal to the seasonality or linear components. |
cov_threshold | float | 0.7 | The deseasonalized cov is used to auto-set some logic, lowering the cov_threshold will result in simpler and less complex residual smoothing. If you pass something like 1000 then there will be no safeguards applied. |
moving_medians | bool | False | The default behavior is to fit an initial median to the time series. If True, then it will fit a median per seasonal period. |
min_alpha | float | 0.05 | The minimum alpha in the SES ensemble. |
max_alpha | float | 1.0 | The maximum alpha used in the SES ensemble. |
trend_penalty | bool | True | Whether to apply a simple penalty to the linear trend component, very useful for dealing with the potentially dangerous piecewise trend. |
multiplicative | Optional | None | Auto-set based on internal logic. If True, it will simply take the log of the time series. |
smoother | bool | False | If True, then a simple exponential ensemble will be used rather than auto settings. |
robust | Optional | None | If True then MFLES will fit using more reserved methods, i.e. not using piecewise trend or moving average residual smoother. Auto-set based on internal logic. |
verbose | bool | False | Print debugging information. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. This is required for generating future prediction intervals. |
alias | str | MFLES | Custom name of the model. |
source
MFLES.fit
Fit the model
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | Exogenous of shape (t, n_x). |
Returns | MFLES | Fitted MFLES object. |
source
MFLES.predict
Predict with fitted MFLES.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Exogenous of shape (h, n_x). |
level | Optional | None | |
Returns | Dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
MFLES.predict_in_sample
Access fitted SklearnModel insample predictions.
Type | Default | Details | |
---|---|---|---|
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | Dict | Dictionary with entries fitted for point predictions and level_* for probabilistic predictions. |
source
MFLES.forecast
*Memory Efficient MFLES predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Insample exogenous of shape (t, n_x). |
X_future | Optional | None | Exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | Dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
TBATS
source
TBATS
*Trigonometric Box-Cox transform, ARMA errors, Trend and Seasonal components (TBATS) model.
TBATS is an innovations state space model framework used for forecasting time series with multiple seasonalities. It uses a Box-Cox tranformation, ARMA errors, and a trigonometric representation of the seasonal patterns based on Fourier series.
The name TBATS is an acronym for the key features of the model: Trigonometric, Box-Cox transform, ARMA errors, Trend, and Seasonal components.*
Type | Default | Details | |
---|---|---|---|
season_length | Union | Number of observations per unit of time. Ex: 24 Hourly data. | |
use_boxcox | Optional | True | Whether or not to use a Box-Cox transformation. |
bc_lower_bound | float | 0.0 | Lower bound for the Box-Cox transformation. |
bc_upper_bound | float | 1.0 | Upper bound for the Box-Cox transformation. |
use_trend | Optional | True | Whether or not to use a trend component. |
use_damped_trend | Optional | False | Whether or not to dampen the trend component. |
use_arma_errors | bool | False | Whether or not to use a ARMA errors. |
alias | str | TBATS | Custom name of the model. |
source
TBATS.fit
*Fit TBATS model.
Fit TBATS model to a time series (numpy array) y
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | Ignored |
Returns | TBATS model. |
source
TBATS.predict
Predict with fitted TBATS model.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
TBATS.predict_in_sample
Access fitted TBATS model predictions.
Type | Default | Details | |
---|---|---|---|
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
TBATS.forecast
*Memory Efficient TBATS model.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | |
X_future | Optional | None | |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not returns insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
Theta Family
Standard Theta Method
source
Theta
Standard Theta Method.
Type | Default | Details | |
---|---|---|---|
season_length | int | 1 | Number of observations per unit of time. Ex: 24 Hourly data. |
decomposition_type | str | multiplicative | Sesonal decomposition type, ‘multiplicative’ (default) or ‘additive’. |
alias | str | Theta | Custom name of the model. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. By default, the model will compute the native prediction intervals. |
source
Theta.forecast
*Memory Efficient AutoTheta predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not returns insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
Theta.fit
*Fit the AutoTheta model.
Fit an AutoTheta model to a time series (numpy array) y
and optionally
exogenous variables (numpy array) X
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | Optional exogenous of shape (t, n_x). |
Returns | AutoTheta fitted model. |
source
Theta.predict
Predict with fitted AutoTheta.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
Theta.predict_in_sample
Access fitted AutoTheta insample predictions.
Type | Default | Details | |
---|---|---|---|
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries fitted for point predictions and level_* for probabilistic predictions. |
source
Theta.forward
Apply fitted AutoTheta to a new time series.
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
Optimized Theta Method
source
OptimizedTheta
Optimized Theta Method.
Type | Default | Details | |
---|---|---|---|
season_length | int | 1 | Number of observations per unit of time. Ex: 24 Hourly data. |
decomposition_type | str | multiplicative | Sesonal decomposition type, ‘multiplicative’ (default) or ‘additive’. |
alias | str | OptimizedTheta | Custom name of the model. Default OptimizedTheta . |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. By default, the model will compute the native prediction intervals. |
source
OptimizedTheta.forecast
*Memory Efficient AutoTheta predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not returns insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
OptimizedTheta.fit
*Fit the AutoTheta model.
Fit an AutoTheta model to a time series (numpy array) y
and optionally
exogenous variables (numpy array) X
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | Optional exogenous of shape (t, n_x). |
Returns | AutoTheta fitted model. |
source
OptimizedTheta.predict
Predict with fitted AutoTheta.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
OptimizedTheta.predict_in_sample
Access fitted AutoTheta insample predictions.
Type | Default | Details | |
---|---|---|---|
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries fitted for point predictions and level_* for probabilistic predictions. |
source
OptimizedTheta.forward
Apply fitted AutoTheta to a new time series.
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
Dynamic Standard Theta Method
source
DynamicTheta
Dynamic Standard Theta Method.
Type | Default | Details | |
---|---|---|---|
season_length | int | 1 | Number of observations per unit of time. Ex: 24 Hourly data. |
decomposition_type | str | multiplicative | Sesonal decomposition type, ‘multiplicative’ (default) or ‘additive’. |
alias | str | DynamicTheta | Custom name of the model. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. By default, the model will compute the native prediction intervals. |
source
DynamicTheta.forecast
*Memory Efficient AutoTheta predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not returns insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
DynamicTheta.fit
*Fit the AutoTheta model.
Fit an AutoTheta model to a time series (numpy array) y
and optionally
exogenous variables (numpy array) X
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | Optional exogenous of shape (t, n_x). |
Returns | AutoTheta fitted model. |
source
DynamicTheta.predict
Predict with fitted AutoTheta.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
DynamicTheta.predict_in_sample
Access fitted AutoTheta insample predictions.
Type | Default | Details | |
---|---|---|---|
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries fitted for point predictions and level_* for probabilistic predictions. |
source
DynamicTheta.forward
Apply fitted AutoTheta to a new time series.
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
Dynamic Optimized Theta Method
source
DynamicOptimizedTheta
Dynamic Optimized Theta Method.
Type | Default | Details | |
---|---|---|---|
season_length | int | 1 | Number of observations per unit of time. Ex: 24 Hourly data. |
decomposition_type | str | multiplicative | Sesonal decomposition type, ‘multiplicative’ (default) or ‘additive’. |
alias | str | DynamicOptimizedTheta | Custom name of the model. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. By default, the model will compute the native prediction intervals. |
source
DynamicOptimizedTheta.forecast
*Memory Efficient AutoTheta predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not returns insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
DynamicOptimizedTheta.fit
*Fit the AutoTheta model.
Fit an AutoTheta model to a time series (numpy array) y
and optionally
exogenous variables (numpy array) X
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | Optional exogenous of shape (t, n_x). |
Returns | AutoTheta fitted model. |
source
DynamicOptimizedTheta.predict
Predict with fitted AutoTheta.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
DynamicOptimizedTheta.predict_in_sample
Access fitted AutoTheta insample predictions.
Type | Default | Details | |
---|---|---|---|
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries fitted for point predictions and level_* for probabilistic predictions. |
source
DynamicOptimizedTheta.forward
Apply fitted AutoTheta to a new time series.
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
ARCH Family
Garch model
source
GARCH
*Generalized Autoregressive Conditional Heteroskedasticity (GARCH) model.
A method for modeling time series that exhibit non-constant volatility over time. The GARCH model assumes that at time , is given by:
with
.
Here is a sequence of iid random variables with zero mean and unit variance. The coefficients , , , and , must satisfy the following conditions:
- and for all and .
- . Here it is assumed that for and for .
The ARCH model is a particular case of the GARCH model when .*
Type | Default | Details | |
---|---|---|---|
p | int | 1 | Number of lagged versions of the series. |
q | int | 1 | |
alias | str | GARCH | Custom name of the model. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. By default, the model will compute the native prediction intervals. |
source
GARCH.fit
*Fit GARCH model.
Fit GARCH model to a time series (numpy array) y
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | |
Returns | GARCH model. |
source
GARCH.predict
Predict with fitted GARCH model.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
GARCH.predict_in_sample
Access fitted GARCH model predictions.
Type | Default | Details | |
---|---|---|---|
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries fitted for point predictions and level_* for probabilistic predictions. |
source
GARCH.forecast
*Memory Efficient GARCH model.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | |
X_future | Optional | None | |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not returns insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
ARCH model
source
ARCH
*Autoregressive Conditional Heteroskedasticity (ARCH) model.
A particular case of the GARCH(p,q) model where . It assumes that at time , is given by:
with
.
Here is a sequence of iid random variables with zero mean and unit variance. The coefficients and , must be nonnegative and .*
Type | Default | Details | |
---|---|---|---|
p | int | 1 | Number of lagged versions of the series. |
alias | str | ARCH | Custom name of the model. |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. By default, the model will compute the native prediction intervals. |
source
ARCH.fit
*Fit GARCH model.
Fit GARCH model to a time series (numpy array) y
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | |
Returns | GARCH model. |
source
ARCH.predict
Predict with fitted GARCH model.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
ARCH.predict_in_sample
Access fitted GARCH model predictions.
Type | Default | Details | |
---|---|---|---|
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries fitted for point predictions and level_* for probabilistic predictions. |
source
ARCH.forecast
*Memory Efficient GARCH model.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | |
X_future | Optional | None | |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not returns insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
Machine Learning models
SklearnModel
source
SklearnModel
scikit-learn model wrapper
Type | Default | Details | |
---|---|---|---|
model | sklearn.base.BaseEstimator | scikit-learn estimator | |
prediction_intervals | Optional | None | Information to compute conformal prediction intervals. This is required for generating future prediction intervals. |
alias | Optional | None | Custom name of the model. If None will use the model’s class. |
source
SklearnModel.fit
Fit the model.
Type | Details | |
---|---|---|
y | ndarray | Clean time series of shape (t, ). |
X | ndarray | Exogenous of shape (t, n_x). |
Returns | SklearnModel | Fitted SklearnModel object. |
source
SklearnModel.predict
Predict with fitted SklearnModel.
Type | Default | Details | |
---|---|---|---|
h | int | Forecast horizon. | |
X | ndarray | Exogenous of shape (h, n_x). | |
level | Optional | None | |
Returns | Dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
SklearnModel.predict_in_sample
Access fitted SklearnModel insample predictions.
Type | Default | Details | |
---|---|---|---|
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | Dict | Dictionary with entries fitted for point predictions and level_* for probabilistic predictions. |
source
SklearnModel.forecast
*Memory Efficient SklearnModel predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
h | int | Forecast horizon. | |
X | ndarray | Insample exogenous of shape (t, n_x). | |
X_future | ndarray | Exogenous of shape (h, n_x). | |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | Dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
Fallback Models
ConstantModel
source
ConstantModel
*Constant Model.
Returns Constant values.*
source
ConstantModel.forecast
*Memory Efficient Constant Model predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n,). | |
h | int | ||
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
ConstantModel.fit
*Fit the Constant model.
Fit an Constant Model to a time series (numpy.array) y
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | Optional exogenous of shape (t, n_x). |
Returns | self: | Constant fitted model. |
source
ConstantModel.predict
Predict with fitted ConstantModel.
Type | Default | Details | |
---|---|---|---|
h | int | forecasting horizon | |
X | Optional | None | exogenous regressors |
level | Optional | None | confidence level |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
ConstantModel.predict_in_sample
Access fitted Constant Model insample predictions.
Type | Default | Details | |
---|---|---|---|
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries fitted for point predictions and level_* for probabilistic predictions. |
source
ConstantModel.forward
Apply Constant model predictions to a new/updated time series.
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels for prediction intervals. |
fitted | bool | False | Whether or not returns insample predictions. |
Returns | dict | Dictionary with entries constant for point predictions and level_* for probabilistic predictions. |
ZeroModel
source
ZeroModel
*Returns Zero forecasts.
Returns Zero values.*
source
ZeroModel.forecast
*Memory Efficient Constant Model predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n,). | |
h | int | ||
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
ZeroModel.fit
*Fit the Constant model.
Fit an Constant Model to a time series (numpy.array) y
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | Optional exogenous of shape (t, n_x). |
Returns | self: | Constant fitted model. |
source
ZeroModel.predict
Predict with fitted ConstantModel.
Type | Default | Details | |
---|---|---|---|
h | int | forecasting horizon | |
X | Optional | None | exogenous regressors |
level | Optional | None | confidence level |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
ZeroModel.predict_in_sample
Access fitted Constant Model insample predictions.
Type | Default | Details | |
---|---|---|---|
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries fitted for point predictions and level_* for probabilistic predictions. |
source
ZeroModel.forward
Apply Constant model predictions to a new/updated time series.
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n, ). | |
h | int | Forecast horizon. | |
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels for prediction intervals. |
fitted | bool | False | Whether or not returns insample predictions. |
Returns | dict | Dictionary with entries constant for point predictions and level_* for probabilistic predictions. |
NaNModel
source
NaNModel
*NaN Model.
Returns NaN values.*
source
NaNModel.forecast
*Memory Efficient Constant Model predictions.
This method avoids memory burden due from object storage. It is
analogous to fit_predict
without storing information. It assumes you
know the forecast horizon in advance.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (n,). | |
h | int | ||
X | Optional | None | Optional insample exogenous of shape (t, n_x). |
X_future | Optional | None | Optional exogenous of shape (h, n_x). |
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
fitted | bool | False | Whether or not to return insample predictions. |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
NaNModel.fit
*Fit the Constant model.
Fit an Constant Model to a time series (numpy.array) y
.*
Type | Default | Details | |
---|---|---|---|
y | ndarray | Clean time series of shape (t, ). | |
X | Optional | None | Optional exogenous of shape (t, n_x). |
Returns | self: | Constant fitted model. |
source
NaNModel.predict
Predict with fitted ConstantModel.
Type | Default | Details | |
---|---|---|---|
h | int | forecasting horizon | |
X | Optional | None | exogenous regressors |
level | Optional | None | confidence level |
Returns | dict | Dictionary with entries mean for point predictions and level_* for probabilistic predictions. |
source
NaNModel.predict_in_sample
Access fitted Constant Model insample predictions.
Type | Default | Details | |
---|---|---|---|
level | Optional | None | Confidence levels (0-100) for prediction intervals. |
Returns | dict | Dictionary with entries fitted for point predictions and level_* for probabilistic predictions. |