panel_loglik {panelPomp}R 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 Bretó

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)

[Package panelPomp version 1.4.0.1 Index]