Elston: Compute a probability function on a pedigree

Description Usage Arguments Details Value See Also Examples

View source: R/Elston-algorithm.r

Description

Compute the probability of a pedigree, for a parameter theta and a given modele

Usage

1
Elston(ped, modele, theta, mem = new.env())

Arguments

ped

a pedigree, created by es.pedigree

modele

a modele

theta

a parameter for the modele

mem

an environment used for memoization

Details

This function runs Elston-Stewart algorithm. If mem is provided, some intermediate results of previous runs stored in it can be re-used.

Value

A list with two components, result: the probability value, and mem: an object storing intermediate results for future runs

See Also

Likelihood, es.pedigree

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## cf Elston-Stewart vignette for more coments on this example
data(conrad2)
# creating an es.pedigree object
genotypes <- c( rep(list(0:2), 21), 2 )

X <- es.pedigree( id = conrad2$id, father = conrad2$father, mother = conrad2$mother, 
      sex = conrad2$sex, pheno = rep(0, 22), geno = genotypes )

# running Elston-Stewart
r <- Elston(X, modele.di, list(p = 0.98))
r$result

# using the memoization...
r <- Elston(X, modele.di, list(p = 0.99), r$mem)
r$result

ElstonStewart documentation built on May 29, 2017, 8 p.m.