log-likelihood for the Poisson distribution
llikPois(x, lambda, full = FALSE)
x
: non negative integerslambda
: non-negative meansfull
: Add the data frame showing x, mean, sd as well as the fx and derivativesdata frame with fx
for the pdf value of with dLambda
that has the derivatives with respect to the parameters at the observation time-point
In an rxode2()
model, you can use llikPois()
but you have to use all arguments. You can also get the derivatives with llikPoisDlambda()
llikPois(0:7, lambda = 1) llikPois(0:7, lambda = 4, full=TRUE) # In rxode2 you can use: et <- et(0:10) et$lambda <- 0.5 model <- function() { model({ fx <- llikPois(time, lambda) dLambda <- llikPoisDlambda(time, lambda) }) } rxSolve(model, et)
Matthew L. Fidler
Useful links