Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Error computing eigenvalues using mata


From   Zachary Neal <[email protected]>
To   [email protected]
Subject   Re: st: Error computing eigenvalues using mata
Date   Mon, 13 Apr 2009 12:22:45 -0700 (PDT)

Glenn,

Yes, I'm running the same version of <eigenvalues()> code.

I've been able to replicate the error for this matrix, but not for any others.  The error actually arose during a monte carlo simulation.  So far I've run several million random matrices and this is the only one to have produced an error.

Zachary

-----------------
Zachary Neal, ABD
Managing Editor, City & Community
University of Illinois at Chicago
[email protected]


--- On Mon, 4/13/09, Glenn Goldsmith <[email protected]> wrote:

> From: Glenn Goldsmith <[email protected]>
> Subject: Re: st: Error computing eigenvalues using mata
> To: [email protected]
> Date: Monday, April 13, 2009, 1:11 PM
> <>
> 
> I'm afraid I have no idea why this might be happening (and
> have been unable
> to replicate the error myself). But you might be able to
> work around it by
> using -symeigenvalues()- instead.
> 
> HTH,
> 
> Glenn.
> 
> P.S. 
> 
> Below is the code I have for -_eigenvalues()- (from -view
> _eigenvalues.mata,
> adopath asis-). Tough to see where the error could be
> coming from here. Is
> your version the same?
> 
> *! version 1.0.1  04jan2005
> version 9.0
> 
> mata:
> 
> complex vector _eigenvalues(numeric matrix A, |cond, real
> scalar nobalance)
> {
>         complex vector evals
> 
>         if (args()==1) cond = .
> 
>         _eigen_work(0, A, ., 
> evals, cond, nobalance)
>         
>         return(evals)
> }
> 
> end
> 
> Zachary Neal <[email protected]>
> wrote:
> 
> I am trying to compute the eigenvalues for a 59 x 59
> square, symmetric,
> binary matrix.  The command <mata
> eigenvalues(x)> returns the following
> error:
> 
> _eigenvalues():  3252  evals[59,1] found where
> complex required
> eigenvalues():     -  function
> returned error
> <istmt>:     -  function
> returned error
> 
> Any assistance would be appreciated.  I've pasted the
> problem matrix below,
> but it is a bit hard to read.
> 
> Thank you
> Zachary
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
> 


      

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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