0
$\begingroup$

I am tryring to compute the largest eigenvalue using eigs from scipy.sparse.linalg for the matrix L (204 x 204) with the same values given below. 1 on diagonal and -0.004901961 on off diagonal.

$ L = \begin{matrix} 1 & -0.004901961 & -0.004901961 ...\\ -0.004901961 & 1 & -0.004901961 ...\\ -0.004901961 & -0.004901961 & 1 ...\\ .\\ .. \end{matrix} $

The error is given below:

File "C:\Users\xcxx\Miniconda3\envs\tf_handsOn_ML\lib\site-packages\scipy\sparse\linalg\eigen\arpack\arpack.py", line 1346, in eigs params.iterate() File "C:\Users\xcxx\Miniconda3\envs\tf_handsOn_ML\lib\site-packages\scipy\sparse\linalg\eigen\arpack\arpack.py", line 758, in iterate raise ArpackError(self.info, infodict=self.iterate_infodict) scipy.sparse.linalg.eigen.arpack.arpack.ArpackError: ARPACK error 3: No shifts could be applied during a cycle of the Implicitly restarted Arnoldi iteration. One possibility is to increase the size of NCV relative to NEV.

I have tried to overcome this error by

from scipy.linalg import eigvals

lambda_max = np.real((max(eigvals(L))))

I got lambda_max = 1.0049019607843162

but is that the correct solution?

Danke,

$\endgroup$
1
  • 1
    $\begingroup$ At stats.stackexchange.com/a/72798/919 I give all the eigenvalues and eigenvectors of such matrices as part of a solution to a different (but closely related) question. $\endgroup$
    – whuber
    Jun 23 at 16:37

0

Browse other questions tagged or ask your own question.