50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

BSagri (version 0.1-10)

CCRatio.default: 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 xnk. Denote the numetator of cmat by C with elements cmk and the denominator of cmat as D with elements dmk. Function CCRatio.default simply calculates k=1Kcmkxnkk=1Kdmkxnk for each m=1,...,M and n=1,...,N. The result is a N times M matrix.

Examples

Run this code
# NOT RUN {

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) )


# }

Run the code above in your browser using DataLab