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 |
Details
Denote the elements of x
by x_{nk}
.
Denote the numetator of cmat
by C
with elements c_{mk}
and the denominator of cmat
as
D
with elements d_{mk}
.
Function CCRatio.default
simply calculates
\frac{\sum_{k=1}^{K}c_{mk}x_{nk}}{\sum_{k=1}^{K}d_{mk}x_{nk}}
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-10 Index]