_SARIMAXBaseAdapter

class _SARIMAXBaseAdapter[source]

Bases: etna.models.base.BaseAdapter

Base class for adapters based on statsmodels.tsa.statespace.sarimax.SARIMAX.

Inherited-members

Methods

fit(df, regressors)

Fits a SARIMAX model.

forecast(df, prediction_interval, quantiles)

Compute autoregressive predictions from a SARIMAX model.

forecast_components(df)

Estimate forecast components.

get_model()

Get statsmodels.tsa.statespace.sarimax.SARIMAXResultsWrapper that is used inside etna class.

predict(df, prediction_interval, quantiles)

Compute predictions from a SARIMAX model and use true in-sample data as lags if possible.

predict_components(df)

Estimate prediction components.

fit(df: pandas.core.frame.DataFrame, regressors: List[str]) etna.models.sarimax._SARIMAXBaseAdapter[source]

Fits a SARIMAX model.

Parameters
  • df (pandas.core.frame.DataFrame) – Features dataframe

  • regressors (List[str]) – List of the columns with regressors

Returns

Fitted model

Return type

etna.models.sarimax._SARIMAXBaseAdapter

forecast(df: pandas.core.frame.DataFrame, prediction_interval: bool, quantiles: Sequence[float]) pandas.core.frame.DataFrame[source]

Compute autoregressive predictions from a SARIMAX model.

Parameters
  • df (pandas.core.frame.DataFrame) – Features dataframe

  • prediction_interval (bool) – If True returns prediction interval for forecast

  • quantiles (Sequence[float]) – Levels of prediction distribution

Returns

DataFrame with predictions

Return type

pandas.core.frame.DataFrame

forecast_components(df: pandas.core.frame.DataFrame) pandas.core.frame.DataFrame[source]

Estimate forecast components.

Parameters

df (pandas.core.frame.DataFrame) – features dataframe

Returns

dataframe with forecast components

Return type

pandas.core.frame.DataFrame

get_model() statsmodels.tsa.statespace.sarimax.SARIMAXResultsWrapper[source]

Get statsmodels.tsa.statespace.sarimax.SARIMAXResultsWrapper that is used inside etna class.

Returns

Internal model

Return type

statsmodels.tsa.statespace.sarimax.SARIMAXResultsWrapper

predict(df: pandas.core.frame.DataFrame, prediction_interval: bool, quantiles: Sequence[float]) pandas.core.frame.DataFrame[source]

Compute predictions from a SARIMAX model and use true in-sample data as lags if possible.

Parameters
  • df (pandas.core.frame.DataFrame) – Features dataframe

  • prediction_interval (bool) – If True returns prediction interval for forecast

  • quantiles (Sequence[float]) – Levels of prediction distribution

Returns

DataFrame with predictions

Return type

pandas.core.frame.DataFrame

predict_components(df: pandas.core.frame.DataFrame) pandas.core.frame.DataFrame[source]

Estimate prediction components.

Parameters

df (pandas.core.frame.DataFrame) – features dataframe

Returns

dataframe with prediction components

Return type

pandas.core.frame.DataFrame