Learn R Programming

edgeR (version 3.8.6)

estimateCommonDisp: Estimate Common Negative Binomial Dispersion by Conditional Maximum Likelihood

Description

Maximizes the negative binomial conditional common likelihood to give the estimate of the common dispersion across all tags.

Usage

estimateCommonDisp(object, tol=1e-06, rowsum.filter=5, verbose=FALSE)

Arguments

object
DGEList object
tol
the desired accuracy, passed to optimize
rowsum.filter
numeric scalar giving a value for the filtering out of low abundance tags in the estimation of the common dispersion. Only tags with total sum of counts above this value are used in the estimation of the common dispersion.
verbose
logical, if TRUE estimated dispersion and BCV will be printed to standard output.

Value

object with the following added components:
common.dispersion
estimate of the common dispersion.
pseudo.counts
numeric matrix of quantile-quantile normalized counts. These are counts adjusted so that the library sizes are equal, while preserving differences between groups and variability within each group.
pseudo.lib.size
the common library size to which the counts have been adjusted

Details

Implements the method of Robinson and Smyth (2008) for estimating a common dispersion parameter by conditional maximum likelihood. The method of conditional maximum likelihood assumes that library sizes are equal, which is not true in general, so pseudocounts (counts adjusted so that the library sizes are equal) need to be calculated. The function equalizeLibSizes is called to adjust the counts using a quantile-to-quantile method, but this requires a fixed value for the common dispersion parameter. To obtain a good estimate for the common dispersion, pseudocounts are calculated under the Poisson model (dispersion is zero) and these pseudocounts are used to give an estimate of the common dispersion. This estimate of the common dispersion is then used to recalculate the pseudocounts, which are used to provide a final estimate of the common dispersion.

References

Robinson MD and Smyth GK (2008). Small-sample estimation of negative binomial dispersion, with applications to SAGE data. Biostatistics, 9, 321-332

See Also

equalizeLibSizes

Examples

Run this code
# True dispersion is 1/5=0.2
y <- matrix(rnbinom(1000,mu=10,size=5),ncol=4)
d <- DGEList(counts=y,group=c(1,1,2,2),lib.size=c(1000:1003))
d <- estimateCommonDisp(d, verbose=TRUE)

Run the code above in your browser using DataLab