Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Problem with mata: eigensystem


From   "Karl-Oskar Lindgren" <[email protected]>
To   [email protected]
Subject   st: Problem with mata: eigensystem
Date   Fri, 21 Sep 2007 13:49:56 +0200

Dear listusers,

In trying to write a function to obtain the square root of a symmetric (and positive definite) matrix in mata (similar to matsqrt in stata) I came across a problem that really confuses me.

When I try to obtain the eigenvectors and eigenvalues of a matrix of size
249 x 249 (or smaller) all is fine, but when I try to do the same thing for a matrix of size  250 x 250 (or larger) I get the following error message:

 order():  3200  conformability error
                       _symeigen_work():     -  function returned error
                       _symeigensystem():     -  function returned error
                       symeigensystem():     -  function returned error
                        <istmt>:     -  function returned error

Below I provide an example that illustrates the problem (and the problem do occur for non-identity matrices as well). I guess I miss something really obvious here, either in the design of mata or in the design of symeigensystem and I would really appreciate if someone could explain to me what that something is.

/*This is an example to illustrate the problem. Q1 works fine, but Q2 returns the error message described above*/

mata:
Q1=symeigensystem(I(249), Evec1=.,Eval1=.)
Q2=symeigensystem(I(250), Evec2=., Eval2=.)
end

Best Regards
Karl Lindgren
Department of Government, Uppsala University
* * For searches and help try: * http://www.stata.com/support/faqs/res/findit.html * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index