Learn R Programming

panelPomp (version 1.7.0.0)

panel_loglik: Handling of loglikelihood replicates

Description

Handling of loglikelihood replicates.

Usage

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

Value

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

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.

Author

Carles Bretó

Details

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

See Also

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

Examples

Run this code
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)

Run the code above in your browser using DataLab