hebart: Hierarchical Embedded Bayesian Additive Regression Trees

View source: R/hebart.R

hebartR Documentation

Hierarchical Embedded Bayesian Additive Regression Trees

Description

This function runs a BCART model and returns the tree and other results obtained in the last iteration of the MCMC

Usage

hebart(
  formula,
  dataset,
  iter = 100,
  group_variable = "group",
  pars,
  min_u = 0,
  max_u = 20,
  prior_k1 = TRUE,
  num.trees = 5,
  sample_k1 = TRUE,
  burn_in = 50,
  alpha_grow = 0.9,
  beta_grow = 0.5,
  ...
)

Arguments

formula

The model formula

dataset

The data to be used in the modeling

iter

The number of MCMC iterations

group_variable

The grouping variable

pars

The hyperparameters set/list

min_u

Integer representing the lower interval of the Uniform distribution used to sample k1

max_u

Integer representing the upper interval of the

prior_k1

Logical to decide whether or not use a prior for k1 Uniform distribution used to sample k1

num.trees

The number of trees

sample_k1

Logical to decide whether to sample_k1 or not

burn_in

The number of burn-in iterations

alpha_grow

Number between 0 and 1 used in the growing probability calculation

beta_grow

Number between 0 and 1 used in the growing probability calculation

...

Other parameters

Details

Priors used ———————————————————- y_ij ~ Normal(m_j, tau^-1) tau ~ Gamma(alpha, beta) mu ~ Normal(0, tau_mu = k2*tau^-1) mu_j ~ Normal(mu, k1*tau^-1) ———————————————————————-

Value

A list containing: the sampled values of tau and k1, the final trees

Author(s)

Bruna Wundervald, brunadaviesw@gmail.com.


brunaw/hebart documentation built on June 1, 2022, 8:35 p.m.