help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem of polyfit


From: Paul Kienzle
Subject: Re: Problem of polyfit
Date: Fri, 7 Oct 2005 09:11:26 -0400


On Oct 7, 2005, at 12:05 AM, Dmitri A. Sergatskov wrote:

Tetsuro KURITA wrote:

Following is an example which show that polyfit.m does not works well.

You would get a very good fit if you normalize your data

x = (x-mean(x))/(max(x)-min(x))
and the same with y.

I've modified wpolyfit so that

        [p,s,mu] = wpolyfit(x,y,dy,n)

first centers and scales x by mu = [mean(x),std(x)]. I've used std(x) rather than max(x)-min(x) for compatibility.

The fit is a whole lot nicer when you do this :-)

- Paul



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]