pContrib_locus {DNAtools}R Documentation

Compute the posterior probabilities for Pr(mn0)\Pr(m|n_0) for a given prior Pr(m)\Pr(m).

Description

Compute a matrix of posterior probabilties Pr(mn0)\Pr(m|n_0) where mm ranges from 1 to mmaxm_{\max}, and n0n_0 is 0,,2mmax0,\ldots,2m_{\max}. This is done by evaluating Pr(mn0)=Pr(n0m)Pr(m)/Pr(n)\Pr(m|n_0)=Pr(n_0|m)Pr(m)/Pr(n), where Pr(n0m)\Pr(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 mm

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,,2mP(N(m)=n), n=1,\ldots,2m.

theta

The coancestery coefficient

Details

Computes a matrix of Pr(mn0)\Pr(m|n_0) values for a specific locus.

Value

Returns a matrix [Pr(mn0)][\Pr(m|n_0)] for m=1,,m.maxm = 1,\ldots,m.max and n0=1,,2m.maxn_0 = 1,\ldots,2m.max.

Author(s)

Torben Tvedebrink, James Curran

References

T. Tvedebrink (2014). 'On the exact distribution of the number of alleles in DNA mixtures', International Journal of Legal Medicine; 128(3):427–37. <https://doi.org/10.1007/s00414-013-0951-3>

Examples


  ## Simulate some allele frequencies:
  freqs <-  simAlleleFreqs()
  
  ## Compute Pr(m|n0) for m = 1, ..., 5 and n0 = 1, ..., 10 for the first locus:
  pContrib_locus(prob = freqs[[1]], m.max = 5)


[Package DNAtools version 0.2-4 Index]