Learn R Programming

rospca (version 1.1.0)

angle: Standardised last principal angle

Description

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

Usage

angle(A, B)

Value

Standardised last principal angle between A and B.

Arguments

A

Numeric matrix of size \(p\) by \(k\).

B

Numeric matrix of size \(q\) by \(l\).

Author

Tom Reynkens

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.

References

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

Examples

Run this code
tmp <- dataGen(m=1)

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

angle(P, PP)

Run the code above in your browser using DataLab