octave-maintainers
[Top][All Lists]
Advanced

[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: Sat, 2 Feb 2008 14:57:31 -0600

On Feb 2, 2008 2:28 PM, Ben Abbott <address@hidden> wrote:

> Regarding "scale x unconditionally", do you refer to the scaling used
> by wpolyfit;
>
>         (x - mean (x)) / std (x)
>
> or to Thomas' suggestion to just scale the magnitude?
>
>         x / max (x)
>

I mean Thomas' suggestion. That is to be precise x / max(abs(x))

> If you refer to Thomas' suggestion, the maximum value will result in
> as much trouble/benefit as the minimum value.

No. If your data are well centered, the min(abs(x)) ~  eps, so scaling to
min does not work. In case of data having a large offset,
min(abs(x)) ~ max(abs(x)) ~ mean(abs(x)), so scaling to any of these
numbers would be equally helpful. But scaling to max(abs(x)) would guarantee
to make all the data in (-1,1) range in all cases and that should help
with numerical precision.

>
> Perhaps a better solution would be (a) the geometric mean of the
> magnitudes, (b) the median of the magnitudes, (c) the mean of the
> magnitudes, (d) consider several normalization options and select the
> most numerically stable one.

See above. I doubt that the fit will be that sensitive to the scaling
parameter, i.e. to say instead of max(abs(x)) you can use 0.5*max(abs(x))
and you probably will not see much of a difference.
Using some more sofisticated approximation is to make some assumption of
the data distribution and we do not want to do that in a generic function.

>
> In any event, what should be done about s.R and s.X? Are they to
> represent the scaled dependent variable?
>

I do not know.

> Ben
>

Regards,

Dmitri.
--


reply via email to

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