May 3, 201016 yr I've made this codex=[1.02,.95,.87,.77,.67,.56,.44,.3,.16,.01]'; y=[.38,.32,.27,.22,.18,.15,.13,.12,.13,.15]'; plot(x,y) x2=x.^2; A=[y.^2,x.*y,x,y,ones(10,1)]; z=A\x2 hold on xp=0:.001:1; yp=0:.001:1; plot(z(1)*yp.^2+z(2)*xp.*yp+z(3)*xp+z(4)*yp+z(5),xp.^2)It's supposed to solve the equation a*y^2 + b*x*y + c*x + d*y + e = x^2 using least squares and then plot the solution together with the actual measured values (x and y). Why is the least squares solution a bit of? I suppose I've made some error somewhere.
May 4, 201016 yr Sweet code bro. Too bad I'm not interested in buying a 400 dollar license to help you out, and I don't think anyone else is willing to either. Can you use an open source alternative like Gretl? And what is the estimated value of your residuals?
Create an account or sign in to comment