A series of functions for polynomial regression. This project is still in progress.
Least squares regression produces the line of best fit which minimizes the square of the vertical offsets of each datapoint (their variance). The least squares equation is as follows:
The equations for variance and covariance can be substituted into this equation to produce: m = covariance/variance and c = y_mean - m * x_mean This is the equation that was implemented in main.py.
More information about the equation can be found in this MIT lecture. The derivation of the formula through minimizing the variance equation can be found here.
Here is an example of linear least squares using the data set found in main.py:
- Variance
- Covariance
- Least Squares Regression
- Polynomial matrix regression