incline.kalman_trend¶
- incline.kalman_trend(df, value_column='value', time_column=None, seasonal_period=None, **kwargs)[source]¶
Estimate the trend with a local linear trend state-space model.
The slope is a state, so its standard error is a diagonal entry of the smoother covariance. Sampling must be regular because the state transition advances once per observation.
- Parameters:
df (pd.DataFrame) – Time series data.
value_column (str) – Column holding the values.
time_column (str | None) – Numeric time column.
seasonal_period (int | None) – Length of a seasonal cycle, if any.
**kwargs (Any) – Uncertainty options; see
estimate().
- Returns:
The input frame plus the estimate columns.
- Return type:
pd.DataFrame