From bug-octave-request at bevo dot che dot wisc dot edu Wed Oct 8 13:47:01 1997 Subject: Error from polyfit From: Seung Lee To: bug-octave at bevo dot che dot wisc dot edu Date: Wed, 08 Oct 1997 14:44:36 -0400 Good morning, Sir! I found the error on pf from polyfit in version 2.0.9. In octave, a polynomial is represented by its descending order coefficient. Therefore, the pf statement in polyfit.m should be pf = X * flipud(p);, not pf = X * p; because X is ascending order. Or if octave represents the ascending order coefficients, then change p = flipud((X' * X) \ (X' * y)); to p = ((X' * X)\(X' * y)); and don't change pf = X * p; statement. I used the first method and got the right answer. If I'm wrong, please let me know. Thank you very much and have a nice day. Sincerely yours, Seung