t_maggot
Member level 3
I want to understand the creation of the least square line of type f(x)=a+bx with input 5 points. My purpose is to optimize the calculations to fit my DSP best. I have start with this this simple example:
https://en.wikipedia.org/wiki/Linear_least_squares#Motivational_example
and I try to calculate the 2 partial derivatives of S(a,b) with respect to a and b, from witch (when I set them to 0) system of 2 functions of 2 variables I can calculate a and b.
Setting b as costant, I find S'b(a) = 8a+20b-56 witch I think is right, but I can't calculate the S'a(b) to have a system witch gives me a=3.5 and b=1.4. I always find the S'a(b)=20a+20b-154 witch dont fit the results. I am stuck on this, and I would appreciate any help...
https://en.wikipedia.org/wiki/Linear_least_squares#Motivational_example
and I try to calculate the 2 partial derivatives of S(a,b) with respect to a and b, from witch (when I set them to 0) system of 2 functions of 2 variables I can calculate a and b.
Setting b as costant, I find S'b(a) = 8a+20b-56 witch I think is right, but I can't calculate the S'a(b) to have a system witch gives me a=3.5 and b=1.4. I always find the S'a(b)=20a+20b-154 witch dont fit the results. I am stuck on this, and I would appreciate any help...