incline.StateSpace¶
- class incline.StateSpace(seasonal_period=None)[source]¶
Local linear trend, optionally with seasonal and damping.
The slope is a state, so its smoothed variance is a diagonal entry of the smoother covariance and needs no extra machinery. This replaces a hand-rolled Kalman filter and a BFGS call whose inverse Hessian was discarded; statsmodels supplies both the state covariance and the hyperparameter covariance.
- Variables:
seasonal_period (int | None) – Length of a seasonal cycle, or None.
- Parameters:
seasonal_period (int | None)
Note
The intervals are conditional on the fitted variances. Those variances were estimated from the same data, and that estimation error is not propagated, so the intervals are somewhat narrow – most visibly on short series.
Ad hoc scaling by a variance parameter’s relative standard error is not used because that ratio is undefined when a fitted variance reaches its boundary at zero.
There is likewise no damped-trend option. The previous implementation accepted one and forwarded it to statsmodels, which has no such parameter and ignored it, so the setting did nothing.
Sampling must be regular. The state transition advances once per observation, so it cannot represent unequal elapsed times.
Methods
__init__([seasonal_period])analytic_operators(axis, derivative_order)State the smoothing and derivative operators directly, if known.
bootstrap_uncertainty(estimate, axis, y, ...)Bootstrap a nonlinear smoother, preserving short-range dependence.
evaluate(axis, y, derivative_order)Smoothed level and slope.
evaluate_with_noise(axis, y, ...)Evaluate, allowing an adaptive smoother to use a fitted covariance.
fit(axis, y[, derivative_order, ...])Estimate the trend and, optionally, its uncertainty.
native_posterior(axis, y, derivative_order, ...)Standard error of the smoothed slope state.
operators(axis, derivative_order)The smoothing and derivative operators for this configuration.
params()Report the model configuration.
scale_of(axis)Return None because the model has no direct smoothing scale.
with_scale(scale, axis)Reject a scale because smoothing follows from fitted variances.
Attributes
is_linearWhether the derivative is a fixed linear map of the data.
linearuses_noise_for_fitWhether a supplied noise model can change the point estimate.
- native_posterior(axis, y, derivative_order, confidence_level)[source]¶
Standard error of the smoothed slope state.