kats.models.theta module¶
Implementation of theta model which is basically a simple exponential smoothing model with drift.
For more details refer to: https://robjhyndman.com/papers/Theta.pdf
- class kats.models.theta.ThetaModel(data: Optional[kats.consts.TimeSeriesData] = None, params: Optional[kats.models.theta.ThetaParams] = None)[source]¶
Bases:
Generic
[kats.models.model.ParamsType
]Model class for Theta
This class provides fit, predict, and plot methods for STLF model
- data¶
the input time series data as
kats.consts.TimeSeriesData
- params¶
the parameter class defined with ThetaParams
- deseasonalize() → kats.consts.TimeSeriesData[source]¶
Returns the deseasonalized input time series
- static get_parameter_search_space() → List[Dict[str, Any]][source]¶
Provide a parameter space for Theta model
Move the implementation of get_parameter_search_space() out of arima to avoid the massive dependencies of arima and huge build size.
- predict(steps: int, include_history=False, **kwargs) → pandas.core.frame.DataFrame[source]¶
Predict with the fitted Theta model
- Parameters
steps – Number of time steps to forecast
include_history – If True, fitted values for training data are also returned
freq – optional, frequency of timeseries data. Defaults to automatically inferring from time index.
alpha – optional, significance level of confidence interval. Defaults to 0.05
- Returns
time, fcst, fcst_lower, and fcst_upper
- Return type
DataFrame of predicted results with following columns