Re: Multi variable least square data fitting



In article <44918c52$0$889$ba4acef3@xxxxxxxxxxxxxx>, Jean-Claude Arbaut
<jcarbaut@xxxxxxxxxxx> wrote:

Ruggero Pellegrin wrote:
Hi,
I'm looking for a least square formula in the form:

w=a*x+b*y+c*x^2+d*y^2
[x, y] known data
[a,b,c,d] unknown coefficients
w output variable

My calculus notions are rudimental(I stop at A*x=B)

It's almost A*X=B :-)

if X = [a;b;c;d], Y=[w1;w2;...;wn]
and A=[x1,y1,x1^2,y1^2; x2,y2,x2^2,y2^2; ...]

Then you have a linear system, with too many constraints.
You get the least squares solution by solving:

(A'*A)*X = A'*Y


therefore I'd really
apreciate a hint on using Matlab or Scilab /equivalent tool.
Won't some Saint here be so kind to help me sorting
things out

Thank you a lot in advance

Ruggero

A'A is often ill conditioned. QR decomposition or SVD decomposition
of A yields a 'better' solution in general, SVD can be used to get
confidence infromation, if that is not needed then QR is faster.

A = QR where Q'Q = I and R is right triangular.
Rx = Q'b which is solved by back substitution.

google QR or SVD for more info...
.



Relevant Pages

  • Re: Multi variable least square data fitting
    ... I'm looking for a least square formula in the form: ... My calculus notions are rudimental ... You get the least squares solution by solving: ... google QR or SVD for more info... ...
    (sci.math.num-analysis)
  • Multi variable least square data fitting
    ... I'm looking for a least square formula in the form: ... My calculus notions are rudimentaltherefore I'd really ... Won't some Saint here be so kind to help me sorting ...
    (sci.math.num-analysis)
  • Re: Multi variable least square data fitting
    ... Ruggero Pellegrin wrote: ... I'm looking for a least square formula in the form: ... known data unknown coefficients ... My calculus notions are rudimental ...
    (sci.math.num-analysis)