llikBeta {rxode2}R Documentation

Calculate the log likelihood of the binomial function (and its derivatives)

Description

Calculate the log likelihood of the binomial function (and its derivatives)

Usage

llikBeta(x, shape1, shape2, full = FALSE)

Arguments

x

Observation

shape1, shape2

non-negative parameters of the Beta distribution.

full

Add the data frame showing x, mean, sd as well as the fx and derivatives

Details

In an rxode2() model, you can use llikBeta() but you have to use all arguments. You can also get the derivative of shape1 and shape2 with llikBetaDshape1() and llikBetaDshape2().

Value

data frame with fx for the log pdf value of with dShape1 and dShape2 that has the derivatives with respect to the parameters at the observation time-point

Author(s)

Matthew L. Fidler

Examples




x <- seq(1e-4, 1 - 1e-4, length.out = 21)

llikBeta(x, 0.5, 0.5)

llikBeta(x, 1, 3, TRUE)

et <- et(seq(1e-4, 1-1e-4, length.out=21))
et$shape1 <- 0.5
et$shape2 <- 1.5

model <- function() {
  model({
    fx <- llikBeta(time, shape1, shape2)
    dShape1 <- llikBetaDshape1(time, shape1, shape2)
    dShape2 <- llikBetaDshape2(time, shape1, shape2)
  })
}

rxSolve(model, et)


[Package rxode2 version 2.1.3 Index]