Package: dbarts 1.0-0

dbarts: Discrete Bayesian Additive Regression Trees Sampler

Fits Bayesian additive regression trees (BART; Chipman, George, and McCulloch (2010) <doi:10.1214/09-AOAS285>) while allowing the updating of predictors or response so that BART can be incorporated as a conditional model in a Gibbs/Metropolis-Hastings sampler. Supports continuous, probit, logistic, multinomial, ordinal, negative-binomial, semicontinuous two-part, and survival (accelerated failure time and discrete-time hazard) responses, robust Student-t errors, heteroscedastic variance forests, monotonicity and interaction constraints, variable selection through 'DART' priors, missing-value incorporation, categorical and sparse predictors, and linear or Gaussian-process leaf models. Also provides a BayesTree-compatible interface.

Authors:Vincent Dorie [aut, cre], Hugh Chipman [aut], Robert McCulloch [aut], R Core Team [ctb], Guido U Draheim [ctb], Maarten Bosmans [ctb], Christophe Tournayre [ctb], Michael Petch [ctb], Rafael de Lucena Valle [ctb], Steven G. Johnson [ctb], Matteo Frigo [ctb], John Zaitseff [ctb], Daniel Richard G. [ctb]

dbarts_1.0-0.tar.gz
dbarts_1.0-0.zip(r-4.7-x86_64)dbarts_1.0-0.zip(r-4.7-arm64)dbarts_1.0-0.zip(r-4.6-x86_64)dbarts_1.0-0.zip(r-4.6-arm64)dbarts_1.0-0.zip(r-4.5-x86_64)
dbarts_1.0-0.tgz(r-4.6-x86_64)dbarts_1.0-0.tgz(r-4.6-arm64)dbarts_1.0-0.tgz(r-4.5-x86_64)dbarts_1.0-0.tgz(r-4.5-arm64)
dbarts_1.0-0.tar.gz(r-4.7-arm64)dbarts_1.0-0.tar.gz(r-4.7-x86_64)dbarts_1.0-0.tar.gz(r-4.6-arm64)dbarts_1.0-0.tar.gz(r-4.6-x86_64)
dbarts_1.0-0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
dbarts/json (API)

# Install 'dbarts' in R:
install.packages('dbarts', repos = c('https://vdorie.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/vdorie/dbarts/issues

Pkgdown/docs site:https://vdorie.github.io

Uses libs:
  • c++– GNU Standard C++ Library v3

On CRAN:

Conda:

cpp

12.53 score 61 stars 19 packages 884 scripts 6.1k downloads 2 mentions 31 exports 0 dependencies

Last updated from:acad4b7630. Checks:4 ERROR, 11 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64ERROR601
linux-devel-x86_64OK707
source / vignettesOK374
linux-release-arm64ERROR610
linux-release-x86_64OK893
macos-release-arm64OK588
macos-release-x86_64ERROR959
macos-oldrel-arm64OK631
macos-oldrel-x86_64ERROR1268
windows-devel-arm64OK811
windows-devel-x86_64OK970
windows-release-arm64OK772
windows-release-x86_64OK976
windows-oldrel-x86_64OK929
wasm-releaseOK122

Exports:bartbart2bartBTdbartsdbartsControldbartsDatadbartsDrawLatentsdbartsFamiliesdbartsForestsdbartsPriorsdbartsSpecdbartsValidateCompositiondbartsWorkingResponseextractguessNumCoresmakeindmakeModelMatrixFromDataFramemakeTestModelMatrixna.keepPredictorsOpspd2bartpdbartplotTreerbart_virhatsamplePriorPredictiveshowsparseFactorsurvivalProbabilitiesupdatePredictorPerObservationJointlyxbart

Dependencies:

Building a Gibbs Sampler with dbarts
Model | Conditional Posteriors | Simulated Data | Implementing a Gibbs Sampler | Saveing the sampler | Visualizing the Result | Several Forests with Multipliers | What it costs | Five things the recipe does not get | Graduating to a multi-forest sampler | Response Families | DART | Data Frames, Factors, and Missing Values | A Random-Intercept Model Through setOffset | Multiple Threading

Last update: 2026-11-11
Started: 2020-12-21

Working with dbarts Saved Trees
Simulation | Model Fitting | Extracting Trees | Flattened Trees | Categorical Splits | Tree Traversal | Plotting Trees | Getting Tree Predictions | Counts for New Data | Advanced Traversal | References

Last update: 2026-11-11
Started: 2022-01-24

dbarts as a Component
1. Data augmentation written in R | 2. An outer block on the offset channel | Checking the composition | 3. Several forests, one prior budget | 4. A latent predictor shared by two samplers | 5. An outer sampler that owns sigma | 6. Reading the fit an incremental scheme needs | 7. A per-draw callback that never returns the array | Where to look next

Last update: 2026-11-06
Started: 2026-08-20

Readme and manuals

Help Manual

Help pageTopics
Discrete Bayesian Additive Regression Trees Samplerdbarts-package
Bayesian Additive Regression Trees with Extended Response Familiesbart extract.bartHurdle extract.bartMultinomial extract.bartNegbin extract.bartOrdinal family.bartHurdle family.bartMultinomial family.bartNegbin family.bartOrdinal fitted.bartHurdle fitted.bartMultinomial fitted.bartNegbin fitted.bartOrdinal nobs.bart nobs.bartHurdle nobs.bartMultinomial nobs.bartNegbin nobs.bartOrdinal plot.bartHurdle plot.bartMultinomial plot.bartNegbin plot.bartOrdinal predict.bartHurdle predict.bartMultinomial predict.bartNegbin predict.bartOrdinal print.bartHurdle print.bartMultinomial print.bartNegbin print.bartOrdinal print.summary.bartHurdle residuals.bartHurdle residuals.bartMultinomial residuals.bartNegbin residuals.bartOrdinal sigma.bart sigma.bartHurdle sigma.bartMultinomial sigma.bartNegbin sigma.bartOrdinal summary.bartHurdle summary.bartMultinomial summary.bartNegbin summary.bartOrdinal
Bayesian Additive Regression TreesbartBT extract extract.bart family.bart fitted.bart plot.bart predict.bart print.bart residuals.bart
Block-Additive Constraints for BARTblocks
Discrete Bayesian Additive Regression Trees Samplerdbarts
Embedding dbarts In A Larger Samplerdbarts-embedding
Augmentation Draws For A Composed SamplerdbartsAugmentation dbartsDrawLatents dbartsWorkingResponse
Discrete Bayesian Additive Regression Trees Sampler ControldbartsControl
Discrete Bayesian Additive Regression Trees Sampler DatadbartsData
Response Family ConstructorsdbartsFamilies show,dbartsFamily-method
Forest Specification ConstructorsdbartsForests
Mixed Dense/Sparse Predictor Containeras.data.frame.dbartsMixedMatrix as.matrix.dbartsMixedMatrix dbartsMixedMatrix dim.dbartsMixedMatrix dimnames.dbartsMixedMatrix [.dbartsMixedMatrix
Prior Specification ConstructorsdbartsPriors
Class "dbartsSampler" of Discrete Bayesian Additive Regression Trees Sampler$,dbartsSampler-method dbartsSampler dbartsSampler-class getForest getVarianceForest setForest setTreePrior setVarianceForest \S4method{copy}{dbartsSampler} \S4method{getFitsWithoutOffset}{dbartsSampler} \S4method{getForestAmplitudes}{dbartsSampler} \S4method{getForestFits}{dbartsSampler} \S4method{getForestVariableCounts}{dbartsSampler} \S4method{getForest}{dbartsSampler} \S4method{getK}{dbartsSampler} \S4method{getLatents}{dbartsSampler} \S4method{getLeafPrior}{dbartsSampler} \S4method{getShape}{dbartsSampler} \S4method{getSigmas}{dbartsSampler} \S4method{getSumsOfSquaredResiduals}{dbartsSampler} \S4method{getTrees}{dbartsSampler} \S4method{getVarianceForest}{dbartsSampler} \S4method{getVariance}{dbartsSampler} \S4method{growFromRoot}{dbartsSampler} \S4method{installTrees}{dbartsSampler} \S4method{plotTree}{dbartsSampler} \S4method{predictForests}{dbartsSampler} \S4method{predict}{dbartsSampler} \S4method{printTrees}{dbartsSampler} \S4method{run}{dbartsSampler} \S4method{sampleLeafParametersFromPrior}{dbartsSampler} \S4method{sampleNodeParametersFromPrior}{dbartsSampler} \S4method{sampleTreesFromPrior}{dbartsSampler} \S4method{sampleVarianceForestFromPrior}{dbartsSampler} \S4method{setActiveRows}{dbartsSampler} \S4method{setCategoryOffset}{dbartsSampler} \S4method{setCategoryTestOffset}{dbartsSampler} \S4method{setControl}{dbartsSampler} \S4method{setCutPoints}{dbartsSampler} \S4method{setData}{dbartsSampler} \S4method{setForestBasis}{dbartsSampler} \S4method{setForestWeights}{dbartsSampler} \S4method{setForest}{dbartsSampler} \S4method{setLeafPrior}{dbartsSampler} \S4method{setModel}{dbartsSampler} \S4method{setOffset}{dbartsSampler} \S4method{setPredictor}{dbartsSampler} \S4method{setResponse}{dbartsSampler} \S4method{setSigma}{dbartsSampler} \S4method{setState}{dbartsSampler} \S4method{setTestOffset}{dbartsSampler} \S4method{setTestPredictorAndOffset}{dbartsSampler} \S4method{setTestPredictor}{dbartsSampler} \S4method{setTreePrior}{dbartsSampler} \S4method{setVarianceForest}{dbartsSampler} \S4method{setWeights}{dbartsSampler} \S4method{show}{dbartsSampler} \S4method{startThreads}{dbartsSampler} \S4method{stopThreads}{dbartsSampler} \S4method{storeState}{dbartsSampler}
Discrete Bayesian Additive Regression Trees Sampler SpecificationdbartsSpec
Validate A Composed Sampler By Simulation-Based CalibrationdbartsValidateComposition print.dbartsCompositionValidation
Extract the Predictor Matrix From a Samplerextract.dbartsSampler
Forest Specification for Multi-Forest Modelsforest
Guess Number of CoresguessNumCores
Interaction Constraints for BARTinteractions
Make Model Matrix from Data Framemakeind makeModelMatrixFromDataFrame makeTestModelMatrix
The Data of a dbartsData Objectmodel.frame.dbartsData nobs.dbartsData
Monotone Constraints for BARTmonotone
Drop Rows With A Missing Response, Keep Missing Predictorsna.keepPredictors
Partial Dependence Plots for BARTpd2bart pdbart plot.pd2bart plot.pdbart
Plot a Single Tree From a Fitted BART ModelplotTree plotTree.bart plotTree.bartHurdle plotTree.bartMultinomial plotTree.bartNegbin plotTree.bartOrdinal plotTree.dbartsSampler
Bayesian Additive Regression Trees with Random Effectsextract.rbart fitted.rbart nobs.rbart plot.rbart predict.rbart print.rbart rbart_vi residuals.rbart sigma.rbart
R-hat of One Quantity's Drawsrhat
Draw From The BART PriorsamplePriorPredictive
Sparse Unordered FactorsanyDuplicated.sparseFactor anyNA,sparseFactor-method as.character,sparseFactor-method as.data.frame.sparseFactor as.integer,sparseFactor-method as.vector,sparseFactor-method c,sparseFactor-method droplevels.sparseFactor duplicated.sparseFactor format.sparseFactor is.na,sparseFactor-method length,sparseFactor-method length<-,sparseFactor-method levels<-,sparseFactor-method na.omit.sparseFactor Ops,ANY,sparseFactor-method Ops,sparseFactor,ANY-method Ops,sparseFactor,sparseFactor-method rep,sparseFactor-method show,sparseFactor-method sparseFactor sparseFactor-class str.sparseFactor summary.sparseFactor unique.sparseFactor xtfrm,sparseFactor-method [,sparseFactor-method [<-,sparseFactor-method [[,sparseFactor-method [[<-,sparseFactor-method
Convergence Diagnostics for BART Fitsprint.summary.bart summary.bart
Survival Probability Draws from a Survival FitsurvivalProbabilities survivalProbabilities.bart survivalProbabilities.bartHurdle survivalProbabilities.bartMultinomial survivalProbabilities.bartNegbin survivalProbabilities.bartOrdinal
Jointly Update a Shared Predictor per Observation Across SamplersupdatePredictorPerObservationJointly
Variance Forest Specification for Heteroscedastic BARTformat.dbartsVarianceForest print.dbartsVarianceForest varianceForest
Crossvalidation For Bayesian Additive Regression Treesxbart