Description Usage Arguments Details Value References See Also Examples
View source: R/weight.famdep.R
computes the triplet and the individual weights of the E step of the EM algorithm for a pedigree in the case of familial dependence. It returns also the overall log-likelihood of the observations. This is an internal function not meant to be called by the user.
1 | weight.famdep(id, dad, mom, status, probs, fyc, peel)
|
id |
individual ID of the pedigree, |
dad |
dad ID, |
mom |
mom ID, |
status |
symptom status: (2: symptomatic, 1: without symptoms, 0: missing), |
probs |
list of probability parameters of the model, |
fyc |
a matrix of |
peel |
a list of pedigree peeling containing connectors by peeling order and couples of parents |
the function calls the functions upward
and
downward
which perform the required probability
computations by processing the pedigree by nuclear family (or
equivalently by connector) following the peeling order.
the function returns a list of 3 elements:
ww |
triplet weights: an array of |
w |
individual weights: an array of |
ll |
log-likelihood. |
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.
See also upward
, downward
, e.step
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #data
data(ped.cont)
data(peel)
fam <- ped.cont[,1]
id <- ped.cont[fam==1,2]
dad <- ped.cont[fam==1,3]
mom <- ped.cont[fam==1,4]
status <- ped.cont[fam==1,6]
y <- ped.cont[fam==1,7:ncol(ped.cont)]
peel <- peel[[1]]
#probs and param
data(probs)
data(param.cont)
#densities of the observations
fyc <- matrix(1,nrow=length(id),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
weight.famdep(id,dad,mom,status,probs,fyc,peel)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.