kimura_neg_loglik: Calculate negative log-likelihood for heteroplasmy...

View source: R/kimura_neg_loglik.R

kimura_neg_loglikR Documentation

Calculate negative log-likelihood for heteroplasmy measurements

Description

Calculate negative log-likelihood for a given set of heteroplasmy measurements h and parameters theta = logit(p), logit(b) (we write h0 for p). We can do this by enforcing a particular h0 value (passed as an argument) or treating h0 as a fit parameter (default). The logit transform is used to ensure h0 and b remain in the [0,1] interval regardless of what real-valued argument the numerical optimiser attempts.

Usage

kimura_neg_loglik(theta, h, h0 = F)

Arguments

theta

Kimura parameters p (or h0 here) and b.

h

A vector containig heteroplasmy measurements. Every observation should be in [0,1].

h0

Logical parameter. A particular h0 value Default is to treat h0 as a fit parameter

Value

The negative log likelihood for the input.

Examples

 X.1 = rnorm(50,0.5,0.1)
kimura_neg_loglik(c(0.5,0.91),X.1)

kostasgian21/heteroplasmy documentation built on Jan. 30, 2024, 12:30 a.m.