pyhctsa.operations.stationarity.fit_polynomial

pyhctsa.operations.stationarity.fit_polynomial(y, k=1)

Goodness of a polynomial fit to a time series

Usually kind of a stupid thing to do with a time series, but it’s sometimes somehow informative for time series with large trends.

Parameters:
y : ArrayLike

the time series to analyze.

k : int, optional

the order of the polynomial to fit to y.

Returns:

RMS error of the fit

Return type:

float