Bier Posted May 3, 2010 Share Posted May 3, 2010 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. Link to comment Share on other sites More sharing options...
Solartide Posted May 4, 2010 Share Posted May 4, 2010 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? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now