estimateDispersion: Estimate the Dispersion factor in a beta-binomial model.
Description
This function estimates the dispersion factor in a beta-binomial model of the nucleotide counts. This model assumes that the count for nucleotide j at position i is
distributed after a beta-binomial $X_ib ~ BB(n_i; alpha, beta_ij)$, where $n_i$ is the coverage.
The base and nucleotide specific parameter $beta_ij$ is estimated from the local mean by the method-of-moments estimate, $alpha$ is a shared
overdispersion parameter. It is estimated via a numerical optimization of the likelihood under the null-hypothesis.
Usage
estimateDispersion(test, control, ...)
"estimateDispersion"(test, control, alternative = NULL, interval = c(0,1000))
"estimateDispersion"(test, control, alternative = NULL, interval = c(0,1000))
Arguments
test
Either a deepSNV object, or a matrix with the test counts.
control
Missing if test is a deepSNV object, otherwise missing.
alternative
The alternative to be tested. One of "greater", "less", "two-sided" (default). If test is a deepSNV object, automatically taken from the corresponding slot
if unspecified.
interval
The interval to be screened for the overdispersion factor. Default (0,1000).
...
Additional param passed to specific methods
Value
A deepSNV-class object if the input was a deepSNV object. Otherwise the loglikelihood and the estimated parameter.