Description Usage Arguments Details
Produce plot of the prior on COI for given parameters. Options include the uniform distribution, and a modified form of Poisson and negative binomial distribution (see details).
1 2 | plot_prior_COI(COI_model = "poisson", COI_mean = 3,
COI_dispersion = 2, COI_max = 20)
|
COI_model |
the type of prior on COI. Must be one of "uniform", "poisson", or "nb" (negative binomial) |
COI_mean |
the prior mean (before truncating at |
COI_dispersion |
the ratio of the variance to the mean of the prior on COI. Only applies under the negative binomial model. Must be >1 |
COI_max |
the maximum COI allowed. Distributions are truncated at this value |
The prior on COI can be uniform, Poisson, or negative binomial. In
the uniform case there is an equal chance of any given sample having a COI
between 1 and COI_max
(inclusive). In the Poisson and negative
binomial cases it is important to note that the distribution is over
(COI-1), rather than over COI. This is because both Poisson and negative
binomial distributions allow for 0 values, which cannot be the case here
because observed samples must contain at least 1 genotype. Poisson and
negative binomial distributions are also truncated at COI_max
.
The full probability mass distribution for the Poisson case with
COI_mean
= μ and COI_max
= M can be written
Pr(COI = n) = z (μ-1)^(n-1) exp(-(μ-1)) / (n-1)!
where z is a normalising constant that ensures the distribution sums to unity, and is defined as:
1/z = ∑_{i=1}^M (μ-1)^(i-1) exp(-(μ-1)) / (i-1)!
The mean of this distribution will generally be very close to μ, and the variance will be close to μ-1 (strictly it will approach these values as M tends to infinity).
The full probability mass distribution for the negative binomial case with
COI_mean
= μ, COI_dispersion
= v/μ and
COI_max
= M can be written
Pr(COI = n) = z Γ(n-1+N)/( Γ(N)(n-1)! ) p^N (1-p)^(n-1)
where N = (μ-1)^2/(v-μ+1), p = (μ-1)/v, and z is a normalising constant that ensures the distribution sums to unity, and is defined as:
1/z = ∑_{i=1}^M Γ(i-1+N)/( Γ(N)(i-1)! ) p^N (1-p)^(i-1)
The mean of this distribution will generally be very close to μ and the variance will be close to v (strictly it will approach these values as M tends to infinity).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.