R/transform.R

Defines functions transform.ilr

transform.ilr <- function(x)
{
    x.ilr <- x[, -ncol(x), drop=FALSE]
    colnames(x.ilr) <- paste("X", 1:ncol(x.ilr), sep="")
    rownames(x.ilr) <- NULL
    D <- ncol(x)

    for (i in 1:ncol(x.ilr)){
        x.ilr[,i]=sqrt((D-i)/(D-i+1))*log(((apply(as.matrix(x[,(i+1):D,drop=FALSE]),1,prod))^(1/(D-i)))/(x[,i]))
        ##x.ilr[,i]=sqrt((D-i)/(D-i+1))*log(apply(as.matrix(x[,(i+1):D]), 1, gm)/(x[,i]))	
    }

	return(-x.ilr)
}

Try the rrcov package in your browser

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

rrcov documentation built on May 29, 2024, 1:13 a.m.