condLogLikDerSize: Conditional Log-Likelihood of the Dispersion for a Single Group of Replicate Libraries
Description
Derivatives of the negative-binomial log-likelihood with respect to the dispersion parameter for each gene, conditional on the mean count, for a single group of replicate libraries of the same size.
matrix of counts, all counts in each row having the same population mean
r
numeric vector or scalar, size parameter of negative binomial distribution, equal to 1/dispersion
delta
numeric vector or scalar, delta parameter of negative binomial, equal to dispersion/(1+dispersion)
der
integer specifying derivative required, either 0 (the function), 1 (first derivative) or 2 (second derivative)
Value
vector of row-wise derivatives with respect to r or delta
Details
The library sizes must be equalized before running this function. This function carries out the actual mathematical computations for the conditional log-likelihood and its derivatives, calculating the conditional log-likelihood for each gene.
Derivatives are with respect to either the size (r) or the delta parametrization (delta) of the dispersion.