Esc
Ask AIAnswers may be inaccurate; check the linked pages.Esc
Ask anything about these docs, like how to get started or what a function does.

AutoARIMA

auto_arima.AutoARIMA · inherits BaseForecaster

Performs automatic ARIMA model selection and fitting over configured search spaces, then exposes forecasting and interval prediction APIs.

Attributes:

Name Type Description
uses_exog bool Whether exogenous features are supported.
model_ dict[str, Any] \| None Fitted model payload after fit.
standardize bool Whether to normalize series before optimization.

__init__(self, d=None, D=None, max_p=5, max_q=5, max_P=2, max_Q=2, max_order=5, max_d=2, max_D=1, start_p=2, start_q=2, start_P=1, start_Q=1, stationary=False, seasonal=True, ic='aicc', stepwise=True, nmodels=94, method='CSS-ML', allowdrift=True, allowmean=True, period=None)

Set up AutoARIMA search bounds, options, and internal caches.

Parameter Type Default Description
d Optional[int] None Optional non-seasonal differencing override.
D Optional[int] None Optional seasonal differencing override.
max_p int 5 Maximum non-seasonal AR order.
max_q int 5 Maximum non-seasonal MA order.
max_P int 2 Maximum seasonal AR order.
max_Q int 2 Maximum seasonal MA order.
max_order int 5 Maximum total ARMA order budget.
max_d int 2 Upper bound for inferred non-seasonal differencing.
max_D int 1 Upper bound for inferred seasonal differencing.
start_p int 2 Initial stepwise AR order.
start_q int 2 Initial stepwise MA order.
start_P int 1 Initial stepwise seasonal AR order.
start_Q int 1 Initial stepwise seasonal MA order.
stationary bool False Force stationary differencing (d=D=0) when true.
seasonal bool True Enable seasonal search behavior.
ic str 'aicc' Information criterion for model selection.
stepwise bool True Enable stepwise search over full grid search.
nmodels int 94 Max number of candidate fits during stepwise search.
method str 'CSS-ML' Fitting objective path (CSS, ML, or hybrid).
allowdrift bool True Allow drift models when integration order is one.
allowmean bool True Allow mean term for stationary candidates.
period Optional[int] None Seasonal period, or auto-detect when None.

fit(self, y, X=None) -> Self

Fit automatic ARIMA model selection on a series.

Parameters:

Parameter Type Default Description
y jnp.ndarray - Training target series.
X Optional[jnp.ndarray] None Optional exogenous regressors.

Returns: Self (The fitted estimator instance.)

forecast(self, h, y, X=None, X_future=None, level=None, fitted=False) -> dict

Produce fast forecasts from history with cached-order optimization.

Parameters:

Parameter Type Default Description
h int - Forecast horizon.
y jnp.ndarray - Input history series.
X Optional[jnp.ndarray] None Optional exogenous matrix.
X_future Optional[jnp.ndarray] None Future exogenous regressors (unused; included for BaseForecaster compliance).
level Optional[list] None Confidence levels (unused; included for BaseForecaster compliance).
fitted bool False Whether to return fitted values (unused; included for BaseForecaster compliance).

Returns: dict

Key Type Description
"mean" jnp.ndarray Point forecasts.

predict(self, h, X=None, level=None) -> dict

Forecast from the fitted automatic ARIMA model.

Parameters:

Parameter Type Default Description
h int - Forecast horizon.
X Optional[jnp.ndarray] None Optional future exogenous matrix.
level Optional[Union[int, Tuple[int, ...]]] None Confidence levels.

Returns: dict

Key Type Description
"mean" jnp.ndarray Mean forecast.
"lo-{level}" jnp.ndarray Lower bound of the confidence interval (if level is provided).
"hi-{level}" jnp.ndarray Upper bound of the confidence interval (if level is provided).

summary(self) -> str

Return a compact textual summary of the fitted model.

Parameters:

Parameter Type Default Description
self - - This method takes no explicit parameters beyond self.

Returns: str (Human-readable model summary.)

ARIMA

auto_arima.ARIMA · inherits BaseForecaster

Fixed-order ARIMA forecaster backed by shared JAX optimization kernels.

Attributes:

Name Type Description
uses_exog bool Indicates exogenous support.
model_ dict[str, Any] \| None Fitted model payload.
alias str Friendly model label.
standardize bool Whether to normalize series during fitting.

__init__(self, order=(0, 0, 0), seasonal_order=(0, 0, 0), period=1, include_mean=True, method='CSS', alias='ARIMA', standardize=True)

Set up fixed-order ARIMA and precompute differencing and ARMA metadata.

Parameter Type Default Description
order Tuple[int, int, int] (0, 0, 0) Non-seasonal order (p, d, q).
seasonal_order Tuple[int, int, int] (0, 0, 0) Seasonal order (P, D, Q).
period int 1 Seasonal period.
include_mean bool True Include deterministic mean/drift term.
method str 'CSS' Optimization method selector.
alias str 'ARIMA' Friendly model label.
standardize bool True Normalize series during fitting.

fit(self, y, X=None) -> Self

Estimate ARIMA parameters and store the fitted model and training state.

Parameters:

Parameter Type Default Description
y jnp.ndarray - Training target series.
X Optional[jnp.ndarray] None Optional exogenous regressors (same length as y).

Returns: Self (self, with model_ and y_train_ set.)

forecast(self, h, y, X=None, X_future=None, level=None, fitted=False) -> dict

Fit the fixed-order model on the given series and return h-step forecasts in one shot.

Parameters:

Parameter Type Default Description
h int - Forecast horizon.
y jnp.ndarray - Training series (used only for this call).
X Optional[jnp.ndarray] None Exogenous regressors; not used in current fast path.
X_future Optional[jnp.ndarray] None Future exogenous regressors (unused; included for BaseForecaster compliance).
level Optional[list] None Confidence levels (unused; included for BaseForecaster compliance).
fitted bool False Whether to return fitted values (unused; included for BaseForecaster compliance).

Returns: dict

Key Type Description
"mean" jnp.ndarray Point forecasts.

predict(self, h, X=None, level=None) -> dict

Produce h-step forecasts (and optional interval bands) from the fitted model.

Parameters:

Parameter Type Default Description
h int - Forecast horizon.
X Optional[jnp.ndarray] None Future exogenous regressors; shape (h, n_exog).
level int \| tuple[int, ...] \| None None Confidence level(s), e.g. 90 or (80, 95).

Returns: dict

Key Type Description
"mean" jnp.ndarray Mean forecast.
"lo-{level}" jnp.ndarray Lower bound of the confidence interval (if level is provided).
"hi-{level}" jnp.ndarray Upper bound of the confidence interval (if level is provided).

detect_period

auto_arima.detect_period

Detect the dominant seasonal period from a time series using ACF peaks.

Parameter Type Default Description
y np.ndarray - Univariate time series; will be cast to float64.
max_period Optional[int] None Maximum period to consider. If None, set to min(n // 4, 200). If < 2, returns 1.

Returns: int (Detected seasonal period (>= 1). 1 means no seasonality detected.)

arima_fit

auto_arima.arima_fit

Fit an ARIMA model to a univariate series and return coefficients, metrics, and diagnostics.

Parameter Type Default Description
x jnp.ndarray - Training series; converted to float64.
order Tuple[int, int, int] (0, 0, 0) Non-seasonal (p, d, q).
seasonal Optional[Dict[str, Any]] None "order" (P, D, Q) and "period" (m); default (0,0,0), period 1.
xreg Optional[jnp.ndarray] None Exogenous regressors; optional.
include_mean bool True Whether to include intercept/drift.
method str 'CSS-ML' "CSS", "ML", or "CSS-ML" for optimization path.
optim_control Optional[Dict[str, Any]] None Optional "steps" (maxiter) for optimizer.

Returns: Dict[str, Any] (Fitted model dict with coef, model, residuals, innovations, sigma2, loglik, aic, aicc, bic, arma, delta, nobs, use_drift, drift_coef, success.)

predict_arima

auto_arima.predict_arima

Produce n_ahead-step forecasts (and optionally standard errors) from a fitted ARIMA model.

Parameter Type Default Description
model Dict[str, Any] - Fitted model dict from arima_fit (coef, model, arma, sigma2, use_drift, drift_coef, innovations, etc.).
n_ahead int - Forecast horizon.
newxreg Optional[jnp.ndarray] None Future exogenous values; if None and n_exog > 0, a constant/intercept column is used.
se_fit bool True If True, return (pred, se); otherwise pred only.

Returns: Union[jnp.ndarray, Tuple[jnp.ndarray, jnp.ndarray]] (Forecasts array, or (forecasts, se) when se_fit is True. Single model: shapes (n_ahead,) and (n_ahead,); batch: (batch_size, n_ahead) and (batch_size, n_ahead).)

ndiffs

auto_arima.ndiffs

Determine the number of non-seasonal differences needed for stationarity.

Parameter Type Default Description
x jnp.ndarray - Univariate time series.
alpha float 0.05 Significance level for KPSS; default 0.05. Stationary if pval >= alpha.
max_d int 2 Maximum number of differences to consider; static, usually 2.

Returns: int (Number of non-seasonal differences (0, 1, or max_d).)

nsdiffs

auto_arima.nsdiffs

Determine number of seasonal differences (Optimized).

Parameter Type Default Description
x jnp.ndarray - Input time series
period int - Seasonal period (e.g., 12 for monthly data)
max_D int 1 Maximum seasonal differences allowed
alpha float 0.64 Threshold for seasonal strength (default 0.64 matches statsforecast)

Returns: int (Number of seasonal differences needed (0 to max_D))