Re: Question about matrix inversion, also polynomial coefficients
- From: Axel Vogt <&noreply@xxxxxxxxxxx>
- Date: Fri, 13 Jun 2008 21:34:10 +0200
Paul Ciszek wrote:
I am doing a least-squares fit to a cubic equation, and it involves
inverting a matrix that looks like this:
sum(x^0) sum(x^1) sum(x^2) sum(x^3)
sum(x^1) sum(x^2) sum(x^3) sum(x^4)
sum(x^2) sum(x^3) sum(x^4) sum(x^5)
sum(x^3) sum(x^4) sum(x^5) sum(x^6)
Now,the only definition "Ill conditoned" or "well conditioned" that
I have been able to find that I could implement easily in Excel was:
Condition number = RMS(elements of matrix)*RMS(elements of inverse)
Is this a valid measure of how invertible a matrix is?
Anyway, I found that the condition number could shoot up into the
millions for quite boring-looking collections of X values. I
finally figured out that if I subtract off the average X value,
then rescale what's left so that it never exceeds the range -1 to 1,
the condition number stays reasonable.
My question is, am I actually accomplishing anything in terms of keeping
the calculating error down by re-scaling my data like this?
Second, the result is a polynomial in the "rescaled" co-ordinate
system, i.e., I have:
y= a0 + a1*x' + a2*x'^2 + a3x'^3 where x' = (x-f)*s
when what I would like is:
y = b0 + b1*x + b2*x2 +b3*x^3
Is there a straightforward transformation to turn the set of a's into
a set of b's? Sure, you can multiply oout the polynomial and collect
terms, but is there something I can generalize? Maybe a matrix method?
Not quite sure what you want to fit and my answer may not be
quite what to hear. But if you do it in Excel you just make
columns of the values for x, x^2 and x^3 and use the function
'RGP' for (multi)linear regression (not sure hwo that would
be named in a non-German version).
This function returns a 'vector' of coefficients (so you will
need curly brackets for input) and is pretty stable and fast.
It does not use matrix inversion.
.
- Follow-Ups:
- Re: Question about matrix inversion, also polynomial coefficients
- From: Paul Ciszek
- Re: Question about matrix inversion, also polynomial coefficients
- References:
- Question about matrix inversion, also polynomial coefficients
- From: Paul Ciszek
- Question about matrix inversion, also polynomial coefficients
- Prev by Date: Maximum number of points closest to a point?
- Next by Date: Re: Von Neumann quote
- Previous by thread: Question about matrix inversion, also polynomial coefficients
- Next by thread: Re: Question about matrix inversion, also polynomial coefficients
- Index(es):
Relevant Pages
|
Loading