loglikinterval: log-likelihood of an observed interval distribution

View source: R/DroppingInterval.R

loglikintervalR Documentation

log-likelihood of an observed interval distribution

Description

log-likelihood of an observed interval distribution

Usage

loglikinterval(
  data,
  mu,
  sigma,
  p,
  N = 5L,
  fun = "gamma",
  trunc = c(0, Inf),
  fpp = 0
)

Arguments

data

A numeric list of intervals.

mu

mean arrival interval.

sigma

standard deviation of the arrival interval.

p

chance to not observe an arrival.

N

Maximum number of missed observations to be taken into account (default N=5).

fun

Assumed distribution for the intervals, one of "normal" or "gamma", corresponding to the Normal and GammaDist distributions

trunc

Use a truncated probability density function with range trunc

fpp

Baseline proportion of intervals distributed as a random poisson process with mean arrival interval mu

Details

Refer to intervalpdf for details on the functional form of the probability density function of an observed interval distribution φ_{obs}. The log-likelihood L given a set of intervals x_j in data is given by

L(μ,σ,p)=\log ∑_j φ_{obs}(x_j | μ,σ,p)

The function is provided to allow likelihood maximisation by other optimization tools than the default by optim.

Value

returns the value of the loglikelihood

Examples

data(goosedrop)
loglikinterval(goosedrop$interval,mu=200,sigma=50,p=.3)

adokter/intRval documentation built on May 6, 2022, 2:44 a.m.