p.post.child: computes the posterior probability of observations of a child

Description Usage Arguments Value References Examples

View source: R/p.post.child.R

Description

computes the posterior probability of measurements of a child for each class and each symptom status of the subject given the classes of both of his parents. This is an internal function not meant to be called by the user.

Usage

1
p.post.child(child, c.connect, c.spouse, status, probs, fyc)

Arguments

child

a child in the pedigree,

c.connect

the class of one parent (who is a connector) of the child,

c.spouse

the class of the other parent of the child,

status

the symptom status vector of the whole pedigree,

probs

a list of all probability parameters of the model,

fyc

a matrix of n times K+1 giving the density of measurements of each individual if allocated to class k, where n is the number of individuals and K is the total number of latent classes in the model,

Value

the function returns p.child a matrix of 2 times K+1 entries such that p.child[s,k] is the posterior probability of the measurements Y_child under status S_child=s and when he is assigned to class k and his parents are assigned to classes c.connect and c.spouse.

References

TAYEB et al.: Solving Genetic Heterogeneity in Extended Families by Identifying Sub-types of Complex Diseases. Computational Statistics, 2011, DOI: 10.1007/s00180-010-0224-2.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#data
data(ped.cont)
fam <- ped.cont[,1]
dad <- ped.cont[fam==1,3]
status <- ped.cont[fam==1,6]
y <- ped.cont[fam==1,7:ncol(ped.cont)]
#a child
child <- which(dad!=0)[1]
data(probs)
data(param.cont)
#densities of the observations
fyc <- matrix(1,nrow=nrow(y),ncol=length(probs$p)+1)
fyc[status==2,1:length(probs$p)] <- t(apply(y[status==2,],1,dens.norm,
                                            param.cont,NULL))
#the function
p.post.child(child,c.connect=1,c.spouse=3,status,probs,fyc)

abureau/LCAextend documentation built on May 3, 2019, 9:41 p.m.