llikCauchy: log likelihood of Cauchy distribution and it's derivatives...

View source: R/llik.R

llikCauchyR Documentation

log likelihood of Cauchy distribution and it's derivatives (from stan)

Description

log likelihood of Cauchy distribution and it's derivatives (from stan)

Usage

llikCauchy(x, location = 0, scale = 1, full = FALSE)

Arguments

x

Observation

location, scale

location and scale parameters.

full

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

Details

In an rxode2() model, you can use llikCauchy() but you have to use all arguments. You can also get the derivative of location and scale with llikCauchyDlocation() and llikCauchyDscale().

Value

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

Author(s)

Matthew L. Fidler

Examples


x <- seq(-3, 3, length.out = 21)

llikCauchy(x, 0, 1)

llikCauchy(x, 3, 1, full=TRUE)

et <- et(-3, 3, length.out=10)
et$location <- 0
et$scale <- 1

model <- function() {
  model({
    fx <- llikCauchy(time, location, scale)
    dLocation <- llikCauchyDlocation(time, location, scale)
    dScale <- llikCauchyDscale(time, location, scale)
  })
}

rxSolve(model, et)


nlmixr2/rxode2 documentation built on Jan. 11, 2025, 8:48 a.m.