Learn R Programming

segtest (version 2.0.0)

llike_li: Objective function for em_li()

Description

Objective function for em_li()

Usage

llike_li(B, lpivec)

Value

The log-likelihood of a vector of genotype frequencies when using genotype likelihoods. This is from Li (2011).

Arguments

B

The log-likelihood matrix. Rows are individuals columns are genotypes.

lpivec

The log prior vector.

Author

David Gerard

References

  • Li, H. (2011). A statistical framework for SNP calling, mutation discovery, association mapping and population genetical parameter estimation from sequencing data. Bioinformatics, 27(21), 2987-2993. tools:::Rd_expr_doi("10.1093/bioinformatics/btr509")

Examples

Run this code
# Simulate some data
set.seed(1)
gl <- simgl(nvec = c(3, 2, 4, 1, 2))
# Log-likelihood at given log-priors
prob <- c(0.1, 0.2, 0.4, 0.2, 0.1)
lprob <- log(prob)
llike_li(B = gl, lpivec = lprob)

Run the code above in your browser using DataLab