incline.smoothing_spline_trend

incline.smoothing_spline_trend(df, value_column='value', time_column=None, penalty=None, **kwargs)[source]

Estimate the trend with a cubic smoothing spline.

With penalty fixed this is a linear smoother and standard errors are exact. Leaving penalty as None selects it by generalized cross-validation under independent noise or covariance-aware generalized maximum likelihood under a non-constant covariance. Adaptive fits route uncertainty to the bootstrap.

Parameters:
  • df (pd.DataFrame) – Time series data.

  • value_column (str) – Column holding the values.

  • time_column (str | None) – Numeric time column.

  • penalty (float | None) – Fixed roughness penalty for the independent-error spline. This is not the covariance-dependent generalized_penalty reported by an adaptive GML fit.

  • **kwargs (Any) – Uncertainty options; see estimate().

Returns:

The input frame plus the estimate columns.

Return type:

pd.DataFrame