Convenience wrapper that calls svd_project followed
by svd_reconstruct, yielding the rank-k
least-squares approximation of Y in the column space of
the original matrix.
Arguments
- factor
An
amSVDobject fromsvd_factor.- Y
Numeric matrix or vector to project and reconstruct. Must have
nrow(Y)equal to the number of rows of the original source matrix.
Examples
m <- matrix(rnorm(30), nrow = 6)
A <- adgeMatrix(m)
fac <- svd_factor(A, k = 2L)
approx <- pca_coef(fac, m)