# NOT RUN {
## simulate data (Scenario C.M.1. in Luo and Daniels (2021))
set.seed(123)
data = mixone(100, 10, 1, FALSE)
## run wbart() function
res = wbart(data$X, data$Y, ntree=10, nskip=100, ndpost=100)
## test pwbart() function
x.test = mixone(5, 10, 1, FALSE)$X
pred = pwbart(x.test, res$treedraws, res$rm.const, mu=mean(data$Y))
# }
Run the code above in your browser using DataLab