conditionalLikelihoods {BookEKM}R Documentation

Mixture likelihoods conditioned on genotypes

Description

The mixture likelihood is calculated conditioned on genotypes. This should correspond to simillar MixKin functionality as implemented previously in Mathematica by Klaas Slooten and described in kinship course in Krakow Sep 1 2015.

Usage

conditionalLikelihoods(M, c, p, d, g)

Arguments

M

A vector of integers, possibly NULL, corresponding to the mixture

c

Drop in parameter, real in [0,1]

p

Allele frequencies.

d

Drop-out parameters for each contributor

g

A matrix with genotypes, one line for each contributor and an even number of columns.

Details

See mentioned Krakow presentation.

Value

likelihood

The conditional likelihoods

p.in.M

Output for the last two columns of g (see above) giving the probabilities that the alleles are in the mixture

Author(s)

Thore Egeland

References

Slooten, Krakow

Examples

#Example 
g1 <- c(1,2);g2 <- c(1,3)
d <- c(0.1,0.6);c <- 0.1;p <- c(0.1,0.2,0.3,0.4)
datamatrix <- rbind(g1,g2)
#The probabilities that alleles 1,2,3,4 are in the mixture:
conditionalLikelihoods(M=1:3, c, p, d, datamatrix)$p.in.M
M <- list(1:4,1:3,c(1,2,4),c(1,3,4),2:4,1:2,c(1,3),NULL)
ll <- NULL
for (i in 1:8)
ll <- c(ll,conditionalLikelihoods(M[[i]], c, p, d, datamatrix)$likelihood)
ll #likelihoods for the mixtures considered

[Package BookEKM version 1.0 Index]