Package index
Overview
The package’s own page: what it fits, and a table pointing from the task at hand to the function that does it.
-
bartisan-package - bartisan: Generalized Bayesian Additive Regression Trees
Fitting a Model
bartisan() is the entry point and bcf() is its counterpart for a treatment effect. Everything else in this section changes what either one fits: the likelihood, the settings the sampler runs under, and the one term that gives a predictor a coefficient of its own.
-
bartisan() - Fit a generalized Bayesian additive regression trees (BART) model
-
negbin()ordinal()multinomial()dpm_aft()dpm()weibull_aft()loglogistic_aft()lognormal_aft()ph()gaussian_ls()Gamma_ls()zi_poisson()zi_negbin()Beta()ordbeta()tweedie() - Response families for generalized BART
-
custom_family() - Fit a model to a likelihood written in R
-
bartisan_control() - Sampler and prior settings for
bartisan() -
bcf() - Bayesian causal forests
-
vc() - Give a predictor a varying coefficient
Predictions and Effects
What the fitted model says about units, real or counterfactual. Every quantity here is computed from the posterior draws, so the summaries carry credible intervals rather than standard errors, and predict() hands back the draws themselves. Calling plot() on a fit draws a partial dependence plot, and that method is documented on the last page in this section.
-
predict(<bartisan_fit>) - Predictions from a generalized BART model
-
estimate_effect()print(<bartisan_effect>)plot(<bartisan_effect>) - Causal effects from a fitted model
-
formula(<bartisan_fit>)terms(<bartisan_fit>)model.frame(<bartisan_fit>)nobs(<bartisan_fit>)family(<bartisan_fit>)get_predict(<bartisan_fit>)get_group_names(<bartisan_fit>)get_coef(<bartisan_fit>)set_coef(<bartisan_fit>)get_vcov(<bartisan_fit>)get_data(<bartisan_fit>) - Counterfactual estimands with marginaleffects
-
partial_dependence()print(<bartisan_partial>)plot(<bartisan_partial>)plot(<bartisan_fit>) - Partial dependence on one or two predictors
Describing a Fitted Model
A forest has no coefficient table, so what takes its place is the printed summary, how the splitting rules were spent, and what the parts of the model that do have parameters were drawn to be. The last page holds the print and plot methods a bcf() fit adds on top of these.
-
print(<bartisan_fit>)summary(<bartisan_fit>)print(<summary.bartisan_fit>) - Summarize a generalized BART model
-
variable_importance()plot(<bartisan_importance>) - How often each predictor is used
-
coef(<bartisan_fit>) - Varying coefficients
-
ranef(<bartisan_fit>) - Group intercepts from a random-effect term
-
error_density()plot(<bartisan_error_density>) - Error distribution of a Dirichlet process mixture fit
-
print(<bcf_fit>)plot(<bcf_fit>) - Methods for Bayesian causal forest fits
Checking Convergence and Fit
Whether the sampler explored the posterior, and whether the model describes the data, which are worth settling before anything above is read off a fit. The second page collects the methods that rstantools, loo, bayesplot, posterior and performance call on a fit, along with the stats methods that report the same quantities, so posterior predictive draws, cross-validation, the prior the fit was given, and the fit statistics are all on it.
-
diagnose() - Check whether a fit converged and mixed
-
posterior_predict(<bartisan_fit>)posterior_epred(<bartisan_fit>)posterior_linpred(<bartisan_fit>)log_lik(<bartisan_fit>)simulate(<bartisan_fit>)fitted(<bartisan_fit>)residuals(<bartisan_fit>)weights(<bartisan_fit>)sigma(<bartisan_fit>)prior_summary(<bartisan_fit>)print(<bartisan_prior_summary>)loo(<bartisan_fit>)waic(<bartisan_fit>)kfold(<bartisan_fit>)pp_check(<bartisan_fit>)as_draws(<bartisan_fit>)r2_posterior(<bartisan_fit>)r2(<bartisan_fit>)model_performance(<bartisan_fit>) - Interfaces to other packages
-
rhc - Right heart catheterization in critically ill patients