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.

TSB

chronax.tsb.TSB · inherits BaseForecaster

Implements the Time Series Buffer (TSB) algorithm, applying exponential smoothing to both demand probability and demand magnitude, suitable for intermittent time series.

Attributes: * uses_exog: bool = False * alias: str * conformal_params: ConformalIntervals | None * model_: dict | None (Stores fitted parameters, including demand_level, prob_level, and sigma.)

__init__(self, alpha_d: float, alpha_p: float, alias: str = 'TSB', conformal_params: ConformalIntervals | None = None)

Parameter Type Default Description
alpha_d float - (undocumented)
alpha_p float - (undocumented)
alias str "TSB" (undocumented)
conformal_params ConformalIntervals \| None None (undocumented)

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

Parameter Type Default Description
y jnp.ndarray - (undocumented)
X jnp.ndarray \| None None (undocumented)

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

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

Parameter Type Default Description
h int - (undocumented)
X jnp.ndarray \| None None (undocumented)
level list[int] \| None None (undocumented)

Returns: dict

Key Type Description
mean jnp.ndarray The point forecasts of shape (h,).
lo-L jnp.ndarray Lower bound for confidence level L (if level is provided).
hi-L jnp.ndarray Upper bound for confidence level L (if level is provided).

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

Parameter Type Default Description
level list[int] \| None None (undocumented)

Returns: dict

Key Type Description
fitted jnp.ndarray The in-sample fitted values.
fitted-lo-L jnp.ndarray Lower bound for fitted confidence level L (if level is provided).
fitted-hi-L jnp.ndarray Upper bound for fitted confidence level L (if level is provided).

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

Parameter Type Default Description
y jnp.ndarray - (undocumented)
h int - (undocumented)
X jnp.ndarray \| None None (undocumented)
X_future jnp.ndarray \| None None (undocumented)
level list[int] \| None None (undocumented)
fitted bool False (undocumented)

Returns: dict

Key Type Description
mean jnp.ndarray The point forecasts of shape (h,).
fitted jnp.ndarray The in-sample fitted values (if fitted=True).
lo-L jnp.ndarray Lower bound for confidence level L (if level is provided).
hi-L jnp.ndarray Upper bound for confidence level L (if level is provided).
fitted-lo-L jnp.ndarray Lower bound for fitted confidence level L (if level and fitted=True are provided).
fitted-hi-L jnp.ndarray Upper bound for fitted confidence level L (if level and fitted=True are provided).

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

(This method is an alias for forecast.)

Parameter Type Default Description
y jnp.ndarray - (undocumented)
h int - (undocumented)
X jnp.ndarray \| None None (undocumented)
X_future jnp.ndarray \| None None (undocumented)
level list[int] \| None None (undocumented)
fitted bool False (undocumented)

Returns: The result of self.forecast.