forum.alglib.net http://forum.alglib.net/ |
|
How to get covariance matrix (parameter errors) after LSFIT? http://forum.alglib.net/viewtopic.php?f=2&t=116 |
Page 1 of 1 |
Author: | Klayman [ Wed Nov 10, 2010 5:10 pm ] |
Post subject: | How to get covariance matrix (parameter errors) after LSFIT? |
In classical Levenberg-Marquardt implementations the final step is to get covariance matrix of the standard errors in the fitted parameters. As far as I understand, this is not implemented in ALGLIB's LSFIT. In "Numerical Receipts" the covariance matrix called "covar" and is part of the iteration procedure (see Chapter 15.5 for code and comments). But I can't figure out where's the "covar" is in your LSFitNonlinearIteration. Basically, I need it to get the standard errors of fitting parameters. Does anybody have ideas on this? |
Author: | Sergey.Bochkanov [ Wed Nov 10, 2010 7:36 pm ] |
Post subject: | Re: How to get covariance matrix (parameter errors) after LS |
As of version 3.1, ALGLIB does not support this feature. It is planned to be implemented in ALGLIB 3.2 (will be released at the end of the month) along with bound constraints on parameters being fitted. Meanwhile you can calculate it manually using quadratic model built by algorithm. LSFitState structure has OptState field (it may be hidden behind proxy object ptr or obj in version for your programming language). OptState has QuadraticModel field, which contains 2*transpose(J)*J (if you use Jacobian-based or Jacobian-free fitting). In Hessian-based mode this field contains Hessian. It is symmetric matrix with both upper and lower triangles. You may need to make some tweaks in ALGLIB code to make this field accessible (adding one or more "public" statements, depending on your programming language). |
Author: | Kansas [ Thu Jun 28, 2012 6:15 pm ] |
Post subject: | Re: How to get covariance matrix (parameter errors) after LS |
Has this been implemented? I am not able to find it in the latest version. Thanks |
Page 1 of 1 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |