Learn R Programming

loo (version 0.1.3)

psislw: Pareto smoothed importance sampling (PSIS)

Description

Pareto smoothed importance sampling (PSIS)

Usage

psislw(lw, wcp = 0.2, wtrunc = 3/4, cores = getOption("loo.cores",
  parallel::detectCores()), llfun = NULL, llargs = NULL, ...)

Arguments

lw
A matrix or vector of log weights. For computing LOO lw = -log_lik (see extract_log_lik) and is an $S$ by $N$ matrix where $S$ is the number of simulations and $N$ is the number of data
wcp
The proportion of importance weights to use for the generalized Pareto fit. The 100*wcp% largest weights are used as the sample from which to estimate the parameters of the generalized Pareto distribution.
wtrunc
For truncating very large weights to $S$^wtrunc. Set to zero for no truncation.
cores
The number of cores to use for parallelization. This can be set for an entire R session by options(loo.cores = NUMBER). The default is detectCores().
llfun,llargs
...
Ignored when psislw is called directly. The ... is only used internally when psislw is called by the loo function.

Value

  • A named with list with components lw_smooth (modified log weights) and pareto_k (estimated generalized Pareto shape parameters $k$).

Details

See the 'PSIS-LOO' section in loo-package.

See Also

loo-package, loo