Stochastic Tree Ensembles (XBART and BART) for Supervised Learning and Causal Inference
Overview
Flexible stochastic tree ensemble software. Robust implementations of Bayesian Additive Regression Trees (BART) (Chipman, George, McCulloch (2010) doi:10.1214/09-AOAS285) for supervised learning and Bayesian Causal Forests (BCF) (Hahn, Murray, Carvalho (2020) doi:10.1214/19-BA1195) for causal inference. Enables model serialization and parallel sampling and provides a low-level interface for custom stochastic forest samplers. Includes the grow-from-root algorithm for accelerated forest sampling (He and Hahn (2021) doi:10.1080/01621459.2021.1942012), a log-linear leaf model for forest-based heteroskedasticity (Murray (2020) doi:10.1080/01621459.2020.1813587), and the cloglog BART model of Alam and Linero (2025) doi:10.48550/arXiv.2502.00606 for ordinal outcomes.
Bug Fixes
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK12 OK2026-04-25
- NOTE12 OK, 2 NOTE2026-03-10
Documentation
- Help pages
- 66includes a package overview page
- Examples that run
- 100%44 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 95%
- Median days to close, 50 most recently updated closed issues
- 14
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
Commit identities over time
9 development-tooling and community-health practices detected across 7 families in the upstream repository
Checks run against github.com/stochastictree/stochtree on 2026-10-25.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Show all practicesHide 3 practices
This repository shows signs of AI coding tools.
- Claude Codefirst seen 2026-03-10Pull request it wrote: opened by a project memberCommits: at least 27 crediting it in the message
- Claude Sonnet 4.619 commits · Mar to May 2026
- Claude Opus 4.84 commits · Jun to Jul 2026
- Claude Opus 5.54 commits · Oct 2026
Dependencies
Installing stochtree adds 3 packages (0 with compiled code, 14 MB of source tarballs). Heaviest: BH 14 MB, cpp11 298 KB, R6 63 KB.
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 0.4.5Latest
- 0.4.42026-06-08 · diff ↗
- 0.4.22026-04-28 · diff ↗
- RR 4.6.0 released · 2026-04-24
- 0.4.02026-03-06 · diff ↗ ·
removed 8 exports
compute_bart_posterior_interval, compute_bcf_posterior_interval, compute_contrast_bart_model, compute_contrast_bcf_model, convertPreprocessorToJson, extract_parameter, sample_bart_posterior_predictive, sample_bcf_posterior_predictiveadded 9 exports
OutcomeModel, computeBARTPosteriorInterval, computeBCFPosteriorInterval, computeContrastBARTModel, computeContrastBCFModel, extractParameter, sampleBARTPosteriorPredictive, sampleBCFPosteriorPredictive, savePreprocessorToJson - 0.3.12026-02-12 · diff ↗
- 0.3.02026-01-28 · diff ↗ ·
removed 3 exports
expand_dims_1d, expand_dims_2d, expand_dims_2d_diagadded 1 export
extract_parameter - 0.2.12025-12-11 · diff ↗
- 0.2.02025-11-22 · diff ↗ ·
added 10 exports
compute_bart_posterior_interval, compute_bcf_posterior_interval, compute_contrast_bart_model, compute_contrast_bcf_model, expand_dims_1d, expand_dims_2d, expand_dims_2d_diag, sample_bart_posterior_predictive, sample_bcf_posterior_predictive, sample_without_replacement - RR 4.5.0 released · 2025-04-11
- 0.1.12025-02-08 · diff ↗
- 0.1.02025-02-07
- RR 4.4.0 released · 2024-04-24
Package metadata
- First published
- 2025-02-07
- Total releases
- 10 / 1 yrs
- License
- MIT + file LICENSE OSI
- Copyright
- Copyright details for stochtree's C++ dependencies, which are vendored along with the core stochtree source code, are detailed in inst/COPYRIGHTS
- Download size
- 1.6 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("stochtree")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-26, which the citation names so these numbers can be found later. More on citing and the projects behind them.