exp_logl_fn: Exponential log likelihood

Description Usage Arguments Details Value Examples

View source: R/exp_logl_fn.R

Description

The log likelihood of the exponential distribution that is used for STE and TTE.

Usage

1
exp_logl_fn(x, param)

Arguments

x

A list formulated by ste_data_fn or tte_data_fn. x$toevent is a matrix with space- or time-to-event and NAs. x$censor is the censor

param

The value of log(lambda) of which you want to evaluate the logL.

Details

For TTE, x$toevent will be a matrix with 1 row per camera and 1 column per sampling occasion. For STE, x$toevent will be a matrix with 1 row. 1 column per sampling occasion

Value

The MLE value of lambda-hat

Examples

1
2
3
4
5
6
7
8
9
x <- build_ste_eh(df, deploy, occ)
dat.ste <- list(toevent = matrix(x$STE, nrow = 1),
                censor = x$censor)
optim(log(1/mean(dat.ste$toevent, na.rm = T)), 
             exp_logl_fn, 
             x = dat.ste, 
             control = list(fnscale = -1),
             hessian = T)
  

annam21/spaceNtime documentation built on Dec. 12, 2021, 2:48 a.m.