| pdsoftbart {SoftBart} | R 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 |
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 theith draw of the partial dependence function for thejth level. -
levs: The list of levels used, each component corresponding to a variable. If the argumentlevswas supplied it is unchanged. Otherwise, the levels in levs are constructed using the argumentlevquants.