if (FALSE) {
data(rhizoctonia)
### Create prediction grid
predgrid <- mkpredgrid2d(rhizoctonia[c("Xcoord", "Ycoord")],
par.x = 100, chull = TRUE, exf = 1.2)
### Combine observed and prediction locations
rhizdata <- stackdata(rhizoctonia, predgrid$grid)
##'
### Define the model
corrf <- "spherical"
family <- "binomial.probit"
kappa <- 0
ssqdf <- 1
ssqsc <- 1
betm0 <- 0
betQ0 <- .01
phiprior <- c(100, 1, 1000, 100) # U(100, 200)
phisc <- 3
omgprior <- c(2, 1, 1, 0) # Exp(mean = 2)
omgsc <- .1
##'
### MCMC sizes
Nout <- 100
Nthin <- 1
Nbi <- 0
### Trial run
emt <- mcsglmm(Infected ~ 1, family, rhizdata, weights = Total,
atsample = ~ Xcoord + Ycoord,
Nout = Nout, Nthin = Nthin, Nbi = Nbi,
betm0 = betm0, betQ0 = betQ0, ssqdf = ssqdf, ssqsc = ssqsc,
corrpriors = list(phi = phiprior, omg = omgprior),
corrfcn = corrf, kappa = kappa,
corrtuning = list(phi = phisc, omg = omgsc, kappa = 0),
dispersion = 1, test = 10)
### Full run
emc <- update(emt, test = FALSE)
emcmc <- mcmcmake(emc)
summary(emcmc[, c("phi", "omg", "beta", "ssq")])
plot(emcmc[, c("phi", "omg", "beta", "ssq")])
}
Run the code above in your browser using DataLab