RATS 11
RATS 11

EIGEN( options )   matrix  eigenvalues  eigenvectors

EIGEN computes the eigen decomposition of a SYMMETRIC or RECTANGULAR matrix, or can solve the generalized eigenvalue problem  \(\left| {{\bf{A}} - \lambda {\bf{B}}} \right| = 0\). The function %EIGDECOMP can also do eigen decompositions, but without some of the options provided by the EIGEN instruction.

Parameters

matrix

Input Matrix for which the eigen decomposition is computed. In general, it can be any \(N \times N\) RECTANGULAR or SYMMETRIC matrix. However, if you use either the SCALE or EXPLAIN options, it must be a positive definite SYMMETRIC.

eigenvalues

(optional output) For an \(N \times N\) matrix, EIGEN saves the (real parts of the) N eigenvalues in this VECTOR. Use the CVALUES option if you are expecting complex-valued eigenvalues. Use * for this parameter if you want eigenvectors but not eigenvalues.

eigenvectors

(Optional output) EIGEN saves the (real parts of the) eigenvectors in this \(N \times N\) RECTANGULAR. Use the CVECTORS option instead if you are expecting complex-valued eigenvectors.

Sorting and Normalization

For a SYMMETRIC matrix, the eigenvalues (and their corresponding eigenvectors) are ordered from largest to smallest; for a RECTANGULAR matrix, they are sorted according to the choice for the SORT option. Note, by the way, that they are ordered by their true value, not absolute value. For example, .00001 is before –10000.0.

 

Eigenvectors correspond to the elements in the eigenvalue vector in the sorted order. For a SYMMETRIC, EIGEN normalizes each eigenvector based upon your choice for the DMATRIX option. For a general RECTANGULAR, the columns will have unit length if the eigenvalue is real.

Options

DMATRIX=[EIGENVALUES]/IDENTITY

SCALE/[NOSCALE]

For a SYMMETRIC matrix, the eigen decomposition for \(\bf{A}\) takes the form \({\bf{A = PDP'}}\) where \(\bf{D}\) is a diagonal matrix. If DMATRIX=IDENTITY (the older option SCALE is a synonym), the matrix of eigenvectors (\(\bf{P}\)) is normalized so that \(\bf{D}\) is the identity matrix. This is only possible if matrix is SYMMETRIC and positive definite. For the default DMATRIX=EIGENVALUES, each column of \(\bf{P}\) has unit length and \(\bf{D}\) has the eigenvalues on the diagonal. With DMATRIX=IDENTITY, EIGEN produces as the eigenvectors a matrix \(\bf{F}\) such that \({\bf{A}} = {\bf{FF'}}\). You can use this on the FACTOR option for IMPULSE and similar instructions. For instance,

 

   eigen(dmatrix=identity) %sigma * eigdec

   impulse(model=rmpy,factor=eigdec,steps=24)
 

EXPLAIN=(output) RECTANGULAR for variance decomposition [unused]

When matrix is a cross moment or covariance matrix, the (i,j) element of the matrix set by the EXPLAIN option is the fraction of the variance in variable i that is explained by principal component j. Technically, if matrix is called \(\bf{V}\), EXPLAIN produces
 

\({\bf{E}}(i,j) = \frac{{{\lambda _j}e_{ij}^2}}{{{{\bf{V}}_{ii}}}}\)

      

where \({{\lambda _j}}\) is the jth eigenvalue, \({e_{ij}}\) is the ith element of eigenvector j and \({{{\bf{V}}_{ii}}}\) is the ith diagonal element of matrix. This can only be used if matrix is SYMMETRIC and positive definite.

 

CVALUES=VECTOR[COMPLEX] of complex eigenvalues

CVECTORS=RECTANGULAR[COMPLEX] of complex eigenvectors

SORT=REAL/IMAG/[ABSVAL]

Use CVALUES if you want the complex eigenvalues of a RECTANGULAR matrix, rather than just the real part available with the eigenvalues parameter. Use CVECTORS if you want the complex eigenvectors. They are sorted according to the SORT option. Sorting is always from highest to lowest. SORT=REAL sorts on the real part, SORT=IMAG on the imaginary part and SORT=ABSVAL on the absolute value.

 

GENERAL=B matrix for generalized eigenvalues [not used]

For computing generalized eigenvalues of the form \(\left| {{\bf{A}} - \lambda {\bf{B}}} \right| = 0\), use GENERAL to supply the \(\bf{B}\) matrix, while the matrix parameter supplies the \(\bf{A}\) matrix. \(\bf{A}\) and \(\bf{B}\) must be symmetric. See the QZ instruction for computing generalized decompositions with non-symmetric matrices.

Examples

This does an eigen decomposition of a symmetric matrix, extracts the eigenvector for the largest eigenvalue into the VECTOR ALPHA, does a calculation with it and display the large eigenvalue and the computed VECTOR.

 

*

* Compute the eigen decomposition. The largest eigenvalue will be

* the maximum percentage that any shock from an orthogonalized set

* can explain.

*

eigen vh eigval eigvect

*

* The first eigenvector gives the weights for the maximal vector

* on the columns in the original orthogonalization.

*

compute [vector] alpha=%xcol(eigvect,1)

compute [vector] x=%chol(%sigma)*alpha

*

disp "Maximal explanatory percentage" 100.0*eigval(1)

disp "Impact Response of maximizer" *.#### tr(x)


 

This computes the eigen values of %%VECH_A+%%VECH_B. Because this isn't symmetric, the eigenvalues could be complex, so the CV option is used to get this. These are then displayed.

 

eigen(cvalues=cv) %%vech_a+%%vech_b

disp "Eigenvalues from BEKK-Gaussian" cv


 


Copyright © 2025 Thomas A. Doan