# NOT RUN {
## Generate some data.
d <- GAMart()
## Model formula.
f <- list(
num ~ s(x1) + s(x2) + s(x3) + te(lon,lat),
sigma ~ s(x1) + s(x2) + s(x3) + te(lon,lat)
)
## Estimate model.
b <- bamlss(f, data = d)
## Fitted values returned from optimizer.
f1 <- fitted(b, model = "mu", samples = FALSE)
## Fitted values returned from sampler.
f2 <- fitted(b, model = "mu", samples = TRUE, FUN = mean)
plot(f1, f2)
# }
Run the code above in your browser using DataLab