angle {rospca}R Documentation

Standardised last principal angle

Description

Standardised last principal angle between the subspaces generated by the columns of A and B.

Usage

angle(A, B)

Arguments

A

Numeric matrix of size p by k.

B

Numeric matrix of size q by l.

Details

We compute the last principal angle between the subspaces generated by the columns of A and B using the algorithm in Bjorck and Golub (1973). This angle takes values between 0 and \pi/2. We divide it by \pi/2 to make it take values between 0 and 1, where 0 indicates that the subspaces are close.

Value

Standardised last principal angle between A and B.

Author(s)

Tom Reynkens

References

Bjorck, A. and Golub, G. H. (1973), “Numerical Methods for Computing Angles Between Linear Subspaces," Mathematics of Computation, 27, 579–594.

Examples

tmp <- dataGen(m=1)

P <- eigen(tmp$R)$vectors[,1:2]
PP <- rospca(tmp$data[[1]], k=2)$loadings

angle(P, PP)

[Package rospca version 1.1.0 Index]