[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Polyfit with scaling
From: |
Thomas Weber |
Subject: |
Polyfit with scaling |
Date: |
Wed, 30 Jan 2008 18:19:15 +0100 |
User-agent: |
Mutt/1.5.17+20080114 (2008-01-14) |
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.
A test case showing the difference is included.
There are three FIXME's in the code. Two are about the usage of repmat()
and reshape, respectively (speed reasons). The third one deals with the
second parameter from chol(), which is undocumented. So I don't know
what the code should do in case this return value is non-zero (the
current code ignores this).
Thomas
scale_polyfit.diff
Description: Text Data
- Polyfit with scaling,
Thomas Weber <=