Next: trilower() Up: MacAnova Help File Previous: transpose()   Contents

# trideigen()

Usage:
 ```trideigen(Diag, Subdiag [ [, start] , end], values:F or vectors:F), Diag, Subdiag REAL vectors, start and end positive integers ```

Keywords: matrix algebra, time series
```trideigen(Diag, Subdiag) computes the eigenvalues and eigenvectors of
the symmetric tri-diagonal matrix with diagonal Diag and sub- and
super-diagonal Subdiag. Diag and Subdiag must be REAL vectors with
length(Subdiag) = n - 1 or length(Subdiag) = n, where n = length(Diag).
In the latter case, Subdiag[1] is ignored.  The result is a structure
with components 'values' and 'vectors', similar to eigen.  The
eigenvalues are returned in decreasing order.

trideigen(Diag, Subdiag, vectors:F) computes only the eigenvalues,
returning a vector of length n.

trideigen(Diag, Subdiag, values:F) computes only the eigenvectors,
returning a n by n matrix.

trideigen(Diag, Subdiag, start, end) computes the i-th eigenvalues and
eigenvectors, for i = start, ..., end.  trideigen(Diag, Subdiag) is
equivalent to trideigen(Diag, Subdiag, 1, length(Diag)).

trideigen(Diag, Subdiag, end) is eqivalent to trideigen(Diag, Subdiag,
1, end).

Command trideigen() was added specifically to make it straightforward to
compute discrete prolate spheroidal sequences (dpss) used in multi-taper
spectrum analysis.  For these, if W is the desired width, the following
computes the first K dpss
d <- cos(2*PI*W)*(.5*run(-n+1,n-1,2))^2
e <- .5*run(0,n-1)*run(n,1)
dpssvecs <- trideigen(d,e,K,values:F)

The advantages of trideigen() over eigen() are (a) you do not need to
create the n by n tridiagonal matrix, and (b) you can obtain a subset of
the eigenvalues and eigenvectors.