Learn R Programming

DNAtools (version 0.1-22)

noaTabs: Computes the alpha_m variants and their weights.

Description

Computes the \(\alpha_m\)-vectors and their weights, \(c(\alpha_m)\), in order to compute the exact distribution of the number of alleles in a m-person DNA mixture.

Usage

noaTabs(alpha=NULL,m=2,weight=1)

Arguments

alpha

If noaTabs has been evaluated for n<m, then providing this object to noaTabs reduces the number of recursions needed to evaluate for m.

m

The number of contributors

weight

See the paper for details. Usually, this should be set to 1

Value

Returns a named vector of counts, where the names denotes the \(\alpha_m\)-vectors and the countes is the associated weights, \(c(\alpha_m)\).

Details

Computes the \(\alpha_m\)-vectors and their weights, \(c(\alpha_m)\), by recursion over the number of contributors \(m\). That is, \(\alpha_m\) is obtained based on \(\alpha_{m-1}\) -- see paper for details.

References

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

Examples

Run this code
# NOT RUN {
  ## 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 alpha_2
  noa.tab2 <- noaTabs(m=2)
  ## Use alpha_2 to compute alpha_3
  noa.tab3 <- noaTabs(alpha=noa.tab2, m=3)

  ## Compute P(N(m=3)=n), n=1,...,2*L*m, where L=10 here
  pNoA(freqs,m=3,theta=0,noa.tabs=noa.tab3)
  ## Same, but locuswise results
  pNoA(freqs,m=3,theta=0,noa.tabs=noa.tab3,locuswise=TRUE)
# }

Run the code above in your browser using DataLab