log likelihood and derivatives for exponential distribution
log likelihood and derivatives for exponential distribution
llikExp(x, rate, full =FALSE)
Arguments
x: variable that is distributed by exponential distribution
rate: vector of rates.
full: Add the data frame showing x, mean, sd as well as the fx and derivatives
Returns
data frame with fx for the log pdf value of with dRate
that has the derivatives with respect to the rate parameter the observation time-point
Details
In an rxode2() model, you can use llikExp() but you have to use the x and rate arguments. You can also get the derivative of rate with llikExpDrate().
Examples
llikExp(1,1:3)llikExp(1,1:3, full=TRUE)# You can use rxode2 for these too:et <- et(1:3)et$x <-1model <-function(){ model({ fx <- llikExp(x, time) dRate <- llikExpDrate(x, time)})}rxSolve(model, et)