flipGSVD: Flip output of GSVD

View source: R/flipGSVD.R

flipGSVDR Documentation

Flip output of GSVD

Description

Flip (reverse order) output of GSVD

Usage

flipGSVD(vs, d1 = c(50, 50), d2 = c(48, 50))

Arguments

vs

list output of GSVD

d1

dimensionals of A

d2

dimensions of B

Details

This flipping of the matrix is done to agree with the Matlab code.

Value

Same as GSVD, but order of eigenvectors is reversed.

U

m by m orthogonal matrix

V

p by p orthogonal matrix, p=rank(B)

X

n by n nonsingular matrix

C

singular values, m by n matrix with diagonal elements shifted from main diagonal

S

singular values, p by n diagonal matrix

Note

The GSVD routines are from LAPACK.

Author(s)

Jonathan M. Lees<jonathan.lees@unc.edu>

See Also

GSVD

Examples


set.seed(12)

n <- 5
A <- matrix(runif(n*n),nrow=n)
B <- matrix(runif(n*n),nrow=n)

VS = GSVD(A, B)

FVS = flipGSVD(VS, d1 = dim(A) , d2 = dim(B) )
## see that order of eigen vectors is reversed
diag(VS$S)
diag(FVS$S)


PEIP documentation built on Aug. 21, 2023, 9:10 a.m.