ShrinkageTrees 2.1.0

Two corrections to the horseshoe global update (breaking)

Two independent defects in Horseshoe::GlobalUpdate() have been fixed. Both affected every fit using prior_type = "horseshoe" (including HorseTrees() and CausalHorseForest()). Results from earlier versions will not reproduce under this release.

  1. global_hp had no effect. The scale entered the auxiliary draw as 1.0 / alpha_global * alpha_global, which by operator precedence is the constant 1.0. The user’s global_hp was silently discarded, so every fit behaved as though global_hp = 1 regardless of what was supplied. This was reported by a referee of the accompanying manuscript.

  2. The error scale and the forest scale were swapped. EtaPrior::GlobalUpdate() declares (..., sigma, omega, ...) but was being called with (omega, sigma). Both are const double&, so the swap compiled silently. The tau draw therefore divided by sigma where it should have divided by omega. The effect is small where omega = 1 (HorseTrees(), ShrinkageTrees()) and substantial where omega = 1/2 (the causal forests), where it grew with the number of covariates.

Recalibrated default shrinkage (breaking)

The old default of k = 0.1 was chosen while defect (1) was present, so it was tuned for a model in which the global scale was pinned at 1. With the defect corrected, that value shrinks far too aggressively: in our simulations it drove pointwise coverage of the conditional treatment effect from roughly 0.95 down to about 0.4. Re-running existing scripts against this release without updating k is therefore worse than not upgrading at all.

The defaults are now calibrated for the corrected sampler:

function old new
HorseTrees() k = 0.1 k = 1.0
CausalHorseForest() k = 0.1 k = 1.5
ShrinkageTrees() local_hp, global_hp required default to 1.0 / sqrt(number_of_trees)
CausalShrinkageForest() four scales required default to 1.5 / sqrt(number_of_trees_*)

Values of k between roughly 0.5 and 1.5 (single-forest models) or 1 and 2 (causal models) worked well across a range of simulated settings, with smaller values shrinking more aggressively and larger values being more conservative. The defaults sit in the middle of each range. The causal range is higher because the treatment forest enters as b * tau(x) with b = +/- 1/2, halving its contribution to the response; measured on the scale of that contribution the two recommendations nearly coincide. k remains exposed on all four functions and is a natural target for cross-validation.

The local_hp / global_hp arguments are also no longer mandatory for prior_type = "horseshoe"; either may be supplied alone, with the other taking its default. Only their product identifies the prior, so setting them equal loses nothing. prior_type = "horseshoe_fw" is unchanged and still requires both to be given explicitly.

ovarian rebuilt, ovarian_truth added (breaking)

predict() passed the training design in the wrong memory order

predict() on a ShrinkageTrees object handed the stored training design matrix straight to the C++ sampler. The C++ layer reads designs as a flat row-major buffer, but R coerces a matrix to a vector column-major, so the training data was transposed inside the sampler on every call whenever n != p. The test design on the same call was flattened correctly, so the two disagreed. It ran and returned plausible numbers.

predict() on a CausalShrinkageForest object was unaffected: it already flattened both designs correctly.

New: posterior_projection()

Lower-dimensional posterior summarisation following Woody, Carvalho and Murray (2021). Every posterior draw of the fitted function, or of the treatment-effect and prognostic surfaces for causal fits, is projected onto a simpler summary model: a linear model (unpenalised, ridge, lasso, or elastic net), a spline-additive model, or a shallow CART tree. Returns a posterior over summaries with credible intervals, plus the posterior of the summary R-squared.

The penalised linear families are the exception: they project the posterior mean of the surface once and report point estimates, with no intervals. The spread of a penalised solution across draws has no coverage guarantee for the projection of the true surface, and the implied inclusion frequencies read as selection probabilities while being driven by the penalty.

glmnet and rpart are new suggested packages.

Bug fixes

Reproducing earlier output

There is no setting that reproduces pre-2.1.0 results exactly, because the sampler itself has changed. The closest correspondence is that the old code was equivalent to the corrected code with global_hp = 1, since the global scale was inert.

ShrinkageTrees 2.0.2

Bayesian bootstrap for the average treatment effect

summary(), plot(type = "ate"), and predict() for CausalShrinkageForest (and CausalHorseForest) now default to a Bayesian-bootstrap posterior for the average treatment effect: at each MCMC iteration the per-observation CATEs are reweighted with Dirichlet(1, …, 1) weights before being summed, giving a draw from the posterior of the population ATE (PATE). Credible intervals are correspondingly wider than before because they now propagate uncertainty in the covariate distribution, not only in tau(x).

This is a breaking change for printed/plotted numerics: existing scripts will report wider CIs than before. Use bayesian_bootstrap = FALSE to reproduce previous output.

ShrinkageTrees 2.0.1

ovarian dataset restructured

The ovarian dataset is now a single data frame (previously a list with $clinical and $X elements). Clinical columns (OS_time, OS_event, treatment, age, figo_stage, tumor_grade) and the 2000 gene expression columns are combined into one data frame with 2006 columns. This simplifies data access and aligns the format with the pdac dataset.

Code that previously used ovarian$clinical or ovarian$X must be updated — see ?ovarian for the new structure.

Bug fixes

ShrinkageTrees 2.0.0

TCGA ovarian cancer dataset (ovarian)

Added the ovarian dataset: a processed TCGA-OV cohort (n = 357) for high-dimensional survival prediction and causal inference.

See ?ovarian and examples/test-ovarian.R for a full worked example covering survival prediction (SurvivalBART, SurvivalDART, HorseTrees) and causal inference (SurvivalBCF, SurvivalShrinkageBCF, CausalHorseForest).

Treatment coding for causal models (treatment_coding)

All causal model functions — CausalHorseForest(), CausalShrinkageForest(), SurvivalBCF(), and SurvivalShrinkageBCF() — now accept a treatment_coding argument controlling how the treatment indicator enters the BCF decomposition y = f(x) + b * tau(x) + epsilon. Four options are available:

The predict() method for CausalShrinkageForest objects automatically carries forward the treatment coding used at training time. A propensity_test argument is available for supplying test-set propensity scores (defaults to 0.5).

Interval-censored survival outcomes

All survival-capable functions now support interval-censored data in addition to right-censored data. Supply left_time and right_time vectors (with outcome_type = "interval-censored") instead of y and status. Three censoring types are distinguished:

This convention follows survival::Surv(type = "interval2"). Censored event times are augmented within the AFT Gibbs sampler. The following functions are affected:

Multi-chain MCMC (n_chains)

All four primary model-fitting functions — ShrinkageTrees, HorseTrees, CausalHorseForest, and CausalShrinkageForest — now accept an n_chains argument (default 1). When n_chains > 1:

S3 classes and methods

MCMC convergence diagnostics (coda)

Posterior visualisation (plot)

S3 plot() methods added for ShrinkageTrees, CausalShrinkageForest, and ShrinkageTreesPrediction. Requires the suggested package ggplot2.

Vignette

Survival wrapper improvements

Bug fixes

ShrinkageTrees 1.2.0

ShrinkageTrees 1.1.0

ShrinkageTrees 1.0.3

ShrinkageTrees 1.0.2

ShrinkageTrees 1.0.1

ShrinkageTrees 1.0.0

🎉 First CRAN release of ShrinkageTrees!

This package provides Bayesian regression tree models with shrinkage priors, supporting:

It includes four core functions:

The ...Trees functions use a single learner to estimate the outcome model directly. In contrast, the Causal...Forest variants fit separate models for the treated and control regression function. This enables estimation of conditional average treatment effects (CATEs).