penalty_prob and penalty_kappa
arguments of twalk_control() add the gradient-free
penalised move of Medina-Aguayo & Christen (2022), a fifth move that
shifts both points together towards distant regions and helps the chain
jump between well-separated modes. It is off by default
(penalty_prob = 0), and the chains are then the same as
those of version 2.2.0 (bit for bit on the same platform); a test checks
this against stored output.kernel_statistics and
summary() report it as a fifth kernel,
"penalty".x >= q for
the upper (95%) quantile, following posterior 1.8.0. The estimate
changes only when the draws have ties at that quantile (for example,
discrete parameters), and it is now symmetric under a change of sign.
This fixes the test failure against posterior 1.8.0 reported on the CRAN
checks.calculate_diagnostics() and summary()
report a new column, IAT_n: the integrated autocorrelation
time divided by the dimension, the measure of efficiency used by
Christen & Fox (2010, Section 4).calculate_diagnostics() explains
why the diagnostics are valid for the t-walk: the primary trajectory
alone is not a Markov chain, but each parameter is a scalar function of
the joint chain (x, x’), which is.The algorithm is unchanged: it still follows Christen & Fox (2010) exactly, with the same default settings. Because random numbers are now drawn in a different order, chains differ from those of version 2.1.0 for the same seed.
log_posterior are caught without
wrapping every evaluation in tryCatch(), which alone cost
several times the evaluation of a simple target.twalk_control(engine = "R")); tests check
that both engines produce the same chains draw by draw.thin argument to store only every
thin-th iteration.twalk_control(store_companion = FALSE) drops the
companion trajectory, halving the memory used by the output.all_samples is no longer stored, which used as much
memory as the two trajectories together. It is deprecated: accessing it
rebuilds it, with a warning.twalk_control() exposes the constants of the algorithm
(n1, aw, at and the move
probabilities), with the defaults of Christen & Fox (2010, Section
2.5), for sensitivity studies.twalk_continue() extends a previous run from the final
state of the sampler.twalk_step() performs a single t-walk transition, so
the kernel can be combined with Gibbs updates as described in Christen
& Fox (2010, Section 5).log_posterior and
companion_log_posterior.x0 has names,
log_posterior receives named vectors and the output columns
are named.x0 and xp0 may be matrices with one row
per chain, so that multiple chains start from dispersed points. A note
is shown when all chains share the same starting points.set.seed() and do not depend
on n_cores. With n_cores = 1, chains run
sequentially without starting a cluster.log_posterior at proposals are still
treated as rejections, but a warning now reports how many occurred and
the first error message.plot() method showing traces of the log posterior and
of the parameters, one colour per chain.posterior::as_draws(), as_draws_array()
and as_draws_df() methods.calculate_diagnostics() and summary() now
use the rank-normalized split-R-hat and the bulk and tail effective
sample sizes of Vehtari et al. (2021); the estimates agree with those of
the posterior package. R-hat is now also available for a single
chain.summary() returns a summary.twalk data
frame, printed with the sampler performance, instead of printing and
returning the table invisibly.coda::as.mcmc() and
coda::as.mcmc.list() methods for single and parallel t-walk
results, with optional burn-in and companion conversion.pkgload::load_all().[0, 1] and moved their calculation to the log scale for
numerical stability.set.seed() now controls both sequential and
parallel runs.n_chains and
total_iterations metadata in sequential and parallel
results.samples and
companion_samples trajectories. The legacy
all_samples field remains available for compatibility but
is not treated as one time-ordered chain.move_rate and no_move_rate alongside
the Metropolis–Hastings acceptance_rate.show_progress argument. Additional
arguments, including an argument named internal_call, are
now passed exclusively to log_posterior.testthat,
achieving 100% test coverage.testthat and covr to Suggested
dependencies.print() and summary()
for t-walk output objects.