logLikNB {apeglm} | R Documentation |
This is a simple function to be passed to apeglm
as a log likelihood for the negative binomial distribution.
logLikNB(y, x, beta, param, offset)
y |
the counts |
x |
a design matrix |
beta |
the coefficient vector (natural log scale) |
param |
the overdispersion (alpha in DESeq2 notation) |
offset |
an offset matrix (natural log scale) |
the log likelihood for each sample in y
# this function is used by 'apeglm' to specify # a negative binomial log likelihood. # so it's only passed as an argument, not for use on its own. # we can show its output nevertheless: y <- rnbinom(10, mu=100, size=1/.1) x <- cbind(rep(1,10),rep(0:1,each=5)) beta <- c(log(100),0) param <- .1 offset <- rep(0, 10) logLikNB(y, x, beta, param, offset)