stochtree0.1.1 package

Stochastic Tree Ensembles (XBART and BART) for Supervised Learning and Causal Inference

bart

Run the BART algorithm for supervised learning.

bcf

Run the Bayesian Causal Forest (BCF) algorithm for regularized causal ...

calibrateInverseGammaErrorVariance

Calibrate the scale parameter on an inverse gamma prior for the global...

computeForestLeafIndices

Compute vector of forest leaf indices

computeForestLeafVariances

Compute vector of forest leaf scale parameters

computeForestMaxLeafIndex

Compute and return the largest possible leaf index computable by `comp...

convertPreprocessorToJson

Convert the persistent aspects of a covariate preprocessor to (in-memo...

CppJson

Class that stores draws from an random ensemble of decision trees

CppRNG

Class that wraps a C++ random number generator (for reproducibility)

createBARTModelFromCombinedJson

Convert a list of (in-memory) JSON representations of a BART model to ...

createBARTModelFromCombinedJsonString

Convert a list of (in-memory) JSON strings that represent BART models ...

createBARTModelFromJson

Convert an (in-memory) JSON representation of a BART model to a BART m...

createBARTModelFromJsonFile

Convert a JSON file containing sample information on a trained BART mo...

createBARTModelFromJsonString

Convert a JSON string containing sample information on a trained BART ...

createBCFModelFromCombinedJson

Convert a list of (in-memory) JSON strings that represent BCF models t...

createBCFModelFromCombinedJsonString

Convert a list of (in-memory) JSON strings that represent BCF models t...

createBCFModelFromJson

Convert an (in-memory) JSON representation of a BCF model to a BCF mod...

createBCFModelFromJsonFile

Convert a JSON file containing sample information on a trained BCF mod...

createBCFModelFromJsonString

Convert a JSON string containing sample information on a trained BCF m...

createCppJson

Create a new (empty) C++ Json object

createCppJsonFile

Create a C++ Json object from a Json file

createCppJsonString

Create a C++ Json object from a Json string

createCppRNG

Create an R class that wraps a C++ random number generator

createForest

Create a forest

createForestDataset

Create a forest dataset object

createForestModel

Create a forest model object

createForestModelConfig

Create a forest model config object

createForestSamples

Create a container of forest samples

createGlobalModelConfig

Create a global model config object

createOutcome

Create an outcome object

createPreprocessorFromJson

Reload a covariate preprocessor object from a JSON string containing a...

createPreprocessorFromJsonString

Reload a covariate preprocessor object from a JSON string containing a...

createRandomEffectSamples

Create a RandomEffectSamples object

createRandomEffectsDataset

Create a random effects dataset object

createRandomEffectsModel

Create a RandomEffectsModel object

createRandomEffectsTracker

Create a RandomEffectsTracker object

Forest

Class that stores a single ensemble of decision trees (often treated a...

ForestDataset

Dataset used to sample a forest

ForestModel

Class that defines and samples a forest model

ForestModelConfig

Object used to get / set parameters and other model configuration opti...

ForestSamples

Class that stores draws from an random ensemble of decision trees

getRandomEffectSamples.bartmodel

Extract raw sample values for each of the random effect parameter term...

getRandomEffectSamples.bcfmodel

Extract raw sample values for each of the random effect parameter term...

getRandomEffectSamples

Generic function for extracting random effect samples from a model obj...

GlobalModelConfig

Object used to get / set global parameters and other global model conf...

loadForestContainerCombinedJson

Combine multiple JSON model objects containing forests (with the same ...

loadForestContainerCombinedJsonString

Combine multiple JSON strings representing model objects containing fo...

loadForestContainerJson

Load a container of forest samples from json

loadRandomEffectSamplesCombinedJson

Combine multiple JSON model objects containing random effects (with th...

loadRandomEffectSamplesCombinedJsonString

Combine multiple JSON strings representing model objects containing ra...

loadRandomEffectSamplesJson

Load a container of random effect samples from json

loadScalarJson

Load a scalar from json

loadVectorJson

Load a vector from json

Outcome

Outcome / partial residual used to sample an additive model.

predict.bartmodel

Predict from a sampled BART model on new data

predict.bcfmodel

Predict from a sampled BCF model on new data

preprocessPredictionData

Preprocess covariates. DataFrames will be preprocessed based on their ...

preprocessTrainData

Preprocess covariates. DataFrames will be preprocessed based on their ...

RandomEffectSamples

Class that wraps the "persistent" aspects of a C++ random effects mode...

RandomEffectsDataset

Dataset used to sample a random effects model

RandomEffectsModel

The core "model" class for sampling random effects.

RandomEffectsTracker

Class that defines a "tracker" for random effects models, most notably...

resetActiveForest

Reset an active forest, either from a specific forest in a `ForestCont...

resetForestModel

Re-initialize a forest model (tracking data structures) from a specifi...

resetRandomEffectsModel

Reset a RandomEffectsModel object based on the parameters indexed by...

resetRandomEffectsTracker

Reset a RandomEffectsTracker object based on the parameters indexed ...

rootResetRandomEffectsModel

Reset a RandomEffectsModel object to its "default" state

rootResetRandomEffectsTracker

Reset a RandomEffectsTracker object to its "default" state

sampleGlobalErrorVarianceOneIteration

Sample one iteration of the (inverse gamma) global variance model

sampleLeafVarianceOneIteration

Sample one iteration of the leaf parameter variance model (only for un...

saveBARTModelToJson

Convert the persistent aspects of a BART model to (in-memory) JSON

saveBARTModelToJsonFile

Convert the persistent aspects of a BART model to (in-memory) JSON and...

saveBARTModelToJsonString

Convert the persistent aspects of a BART model to (in-memory) JSON str...

saveBCFModelToJson

Convert the persistent aspects of a BCF model to (in-memory) JSON

saveBCFModelToJsonFile

Convert the persistent aspects of a BCF model to (in-memory) JSON and ...

saveBCFModelToJsonString

Convert the persistent aspects of a BCF model to (in-memory) JSON stri...

savePreprocessorToJsonString

Convert the persistent aspects of a covariate preprocessor to (in-memo...

stochtree-package

stochtree: Stochastic Tree Ensembles (XBART and BART) for Supervised L...

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.

  • Maintainer: Drew Herren
  • License: MIT + file LICENSE
  • Last published: 2025-02-08