## Not run: ------------------------------------
# ## Simulate data.
# d <- GAMart()
#
# ## Model formula.
# f <- list(
# num ~ s(x1) + s(x2) + s(x3),
# sigma ~ s(x1) + s(x2) + s(x3)
# )
#
# ## Estimate model.
# b <- bamlss(f, data = d)
#
# ## Extract coefficients based on MCMC samples.
# coef(b)
#
# ## Now only the mean.
# coef(b, FUN = mean)
#
# ## As list without the full names.
# coef(b, FUN = mean, list = TRUE, full.names = FALSE)
#
# ## Coefficients only for "mu".
# coef(b, model = "mu")
#
# ## And "s(x2)".
# coef(b, model = "mu", term = "s(x2)")
#
# ## With optimizer parameters.
# coef(b, model = "mu", term = "s(x2)", parameters = TRUE)
#
# ## Only parameteric part.
# coef(b, sterms = FALSE, hyper.parameters = FALSE)
#
# ## For sigma.
# coef(b, model = "sigma", sterms = FALSE,
# hyper.parameters = FALSE)
#
# ## 95 perc. credible interval based on samples.
# confint(b)
## ---------------------------------------------
Run the code above in your browser using DataCamp Workspace