R/Locus_preprocess.R

Defines functions Locus_preprocess

Locus_preprocess <-function(Ynew,q) 
{
  N = dim(Ynew)[1]
  eigenA = eigen( Ynew %*% t(Ynew), T )
  whitenmat = diag( (eigenA$values[1:q] - mean(eigenA$values[(q+1):N]))^(-0.5)  ) %*% t(eigenA$vectors[,1:q])
  Ynew = whitenmat%*%Ynew # the whitened A matrix
  Ynew = Ynew/sd(Ynew)*5
  return(Ynew)
}

Try the LOCUS package in your browser

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

LOCUS documentation built on Oct. 4, 2022, 9:06 a.m.