Learn R Programming

publipha (version 0.1.2)

loo,mafit-method: Calculate the loo for an ma object.

Description

Computes PSIS-LOO CV, approximate leave-one-out cross-validation using Pareto smoothed importance sampling, see loo.

Usage

# S4 method for mafit
loo(x, ...)

Value

A loo object.

Arguments

x

an object of class mafit.

...

passed to loo. Only

Details

... affect the function through two parameters, marginal and lower_bound. When marginalis TRUE, the PSIS-LOO CV is based on the marginal likelihood, i.e. with the dependence on theta integrated out. marginal defaults to TRUE. lower_bound species the lower bound where log-likelihoods are dropped; this is only used in the p-hacking model and defaults to -6.

Examples

Run this code
# \donttest{
phma_model <- phma(yi, vi, data = metadat::dat.begg1989)
psma_model <- psma(yi, vi, data = metadat::dat.begg1989)
loo(phma_model)
loo(psma_model)
# }

Run the code above in your browser using DataLab