[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Polyfit with scaling
From: |
Dmitri A. Sergatskov |
Subject: |
Re: Polyfit with scaling |
Date: |
Wed, 30 Jan 2008 17:48:55 -0600 |
On Jan 30, 2008 11:19 AM, Thomas Weber <address@hidden> wrote:
> I'd like to propose the attached patch for polyfit.m
> It introduces an optional fourth bool parameter 'scale'. If not set, or
> if it's set to 'false', nothing changes.
>
> If it's set to true, the x values are scaled by their maximal absolute
> value prior to calculating the polynomial coefficients. This has a
> stabilizing effect on the calculation.
>
I do not understand why this change had not been made a long time ago
-- we had few reports of faulty fits. I think the better
scaling is:
x = (x-mean(x))/std(x).
wpolyfit from octave-forge does the scaling like that.
> Thomas
>
Dmitri.
--