Polynomial Fitting¶
- src.boatwright.Indicators.polynomial_fitting.derivative_polynomial_fit(series, period=10, poly_order=3, weight=1, x=0)¶
Calculate the polynomial fit for d/dx f(x) = B + 2Cx … nDx^(n-1) of a series
- Parameters:
s – input series
period (int) – length of rolling window
poly_order (int) – highest order polynomial x^n in the fit
weight (float) – weight to bias the most recent data by, with w=1 equally weighting all data
x (int) – value input to solved fit, f(x=0) will calculate the polynomial at the current index, positive values like f(x=5), will extrapolate a value 5 bars ahead
series (Series)
- src.boatwright.Indicators.polynomial_fitting.polynomial_fit(series, period=10, poly_order=3, weight=1, x=0)¶
Calculate the polynomial fit f(x) = A + Bx + Cx^2 … Dx^n for the rolling window of a series.
- Parameters:
s – input series
period (int) – length of rolling window
poly_order (int) – highest order polynomial x^n in the fit
weight (float) – weight to bias the most recent data by, with w=1 equally weighting all data
x (int) – value input to solved fit, f(x=0) will calculate the polynomial at the current index, positive values like f(x=5), will extrapolate a value 5 bars ahead
series (Series)