logLikDerP {edgeR} | R Documentation |
Log-likelihood and derivatives for the proportion parameter (i,e, expression level) of negative binomial (mean = library size * proportion)
logLikDerP(p, y, lib.size, r, der = 0)
p |
vector of proportion parameters to be evaluated |
y |
matrix of counts |
lib.size |
vector of library sizes |
r |
size parameter of negative binomial distribution |
der |
derivative, either 0 (the function), 1 (first derivative) or 2 (second derivative) |
vector of the likelihood or specified derivative evaluations for each tag/gene
Mark Robinson, Davis McCarthy
estimatePs
calls logLikDerP
as part of the procedure for estimating the expression level(s) of each tag.
y<-matrix(rnbinom(20,size=1.5,mu=10),nrow=5) d<-DGEList(counts=y,group=rep(1:2,each=2),lib.size=rep(c(1000:1001),2)) this.p<-rowMeans( y/ outer(rep(1,nrow(y)),d$samples$lib.size) ) d1p<-logLikDerP(this.p,y,d$samples$lib.size,r=1.5,der=1)