R/deflation.R

Defines functions deflation

deflation <- function(X, y){
  # Computation of the residual matrix R
  # Computation of the vector p.
  # p <- t(X)%*%y/as.vector(crossprod(y))
  p <- apply(t(X),1,miscrossprod,y)/as.vector(crossprod(y))
  R <- X - y%*%t(p)
  return(list(p=p,R=R))
}

Try the RGCCA package in your browser

Any scripts or data that you put into this service are public.

RGCCA documentation built on May 30, 2017, 7:22 a.m.