Eig(A'*A) - out of memory. Any shortcuts?

  • Thread starter mikeph
  • Start date
  • Tags
    Memory
In summary, the conversation suggests using a MatLab sparse matrix for A and then setting a variable to A'*A and using the eig function. Other potential solutions include using the "-nojvm" command line option and increasing swap size or using a 64-bit OS and MatLab.
  • #1
mikeph
1,235
18
A is pretty large (and sparse). I'd really like to be able to calculate this, using less RAM.
 
Physics news on Phys.org
  • #2
I wouldn't call myself an expert on eigenvalue algorithms, but I had some ideas.

First, you've been using a MatLab http://www.mathworks.com/help/techdoc/ref/sparse.html" matrix for A, right?

Second, you could try setting a variable to A'*A, then clearing A, and then having a call to eig on that variable.

If you're on unix and you don't need the development environment, an option is to run a MatLab script with the "-nojvm" command line option.

Other than that, increase the swap size. If that's not enough, get the following if you aren't already using them for this task:

a 64 bit OS (and computer if needed)

64-bit MatLab
 
Last edited by a moderator:
  • #3
Thanks for the suggestions
 

1. What does Eig(A'*A) represent?

Eig(A'*A) represents the eigenvalues of the matrix A'*A. These eigenvalues can tell us important information about the original matrix A, such as its trace, determinant, and condition number.

2. Why am I getting an "out of memory" error with Eig(A'*A)?

The matrix A'*A can be quite large, especially for matrices with a large number of columns. This means that computing the eigenvalues for Eig(A'*A) can require a lot of memory, and depending on the capabilities of your computer, it may not have enough memory to complete the computation.

3. Are there any shortcuts to computing Eig(A'*A)?

Yes, there are a few methods that can be used to compute Eig(A'*A) more efficiently. One approach is to use iterative methods, such as the power method or the Lanczos algorithm, which can reduce the computational burden by only computing a subset of the eigenvalues. Another option is to use sparse matrix techniques, which can be helpful if A'*A is a sparse matrix.

4. How can I avoid running out of memory when computing Eig(A'*A)?

There are a few ways to avoid running out of memory when computing Eig(A'*A). One option is to use a computer with more memory or to allocate more memory to the computation. Another approach is to break up the computation into smaller chunks and then combine the results. Additionally, using sparse matrix techniques or iterative methods can also help reduce the memory requirements.

5. Can I use Eig(A'*A) for any type of matrix A?

Eig(A'*A) can be used for any square matrix A. However, for non-square matrices, you can still compute the eigenvalues by using the singular value decomposition (SVD) instead of Eig(A'*A). The SVD is a more general method that can be used for rectangular matrices.

Similar threads

  • Programming and Computer Science
Replies
17
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
  • Programming and Computer Science
Replies
3
Views
1K
  • Computing and Technology
2
Replies
46
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • Programming and Computer Science
Replies
1
Views
277
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
11K
  • Biology and Medical
Replies
8
Views
4K
  • Computing and Technology
Replies
25
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
1K
Back
Top