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)
}
Scarlett422301/LOCUS documentation built on April 8, 2024, 4:47 p.m.