Polynomial Regression Channels, Least-Squares Bands, and Overfitting Limits
Summary
This educational indicator fits a polynomial to a rolling window of price data using least squares. It forms the coefficient equations from sums of powers of the time index and price, then solves the system with LU decomposition. The fitted curve supplies a polynomial least-squares moving average, while standard deviation around the curve defines upper and lower channel levels. An optional two-pole Super Smoother can reduce input noise before fitting; offsets can shift the curve points, and segmented lines approximate the plotted curves.
The author distinguishes this regression-based estimate from ordinary moving averages and describes the bands as similar in appearance to Bollinger Bands but derived differently. The notes caution that higher polynomial orders and longer samples can run into floating-point precision limits, while complex fits can overfit noisy data. The channel is an analytical visualization, not a tested strategy: the document reports no trading results, and its output depends on chosen order, sampling period, smoothing, and offset.
Key ideas
- Polynomial regression models price against a time index and estimates coefficients by least squares.
- The script builds power-sum equations and solves them using LU decomposition.
- A fitted polynomial provides the central curve, with standard deviation used for upper and lower bands.
- Optional smoothing may stabilize the fit, though the notes warn that polynomial regression can be sensitive to noise.
- Higher orders and longer samples face precision constraints and increased overfitting risk.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.