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.

AutoTheta

chronax.models.AutoTheta · inherits BaseForecaster

AutoTheta model. Automatically selects the best Theta model variant (STM, OTM, DSTM, DOTM) using MSE.

__init__(self, season_length: int = 1, decomposition_type: str = 'multiplicative', model: str | None = None, alias: str = 'AutoTheta', prediction_intervals: ConformalIntervals | None = None, conformal_params: ConformalIntervals | None = None, n_samples: int = 200)

(No prose summary provided in docstring.)

Parameter Type Default Description
season_length int 1 Number of observations per unit of time.
decomposition_type str "multiplicative" Seasonal decomposition type: 'multiplicative' or 'additive'.
model str \| None None Controlling theta model variant. None searches the best model.
alias str "AutoTheta" Custom name of the model.
prediction_intervals ConformalIntervals \| None None Configuration for conformal prediction intervals.
conformal_params ConformalIntervals \| None None Parameters for conformal prediction intervals.
n_samples int 200 Number of Monte Carlo samples for prediction intervals.

fit(self, y: jnp.ndarray, X: jnp.ndarray | None = None) -> Self

Fit the AutoTheta model.

Parameter Type Default Description
y jnp.ndarray - Clean time series of shape (t,).
X jnp.ndarray \| None None Optional exogenous of shape (t, n_x).

Returns: Self (the fitted forecaster; sets self.model_). Raises: Exception

predict(self, h: int, X: jnp.ndarray | None = None, level: list | None = None) -> dict

Predict with fitted AutoTheta.

Parameter Type Default Description
h int - Forecast horizon.
X jnp.ndarray \| None None Optional exogenous of shape (h, n_x).
level list \| None None Confidence levels (0-100) for prediction intervals.

Returns: dict (Keys: 'mean' and optionally 'lo-{lv}', 'hi-{lv}').

predict_in_sample(self, level: list | None = None) -> dict

Access fitted AutoTheta in-sample predictions.

Parameter Type Default Description
level list \| None None Confidence levels (0-100) for prediction intervals.

Returns: dict (Keys: 'fitted' and optionally 'lo-{lv}', 'hi-{lv}').

forecast(self, y: jnp.ndarray, h: int, X: jnp.ndarray | None = None, X_future: jnp.ndarray | None = None, level: list | None = None, fitted: bool = False) -> dict

Memory-efficient AutoTheta predictions. Fits and forecasts without storing model state.

Parameter Type Default Description
y jnp.ndarray - Clean time series of shape (t,).
h int - Forecast horizon.
X jnp.ndarray \| None None Optional exogenous of shape (t, n_x).
X_future jnp.ndarray \| None None Optional future exogenous of shape (h, n_x).
level list \| None None Confidence levels (0-100) for prediction intervals.
fitted bool False Whether to return in-sample predictions.

Returns: dict (Keys: 'mean', and optionally 'fitted', 'lo-{lv}', 'hi-{lv}').

forward(self, y: jnp.ndarray, h: int, X: jnp.ndarray | None = None, X_future: jnp.ndarray | None = None, level: list | None = None, fitted: bool = False) -> dict

Apply fitted AutoTheta model to a new time series. Uses the model type and parameters from the original fit.

Parameter Type Default Description
y jnp.ndarray - Clean time series of shape (n,).
h int - Forecast horizon.
X jnp.ndarray \| None None Optional exogenous of shape (n, n_x).
X_future jnp.ndarray \| None None Optional future exogenous of shape (h, n_x).
level list \| None None Confidence levels (0-100) for prediction intervals.
fitted bool False Whether to return in-sample predictions.

Returns: dict (Keys: 'mean', and optionally 'fitted', 'lo-{lv}', 'hi-{lv}'). Raises: Exception

Theta

chronax.models.Theta · inherits BaseForecaster

Standard Theta Method (STM). A simplified version of AutoTheta that always uses the Standard Theta Model.

__init__(self, season_length: int = 1, decomposition_type: str = 'multiplicative', alias: str = 'Theta', prediction_intervals: ConformalIntervals | None = None, n_samples: int = 200)

(No prose summary provided in docstring.)

Parameter Type Default Description
season_length int 1 Number of observations per unit of time.
decomposition_type str "multiplicative" Seasonal decomposition type: 'multiplicative' or 'additive'.
alias str "Theta" Custom name of the model.
prediction_intervals ConformalIntervals \| None None Configuration for conformal prediction intervals.
n_samples int 200 Number of Monte Carlo samples for prediction intervals.