R/predict_betas.R

Defines functions predict_betas

Documented in predict_betas

predict_betas <- function(fit, 
                          Z_cont = matrix(0, nrow = 1, ncol = 1),
                          Z_cat =  matrix(0, nrow = 1, ncol = 1),
                          verbose = TRUE)
{
  p <- length(fit$x_mean)
  M <- length(fit$trees[[1]][[1]])
  
  tmp <- .predict_vcbart(tree_draws = fit$trees,
                         p = p, M = M,
                         tZ_cont = t(Z_cont), tZ_cat = t(Z_cat), verbose = verbose)
  out <- rescale_beta(tmp, fit$y_mean, fit$y_sd, fit$x_mean, fit$x_sd)
  return(out)
}

Try the VCBART package in your browser

Any scripts or data that you put into this service are public.

VCBART documentation built on April 21, 2026, 9:07 a.m.