Learn R Programming

bartBMA

The goal of bartBMA is to provide an implementation of Bayesian Additive Regression Trees Using Bayesian Model Averaging (BART-BMA) (Hernandez et al. 2018)

Hernández, B., Raftery, A. E., Pennington, S. R., & Parnell, A. C. (2018). Bayesian additive regression trees using Bayesian model averaging. Statistics and computing, 28(4), 869-890.

Installation

library(devtools)
install_github("bartBMA")

Example

library(bartBMA)
## basic example code

N <- 100
p<- 100
set.seed(100)

epsilon <- rnorm(N)
xcov <- matrix(runif(N*p), nrow=N)
y <- sin(pi*xcov[,1]*xcov[,2]) + 20*(xcov[,3]-0.5)^2+10*xcov[,4]+5*xcov[,5]+epsilon

epsilontest <- rnorm(N)
xcovtest <- matrix(runif(N*p), nrow=N)
ytest <- sin(pi*xcovtest[,1]*xcovtest[,2]) + 20*(xcovtest[,3]-0.5)^2+10*xcovtest[,4]+5*xcovtest[,5]+epsilontest


bart_bma_example <- bartBMA(x.train = xcov,y.train=y,x.test=xcovtest, 
                    zero_split = 1, only_max_num_trees = 1,split_rule_node = 0)

Copy Link

Version

Install

install.packages('bartBMA')

Monthly Downloads

32

Version

1.0

License

GPL (>= 2)

Maintainer

Belinda Hernandez

Last Published

March 13th, 2020

Functions in bartBMA (1.0)

pred_means_bbma_GS

Predictions for bart-bma output obtained from a Gibbs sampler
predict_bartBMA

Predictions for a new dataset using an existing bartbma object
predict_probit_bartBMA

Predictions for a new dataset using an existing probit_bartBMA object
preds_bbma_lin_alg

Predictions for bart-bma output obtained from the posterior probability weighted averaged of the posterior means for each model
probit_bartBMA

Probit BART_BMA for classification of a binary variable
pred_ints_exact_par

Prediction intervals for bart-bma output obtained using linear algebra to obtain means and variances, and using bisection to find the quantiles of the mixture of t distributions.
pred_means_bbma_new_initials_GS

Predictions for bart-bma output obtained from a Gibbs sampler
varImpScores

Variable importances as defined by Hernandez et al. (2018)
varIncProb

Variable inclusion probabilities as defined by Linero (2018)
bartBMA_with_ITEs_exact_par

Prediction intervals for bart-bma output obtained using linear algebra to obtain means and variances, and using bisection to find the quantiles of the mixture of t distributions.
pred_ints_exact

Prediction intervals for bart-bma output obtained using linear algebra to obtain means and variances, and using bisection to find the quantiles of the mixture of t distributions.
ITEs_CATT_bartBMA_exact_par

Estimate ITEs, CATE, CATT, CATNT and obtain credible intervals (in-sample or out-of-sample).
pred_intervals_new_initials_GS

Prediction intervals for bart-bma output
ITEs_bartBMA

ITE Predictions (in-sample) using bartBMA and the method described by Hill (2011)
pred_expectation_intervals_bbma_GS

Prediction intervals for bart-bma output
ITEs_bartBMA_exact_par

Estimate ITEs and obtain credible intervals (in-sample or out-of-sample).
pred_intervals_bbma_GS

Prediction intervals for bart-bma output
bartBMA

Bayesian Additive Regression Trees Using Bayesian Model Averaging (BART-BMA)