# NOT RUN {
#Example from BART package (McCulloch et al. 2019)
set.seed(99)
n=100
x = sort(-2+4*runif(n))
X=matrix(x,ncol=1)
f = function(x) {return((1/2)*x^3)}
FL = function(x) {return(exp(x)/(1+exp(x)))}
pv = FL(f(x))
y = rbinom(n,1,pv)
trained_probit_bbma <- probit_bartBMA(x.train = X,y.train = y)
np=100
xp=-2+4*(1:np)/np
Xp=matrix(xp,ncol=1)
predict_probit_bartBMA(trained_probit_bbma,Xp)
# }
Run the code above in your browser using DataLab