panel_loglik: Handling of loglikelihood replicates

panel_loglikR Documentation

Handling of loglikelihood replicates

Description

Handling of loglikelihood replicates.

Usage

## S4 method for signature 'matrix'
logLik(object, repMargin, first = "aver", aver = "logmeanexp", se = FALSE)

Arguments

object

Matrix with the same number of replicated estimates for each panel unit loglikelihood.

repMargin

The margin of the matrix having the replicates (1 for rows, 2 for columns).

first

Wether to "aver"(age replicates) or "aggr"(egate units) before performing the other action.

aver

How to average: 'logmeanexp' to average on the likelihood scale before taking logs or 'mean' to average after taking logs (in which case, which action is performed first does not change the result).

se

logical; whether to give standard errors.

Details

When se = TRUE, the jackknife se's from pomp::logmeanexp are squared, summed and the squared root is taken.

Value

numeric vector with the average panel log likelihood and, when se = TRUE, the corresponding standard error.

Author(s)

Carles \Breto

See Also

Other panelPomp workhorse functions: mif2(), panelPomp, pfilter()

Examples

ulls <- matrix(c(1,1.1,10.1,10),nr=2)
# when combining log likelihood estimates, the order in which aggregation and
# averaging are done can make a difference: panel_logmeanexp() implements the best
logLik(ulls,repMargin=1,first="aver",aver="logmeanexp")
logLik(ulls,repMargin=1,first="aggr",aver="mean",se=TRUE)

cbreto/panelPomp documentation built on April 13, 2024, 12:23 a.m.