Sr=i=1∑nei2=i=1∑n(yi,measured−yi,model)2
Linear regression
The least squares approach that involves determining the best approximating line.
Let the best least squares line to a collection of data points (xi,yi)i=1n be:
y=a1x+a0
a1 and a0 can be found by solving:
a1i=1∑nxi2+a0i=1∑nxi=i=1∑nxiyi
a1i=1∑nxi+a0i=1∑n1=i=1∑nyi
Polynomial regression
The least squares approach that involves determining the best approximating polynomial.
Let the best least squares polynomial to a collection of data points (xi,yi)i=1m be:
Pn(x)=i=1∑naixi
Here n<m−1.
The constants ai can be found by subtituting the known data points in the polynomial.
k=0∑n{aki=1∑mxij+k}=i=1∑myixijwherej=0,1,…,n