if (FALSE) ## 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, opt_bfit(x, y, family))
## Sample with JAGS.
if(require("rjags")) {
samps <- with(bf, sam_JAGS(x, y, family, start = opt$parameters))
plot(samps)
b <- bamlss(f, data = d, family = "gaussian", sampler = sam_JAGS)
plot(b)
}
Run the code above in your browser using DataLab