# NOT RUN {
## Simulated data example illustrating
## how to call the sampler function.
## This is done internally within
## the setup of function bamlss().
d <- GAMart()
f <- num ~ s(x1, bs = "ps")
bf <- bamlss.frame(f, data = d, family = "gaussian")
## First, find starting values with optimizer.
opt <- with(bf, bfit(x, y, family))
## Sample with JAGS.
if(require("rjags")) {
samps <- with(bf, JAGS(x, y, family, start = opt$parameters))
plot(samps)
}
# }
Run the code above in your browser using DataLab