R/proj.R

Defines functions proj

Documented in proj

#' computes the projection matrix
#'
#' @param  X A matrix of any dimension
#' @return Returns a square matrix
#' @export


proj <- function(X){
  if(!class(X)=="matrix") X <- as.matrix(X)

  return(X%*%matpower(crossprod(X),-1)%*%t(X))
}
ansoale/Pals documentation built on Oct. 5, 2020, 12:02 a.m.