bart: Create a model component object for a BART (Bayesian Additive...

View source: R/mc_bart.R

bartR Documentation

Create a model component object for a BART (Bayesian Additive Regression Trees) component in the linear predictor

Description

This function is intended to be used on the right hand side of the formula argument to create_sampler or generate_data. It creates a BART term in the model's linear predictor. To use this model component one needs to have R package dbarts installed.

Usage

bart(formula, X = NULL, name = "", debug = FALSE, ...)

Arguments

formula

a formula specifying the predictors to be used in the BART model component. Variable names are looked up in the data frame passed as data argument to create_sampler or generate_data, or in environment(formula).

X

a design matrix can be specified directly, as an alternative to the creation of one based on formula. If X is specified formula is ignored.

name

the name of the model component. This name is used in the output of the MCMC simulation function MCMCsim. By default the name will be 'bart' with the number of the model term attached.

debug

if TRUE a breakpoint is set at the beginning of the posterior draw function associated with this model component. Mainly intended for developers.

...

parameters passed to dbarts.

Value

an object with precomputed quantities and functions for sampling from prior or conditional posterior distributions for this model component. Intended for internal use by other package functions.

References

H.A. Chipman, E.I. Georgea and R.E. McCulloch (2010). BART: Bayesian additive regression trees. The Annals of Applied Statistics 4(1), 266-298.


mcmcsae documentation built on Oct. 11, 2023, 1:06 a.m.