QZ (version 0.1-7)

fda.geigen: Generalized Eigen Analysis as in fda Package

Description

This is an equivalent function to fda::geigen which finds matrices L and M to maximize

tr(L'AM) / sqrt(tr(L'BL) tr(M'CM))

where A = a p x q matrix, B = p x p symmetric, positive definite matrix, B = q x q symmetric positive definite matrix, L = p x s matrix, and M = q x s matrix, where s = the number of non-zero generalized eigenvalues of A.

Usage

fda.geigen(Amat, Bmat, Cmat)

Arguments

Amat

a numeric matrix

Bmat

a symmetric, positive definite matrix with dimension = number of rows of A

Cmat

a symmetric, positive definite matrix with dimension = number of columns of A

Value

list(values, Lmat, Mmat)

Details

This function is equivalent to fda::geigen(Amat, Bmat, Cmat) except that this is rewritten and utilizes LAPACK functions via qz.dggev.

Also, Lmat and Mmat are both scaled such that L'BL and M'CM are identity matrices.

See Also

qz.geigen, qz.dggev.

Examples

Run this code
# NOT RUN {
<!-- % \dontrun{ -->
# }
# NOT RUN {
library(QZ, quiet = TRUE)

A <- matrix(as.double(1:6), 2)
B <- matrix(as.double(c(2, 1, 1, 2)), 2)
C <- diag(as.double(1:3))

ret.qz <- fda.geigen(A, B, C)

### Verify
library(fda, quiet = TRUE)
ret.fda <- fda::geigen(A, B, C)
# }
# NOT RUN {
<!-- % } -->
# }

Run the code above in your browser using DataLab