for start, i am newbie in C++.
i am writing a program for my Master thesis which part of it suppose to solve regression in a recursive way.
I would like to solve:
Ax = y
In my case computation speed is not neglectable, that is way i would like to know if Boost::BLAS using
x = (A^T A)^{-1}A^Ty
will require less computation time then Lapackpp (I am using gentoo).
P.S. I was able to find at Lapackpp project site Class documentations but not examples. Could someone provides me some examples in case Lapack is faster then Boost::BLAS
Thanks
From a numerical analysis standpoint, you never want to write code that
A^T A
) for a regressionBoth of these are more work and less accurate (and likely less stable) than the alternatives that solve the same problem directly.
Whenever you see some math showing a matrix inversion, that should be read to mean "solve a system of linear equations", or factor the matrix and use the factorization to solve the system. Both BLAS and Lapack have routines to do this.
Similarly, for the regression, call a library function that computes a regression, or read how to do it yourself. The normal equations method is the textbook wrong way to do it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With