ap_psis {loo} | R Documentation |
Pareto smoothed importance sampling (PSIS) using approximate posteriors
Description
Pareto smoothed importance sampling (PSIS) using approximate posteriors
Usage
ap_psis(log_ratios, log_p, log_g, ...)
## S3 method for class 'array'
ap_psis(log_ratios, log_p, log_g, ..., cores = getOption("mc.cores", 1))
## S3 method for class 'matrix'
ap_psis(log_ratios, log_p, log_g, ..., cores = getOption("mc.cores", 1))
## Default S3 method:
ap_psis(log_ratios, log_p, log_g, ...)
Arguments
log_ratios |
The log-likelihood ratios (ie -log_liks) |
log_p |
The log-posterior (target) evaluated at S samples from the proposal distribution (g). A vector of length S. |
log_g |
The log-density (proposal) evaluated at S samples from the proposal distribution (g). A vector of length S. |
... |
Currently not in use. |
cores |
The number of cores to use for parallelization. This defaults to
the option
|
Methods (by class)
-
ap_psis(array)
: AnI
byC
byN
array, whereI
is the number of MCMC iterations per chain,C
is the number of chains, andN
is the number of data points. -
ap_psis(matrix)
: AnS
byN
matrix, whereS
is the size of the posterior sample (with all chains merged) andN
is the number of data points. -
ap_psis(default)
: A vector of lengthS
(posterior sample size).