powered by
Function to compute an orthogonal projection matrix based on an arbitrary matrix.
B2P(x)
The resulting orthogonal projection matrix.
A matrix with p rows and k columns.
Klaus Nordhausen
The orthogonal projection matrix \(P\) corresponding to matrix \(x\) is defined as \(P=x(x^{T}x)^{-1}x^{T}\).
O2P
set.seed(1) X <- matrix(rnorm(30),ncol=3) P <- B2P(X)
Run the code above in your browser using DataLab