CCRatio.default {BSagri}R Documentation

Compute ratio contrasts of chains of joint empirical distributions.

Description

Compute ratio contrasts of chains of joint empirical distributions. For internal use.

Usage

CCRatio.default(x, cmat)

Arguments

x an N times K matrix with numeric entries
cmat a list with entries numC and denC, each containing a contrast matrix with K columns (must be the same K as in x!) and M rows (is your choice, the number of contrasts of interest)

Details

Denote the elements of x by x[n,k]. Denote the numetator of cmat by C with elements c[m,k] and the denominator of cmat as D with elements d[m,k]. Function CCRatio.default simply calculates

sum(k=1,..,K; m; n)(c[m,k]*x[n,k]) / sum(k=1,..,K; m; n)(d[m,k]*x[n,k])

for each m=1,...,M and n=1,...,N. The result is a N times M matrix.

Examples


X<-round(cbind(
 rnorm(10,1,1),
 rnorm(10,1,1),
 rnorm(10,1,1),
 rnorm(10,1,1)))

# and numerator and denominator
# x times 4 contrast matrix

NMAT<-rbind(
c(1,0,0,0),
c(1,0,0,0),
c(1,0,0,0)
)

DMAT<-rbind(
c(0,1,0,0),
c(0,0,1,0),
c(0,0,0,1)
)

CCRatio.default(x=X, cmat=list(numC=NMAT, denC=DMAT) )


[Package BSagri version 0.1-5 Index]