data(FBC07)
Y.2 <- FBC07[1:100,"Y.2"]
coords <- as.matrix(FBC07[1:100,c("coord.X", "coord.Y")])
##Fit some model with ggt.sp.
K.prior <- prior(dist="IG", shape=2, scale=5)
Psi.prior <- prior(dist="IG", shape=2, scale=5)
phi.prior <- prior(dist="LOGUNIF", a=0.06, b=3)
var.update.control <-
list("K"=list(starting=5, tuning=0.5, prior=K.prior),
"Psi"=list(starting=5, tuning=0.5, prior=Psi.prior),
"phi"=list(starting=0.1, tuning=0.5, prior=phi.prior)
)
beta.control <- list(update="GIBBS", prior=prior(dist="FLAT"))
run.control <- list("n.samples"=1000, "sp.effects"=TRUE)
Fit <-
ggt.sp(formula=Y.2~1, run.control=run.control,
coords=coords, var.update.control=var.update.control,
beta.update.control=beta.control,
cov.model="exponential")
##Now with the ggt.sp object, Fit, calculate the DIC
##for both the unmarginalized and marginalized models.
##The likelihoods for these models are given by equation 6 and 7
##within the vignette.
DIC <- sp.DIC(Fit)
print(DIC)Run the code above in your browser using DataLab