Runs the sampler chosen by posterior.nsbi_nle() or
posterior.nsbi_nre(). Draws are cached on the posterior object, so
asking for the same or fewer draws from the same observation returns
immediately instead of re-running a chain – which is what makes
summary() and repeated calls tolerable.
Usage
# S3 method for class 'nsbi_mcmc_posterior'
sample(
x,
size = 1000,
n = size,
obs = NULL,
refresh = FALSE,
verbose = FALSE,
seed = NULL,
...
)Arguments
- x
An
nsbi_mcmc_posteriorobject (namedxto satisfy thesample()generic).- size, n
Number of posterior draws (
nis an alias forsize).- obs
Observation to condition on (defaults to the posterior's
x_obs).- refresh
Force a new run even when a cached one would do.
- verbose
Report sampling progress.
- seed
Optional integer seed for this run. It overrides the
seedgiven toposterior(). A cached run is reused unlessrefresh = TRUE, so pass both to get a fresh, reproducible chain.- ...
Unused.
