Question

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

Était-ce utile?

La solution

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?)

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top