
"resample" starting points: pool prior draws, then SIR without replacement
Source: R/mcmc.R
mcmc_init_resample.RdA single pool of max(n_pool, n_chains) prior draws can land fewer than
n_chains of them in the posterior's support – the same shape of problem
mcmc_init_proposal() fixed for "proposal". Padding the shortfall by
recycling (rep_len() on too few indices) used to start several chains from
identical points, which defeats the diagnostics downstream: split-Rhat and
bulk ESS both assume the chains they compare started from distinct
locations, and a repeated start makes chains look more agreed than they are.
Details
Instead, more pools are drawn and their finite draws accumulated until
n_chains distinct ones are collected (up to 20 attempts, the same budget
mcmc_init_proposal() uses), and the final start is a weighted resample
without replacement from that accumulated, still-distinct set – not from a
single pool. If the budget runs out first, the error distinguishes a
genuinely degenerate surrogate (no draw at all landed in support) from a
merely low acceptance rate (some did, just not n_chains of them).