Learn R Programming

intRvals (version 1.0.1)

loglikinterval: 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

Value

returns the value of the loglikelihood

Details

Refer to intervalpdf for details on the functional form of the probability density function of an observed interval distribution \(\phi_{obs}\). The log-likelihood \(L\) given a set of intervals \(x_j\) in data is given by $$L(\mu,\sigma,p)=\log \sum_j \phi_{obs}(x_j | \mu,\sigma,p)$$ The function is provided to allow likelihood maximisation by other optimization tools than the default by optim.

Examples

Run this code
# NOT RUN {
data(goosedrop)
loglikinterval(goosedrop$interval,mu=200,sigma=50,p=.3)
# }

Run the code above in your browser using DataLab