incline.sgolay_trend

incline.sgolay_trend(df, column_value='value', time_column=None, function_order=3, window_length=15, **kwargs)[source]

Estimate the trend with a Savitzky-Golay filter.

A fixed linear filter, so standard errors are exact.

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

  • column_value (str) – Column holding the values.

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

  • function_order (int) – Degree of the local polynomial.

  • window_length (int) – Filter window in observations; forced odd.

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

Returns:

The input frame plus the estimate columns.

Return type:

pd.DataFrame