Skip to contents

Supervised learning

High-level functionality for training supervised Bayesian tree ensembles (BART, XBART)

bart()
Run BART for Supervised Learning
predict(<bartmodel>)
Predict From a BART Model
print(<bartmodel>)
Summarize a BART Model
summary(<bartmodel>)
Summarize the BART model fit and sampled terms.
plot(<bartmodel>)
Plot BART Model Fit.
extract_parameter(<bartmodel>)
Extract BART Parameter Samples.
getRandomEffectSamples(<bartmodel>)
Extract Random Effects Samples
compute_bart_posterior_interval()
Compute BART Posterior Credible Intervals
compute_contrast_bart_model()
Compute Contrast for BART Model
sample_bart_posterior_predictive()
Sample BART Posterior Predictive

Causal inference

High-level functionality for estimating causal effects using Bayesian tree ensembles (BCF, XBCF)

bcf()
Run BCF for Causal Effect Estimation
predict(<bcfmodel>)
Predict From BCF Model
print(<bcfmodel>)
Print Summary of BCF Model
summary(<bcfmodel>)
Summarize BCF Model
plot(<bcfmodel>)
Plot BCF Model
extract_parameter(<bcfmodel>)
Extract BCF Parameter Samples
getRandomEffectSamples(<bcfmodel>)
Extract Random Effect Samples from BCF Model
compute_bcf_posterior_interval()
Compute BCF Posterior Credible Intervals
compute_contrast_bcf_model()
Compute Contrast for BCF Model
sample_bcf_posterior_predictive()
Sample BCF Posterior Predictive

Low-level functionality

Serialization

Classes and functions for converting sampling artifacts to JSON and saving to disk

CppJson
JSON C++ Object Wrapper
createCppJson()
Create CppJson Object
createCppJsonFile()
Create CppJson Object from File
createCppJsonString()
Create CppJson Object from String
loadForestContainerJson()
Load Forest Samples from JSON
loadForestContainerCombinedJson()
Combine JSON Model Objects into ForestSamples
loadForestContainerCombinedJsonString()
Combine JSON Strings into ForestSamples
loadVectorJson()
Load Vector from JSON
loadScalarJson()
Load Scalar from JSON
loadRandomEffectSamplesJson()
Load Random Effect Samples from JSON
loadRandomEffectSamplesCombinedJson()
Combine JSON Model Objects into RandomEffectSamples
loadRandomEffectSamplesCombinedJsonString()
Combine JSON Strings into RandomEffectSamples
saveBARTModelToJson()
Convert BART Model to JSON
saveBARTModelToJsonFile()
Save BART Model to JSON File
saveBARTModelToJsonString()
Convert BART Model to JSON String
createBARTModelFromJson()
Convert JSON to BART Model
createBARTModelFromJsonFile()
Convert JSON File to BART Model
createBARTModelFromJsonString()
Convert JSON String to BART Model
createBARTModelFromCombinedJson()
Convert JSON List to Single BART Model
createBARTModelFromCombinedJsonString()
Convert JSON String List to Single BART Model
saveBCFModelToJson()
Convert BCF Model to JSON
saveBCFModelToJsonFile()
Save BCF Model to JSON File
saveBCFModelToJsonString()
Convert BCF Model to JSON String
createBCFModelFromJsonFile()
Convert JSON File to BCF Model
createBCFModelFromJsonString()
Convert JSON String to BCF Model
createBCFModelFromJson()
Convert JSON to BCF Model
createBCFModelFromCombinedJson()
Convert JSON List to BCF Model
createBCFModelFromCombinedJsonString()
Convert JSON String List to BCF Model

Data

Classes and functions for preparing data for sampling algorithms

ForestDataset
Forest Dataset C++ Wrapper
createForestDataset()
Create ForestDataset Object
Outcome
Outcome Data C++ Wrapper
createOutcome()
Create Outcome Object
RandomEffectsDataset
Random Effects Dataset C++ Wrapper
createRandomEffectsDataset()
Create RandomEffectsDataset Object
preprocessTrainData()
Preprocess Covariates for Model Training
preprocessPredictionData()
Preprocess Covariates for Model Prediction
convertPreprocessorToJson()
Convert Covariate Preprocessor to CppJson
savePreprocessorToJsonString()
Convert Covariate Preprocessor to JSON String
createPreprocessorFromJson()
Reload Covariate Preprocessor from JSON String
createPreprocessorFromJsonString()
Reload Covariate Preprocessor from JSON String

Forest

Classes and functions for constructing and persisting forests

Forest
Forest C++ Wrapper
createForest()
Create Forest Object
ForestModel
Forest Model C++ Wrapper
createForestModel()
Create ForestModel Object
ForestSamples
Forest Container C++ Wrapper
createForestSamples()
Create ForestSamples Object
ForestModelConfig
Forest Model Configuration Object
createForestModelConfig()
Create ForestModelConfig Object
GlobalModelConfig
Global Model Configuration Object
createGlobalModelConfig()
Create GlobalModelConfig Object
CppRNG
Random Number Generator C++ Wrapper
createCppRNG()
Create CppRNG Object
calibrateInverseGammaErrorVariance()
Calibrate Inverse Gamma Prior
computeForestMaxLeafIndex()
Query Forest Max Leaf Index
computeForestLeafIndices()
Query Forest Leaf Indices
computeForestLeafVariances()
Query Forest Leaf Scale Parameters
resetActiveForest()
Reset Active Forest
resetForestModel()
Reset Forest Model

Random Effects

Classes and functions for constructing and persisting random effects terms

RandomEffectSamples
Random Effect Container C++ Wrapper
createRandomEffectSamples()
Create RandomEffectSamples Object
RandomEffectsModel
Random Effects Model C++ Wrapper
createRandomEffectsModel()
Create RandomEffectsModel Object
RandomEffectsTracker
Random Effects Tracker C++ Wrapper
createRandomEffectsTracker()
Create RandomEffectsTracker Object
getRandomEffectSamples()
Extract Random Effect Samples Generic Function
sampleGlobalErrorVarianceOneIteration()
Sample Global Error Variance
sampleLeafVarianceOneIteration()
Sample Leaf Scale
resetRandomEffectsModel()
Reset RandomEffectsModel Object
resetRandomEffectsTracker()
Reset RandomEffectsTracker Object
rootResetRandomEffectsModel()
Reset RandomEffectsModel Object to Default State
rootResetRandomEffectsTracker()
Reset RandomEffectsTracker Object to Default State

Utilities

Miscellaneous “utility” classes and functions

sample_without_replacement()
Sample Without Replacement
extract_parameter()
Extract Parameter Samples Generic Function

Package info

High-level package details

stochtree stochtree-package
stochtree: Stochastic Tree Ensembles (XBART and BART) for Supervised Learning and Causal Inference