Statalist


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

Re: st: Error computing eigenvalues using mata


From   Zachary Neal <stata_at_uic@yahoo.com>
To   statalist@hsphsun2.harvard.edu
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
zneal2@uic.edu


--- On Mon, 4/13/09, Glenn Goldsmith <glenn.goldsmith@gmail.com> wrote:

> From: Glenn Goldsmith <glenn.goldsmith@gmail.com>
> Subject: Re: st: Error computing eigenvalues using mata
> To: statalist@hsphsun2.harvard.edu
> 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 <stata_at_uic@yahoo.com>
> 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index