R/ilr.R

"ilr" <-
function(X){
# isometric logratio transformation
X.ilr=matrix(NA,nrow=nrow(X),ncol=ncol(X)-1)
  for (i in 1:ncol(X.ilr)){
    X.ilr[,i]=sqrt((i)/(i+1))*log(((apply(as.matrix(X[,1:i]), 1, prod))^(1/i))/(X[,i+1]))
  }
return(X.ilr)
}

Try the chemometrics package in your browser

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

chemometrics documentation built on Aug. 25, 2023, 5:18 p.m.