LRmoments2 {BookEKM}R Documentation

Calculates expectation, standard deviation and skewness of LR under HP and HD

Description

Exact numerical calculation.

Usage

LRmoments2(p = c(0.5, 0.5), kappaP = c(0, 1, 0),kappaD = c(1, 0, 0),logg=FALSE, base =exp(1))

Arguments

p

Allele frequencies

kappaP

Probabilities of 0,1 and 2 alleles IBD corresponding to pedigree for HP

kappaD

Probabilities of 0,1 and 2 alleles IBD corresponding to pedigree for HD

logg

If TRUE, LR is log transformed with basis base (below).

base

Base for log transform

Value

moments

expectation, standard deviation and skewness of LR under HP and HD

LRtable

Distribution of LR under HP and HD

Author(s)

Thore Egeland Thore.Egeland@gmail.com

References

Slooten and Egeland (2013, submitted)

Examples

require(paramlink)


LRmoments2(kappaP=c(0,1,0)) #Motivating example
## Not run: 
data(db)
p=db[db$Marker=="VWA",]$Freq
LRmoments2(p=p,kappaP=c(0,1,0))
## End(Not run)

#Log example
x <- 0.1
res <- LRmoments2(kappaP=c(0,1,0), p = c(x,1-x),logg=TRUE)

#Exact
logE <- function(x) {
term1 <- x^3*log(1/x)+2*x^2*(1-x)*log(1/(2*x))+2*x*(1-x)^2*log(1/(2-2*x))
term2 <- x*(1-x)*log(1/(4*x*(1-x)))+(1-x)^3*log(1/(1-x))
term1+term2
}
round(res$moments[1],15)==round(logE(x),15)


[Package BookEKM version 1.0 Index]