Learn R Programming

DNAtools (version 0.1-8)

pContrib.locus: Compute the posterior probabilities for P(m|n0) for a given prior P(m)

Description

Compute a matrix of posterior probabilties $P(m|n_0)$ where m ranges from 1 to $m_{max}$, and $n_0$ is $0,\dots,2m_{max}$. This is done by evaluating $P(m|n_0)=P(n_0|m)P(m)/P(n)$, where $P(n_0|m)$ is evaluated by pNoA.

Usage

pContrib.locus(prob=NULL, m.prior=NULL, m.max=8, pnoa.locus=NULL,
               theta=0)

Arguments

prob
Vectors with allele probabilities for the specific locus
m.prior
A vector with prior probabilities (summing to 1), where the length of m.prior determines the plausible range of m
m.max
Derived from the length of m.prior, and if m.prior=NULL a uniform prior is speficied by m.max: m.prior = rep(1/m.max,m.max).
pnoa.locus
A named vector of locus specific probabilities $P(N(m)=n), n=1,\dots,2m$.
theta
The coancestery coefficient

Value

  • Returns a matrix [P(m|n0)] for m=1,...,m.max and n0=1,...,2m.max.

Details

Computes a matric of $P(m|n0)$ values for a specific locus.

References

T Tvedebrink (2013). 'On the exact distribution of the number of alleles in DNA mixtures', International Journal of Legal Medicine.

Examples

Run this code
## Simulate some allele frequencies:
  freqs <-  structure(replicate(10,
              { g = rgamma(n=10,scale=4,shape=3); g/sum(g)},
              simplify=FALSE),.Names=paste("locus",1:10,sep="."))
  ## Compute P(m|n0) for m=1,...,5 and n0=1,...10 for the first locus:
  pContrib.locus(prob=freqs[[1]],m.max=5)

Run the code above in your browser using DataLab