0

In order to do a quadratic regression on a rather large data set I would like to solve the following equation using svd(singular value decomposition): B(nx1)=A(nx3)*X(3x1) I am thinking to use matlab for that, any tips? the goal is to compute matrix X

C graphics
  • 7,308
  • 19
  • 83
  • 134
  • Hard to say, since your question is too vague. First take a shot at it by yourself and see if you get stuck. – Eitan T Mar 12 '13 at 23:38
  • Interesting to see a reference to singular value decomposition for a non-linear, higher degree polynomial. – Gokul Alex May 17 '21 at 08:09

1 Answers1

0

It seems that what you call quadratic regression is actually the minimal square error regression. In this case the computation is very easy:

1) Multiply both left sides by A'(3xn) arriving to

A'(3xn)B(nx1) = A'(3xn)A(nx3) X(3x1)

2) Now multiply both left sides by the inverse of A'(nx1) A(nx3) arriving to

inv(A'(3xn)A(nx3))A'(3xn)B(nx1) = X(3x1)

3) Now use svd to evaluate the inverse above, see Most efficient matrix inversion in MATLAB

See also Minimizing error of a formula in MATLAB (Least squares?)

Community
  • 1
  • 1
DanielTheRocketMan
  • 3,199
  • 5
  • 36
  • 65