Parallel psis list computations
Usage
parallel_psis_list(
N,
.loo_i,
.llfun,
data,
draws,
r_eff,
save_psis,
cores,
...
)
parallel_importance_sampling_list(
N,
.loo_i,
.llfun,
data,
draws,
r_eff,
save_psis,
cores,
method,
...
)Arguments
- N
The total number of observations (i.e.
nrow(data)).- .loo_i
The function used to compute individual loo contributions.
- .llfun
See
llfuninloo.function().- data, draws, ...
For the
loo.function()method and theloo_i()function, these are the data, posterior draws, and other arguments to pass to the log-likelihood function. See the Methods (by class) section below for details on how to specify these arguments.- r_eff
Vector of relative effective sample size estimates for the likelihood (
exp(log_lik)) of each observation. This is related to the relative efficiency of estimating the normalizing term in self-normalized importance sampling when using posterior draws obtained with MCMC. If MCMC draws are used andr_effis not provided then the reported PSIS effective sample sizes and Monte Carlo error estimates can be over-optimistic. If the posterior draws are (near) independent thenr_eff=1can be used.r_effhas to be a scalar (same value is used for all observations) or a vector with length equal to the number of observations. The default value is 1. See therelative_eff()helper functions for help computingr_eff.- save_psis
Should the
psisobject created internally byloo()be saved in the returned object? Theloo()function callspsis()internally but by default discards the (potentially large)psisobject after using it to compute the LOO-CV summaries. Settingsave_psis=TRUEwill add apsis_objectcomponent to the list returned byloo. This is useful if you plan to use theE_loo()function to compute weighted expectations after runningloo. Several functions in the bayesplot package also acceptpsisobjects.- cores
The number of cores to use for parallelization. This defaults to the option
mc.coreswhich can be set for an entire R session byoptions(mc.cores = NUMBER). The old optionloo.coresis now deprecated but will be given precedence overmc.coresuntilloo.coresis removed in a future release. As of version 2.0.0 the default is now 1 core ifmc.coresis not set, but we recommend using as many (or close to as many) cores as possible.Note for Windows 10 users: it is strongly recommended to avoid using the
.Rprofilefile to setmc.cores(using thecoresargument or settingmc.coresinteractively or in a script is fine).
- method
See
is_methodforloo()