Distance {IALS} | R Documentation |
The distance between the spaces spanned by the column of two matrices.
Description
Calculate the distance between spaces spanned by the column of two matrices. The distance is between 0 and 1. If the two spaces are the same, the distance is 0. if the two spaces are orthogonal, the distance is 1.
Usage
Distance(Z1, Z2)
Arguments
Z1 |
Input a matrix with |
Z2 |
Input another matrix with |
Details
Define
By the definition of , we can easily see that
, which measures the distance between the column spaces spanned by two orthogonal matrices
and
, i.e.,
and
. In particular,
and
are the same when
, while
and
are orthogonal when
. The Gram-Schmidt orthogonalization can be used to make
and
column-orthogonal matrices.
Value
Output a number between 0 and 1.
Author(s)
Yong He, Ran Zhao, Wen-Xin Zhou.
References
He, Y., Zhao, R., & Zhou, W. X. (2023). Iterative Least Squares Algorithm for Large-dimensional Matrix Factor Model by Random Projection. <arXiv:2301.00360>.
Examples
set.seed(1111)
A=matrix(rnorm(10),5,2)
B=matrix(rnorm(15),5,3)
Distance(A,B)