set.seed(1234)
data("simPoisson")
dat <- simPoisson[1:100, ]
mod1 <- spGLMstack(y ~ x1, data = dat, family = "poisson",
coords = as.matrix(dat[, c("s1", "s2")]), cor.fn = "matern",
params.list = list(phi = c(3, 5, 7), nu = c(0.5, 1.5),
boundary = c(0.5)),
n.samples = 100,
loopd.controls = list(method = "CV", CV.K = 10, nMC = 500),
verbose = TRUE)
# Recover posterior samples of scale parameters
mod1.1 <- recoverGLMscale(mod1)
# sample from the stacked posterior distribution
post_samps <- stackedSampler(mod1.1)
Run the code above in your browser using DataLab