EIGVAL (A);
The EIGVAL function computes the eigenvalues of a square numeric matrix, A. The EIGVAL function returns a matrix that contains the eigenvalues of A. See the description of the EIGEN subroutine for more details.
In SAS/IML 14.1 the EIGVAL function was updated to use vendor-supplied eigenvalue routines if they are available on your system. If you want to restore the pre-14.1 algorithm you can use the RESET EIGEN93 statement.
The following statements compute Example 7.1.1 from Golub and Van Loan (1989):
A = { 67.00 177.60 -63.20 , -20.40 95.88 -87.16 , 22.80 67.84 12.12 }; val = eigval(A); print val;
Notice that the matrix a
is not symmetric and that the eigenvalues are complex. The first column of the val
matrix is the real part of the three eigenvalues, and the second column is the complex part.
If a matrix is symmetric, it has real eigenvalues and real eigenvectors. The following statements produce a column vector that contains the eigenvalues of a crossproducts matrix:
x = {1 1, 1 2, 1 3, 1 4}; xpx = x` * x; /* xpx is a symmetric matrix */ rval = eigval(xpx); print rval;