Ccompute {EMSNM}R Documentation

Ccompute

Description

Compute the probability of Y in given parameters alphat, sigmat, etat and variables X, Z by the Bayesian Formula under the assumption of Sigmoid-Normal Model.

Usage

Ccompute(alphat, sigmat, etat, X, Z, Y)

Arguments

alphat

the coeffients of the mean of each subgroup

sigmat

the variance of Y

etat

the coeffients determining subgroup

X

the covariables of the mean of each subgroup

Z

the covaraibles determining subgroup

Y

the respond variable

Value

the probability of Y in given parameters alphat, sigmat, etat and variables X, Z under the assumption of Sigmoid-Normal Model.

Author(s)

Linsui Deng

Examples

#some variables
samplesize <- 1000
classsize <- 6
etasize <- 3
alphasize <- 2

Xtest <- data.frame(matrix(rnorm(samplesize*etasize),samplesize,etasize))
Ztest <- matrix(rnorm(samplesize*alphasize),samplesize,alphasize)

etatest <- matrix(seq(1.15,1,length=etasize*classsize),etasize,classsize)
alphatest <- matrix(seq(1.15,1,length=alphasize*classsize),alphasize,classsize)

Wtest <- Wgenerate(alpha=alphatest,eta=etatest,X=Xtest,Z=Ztest)

#test of Ccompute
sigmatest <- 1
Ctest <- 
  Ccompute(alphat=alphatest,sigmat=sigmatest,
           etat=etatest,X=Wtest$X,Z=Wtest$Z,Y=Wtest$Y)

[Package EMSNM version 1.0 Index]