pdsoftbart: Partial dependence plots for SoftBart

View source: R/pdsoftbart.R

pdsoftbartR Documentation

Partial dependence plots for SoftBart

Description

Modified version of the pdbart function from the BayesTree package; largely supplanted by the softbart_regression and partial_dependence_regression functions. Runs softbart at test observations constructed so that a plot can be created displaying the effect of a single variable or pair of variables.

Usage

pdsoftbart(
  X,
  Y,
  xind = NULL,
  levs = NULL,
  levquants = c(0.05, (1:9)/10, 0.95),
  pl = FALSE,
  plquants = c(0.05, 0.95),
  ...
)

Arguments

X

Training data covariates.

Y

Training data response.

xind

Variables to create the partial dependence plots for.

levs

List of levels of the covariates to evaluate at.

levquants

Used if levs is not supplied; takes levs to be quantiles of associated predictors.

pl

Create a plot?

plquants

Quantiles for the partial dependence plot.

...

Additional arguments passed to softbart or plot.

Value

Returns a list with components given below.

  • fd: A matrix whose (i,j)th value is the ith draw of the partial dependence function for the jth level.

  • levs: The list of levels used, each component corresponding to a variable. If the argument levs was supplied it is unchanged. Otherwise, the levels in levs are constructed using the argument levquants.


SoftBart documentation built on June 8, 2025, 9:40 p.m.