| glsm.mcmc {geoRglm} | R Documentation |
This function performs conditional simulation (by MCMC) in a generalised linear spatial model for fixed parameters.
glsm.mcmc(geodata, coords = geodata$coords, data = geodata$data,
units.m = "default", model, mcmc.input, messages)
geodata |
a list containing elements |
coords |
an |
data |
a vector with data values. By default it takes the
element |
units.m |
|
model |
defines the model components. Either an object of
class
|
mcmc.input |
input parameter for the MCMC algorithm. It can take an output from |
messages |
logical. Indicates whether or not status messages are printed on the screen (or other output device) while the function is running. |
For simulating the conditional distribution of S given y, the Langevin-Hastings algorithm
with the parametrisation in Papaspilliopoulus, Roberts and Skold (2003)
is used. This algorithm is a Metropolis-Hastings algorithm, where the
proposal distribution uses gradient information from the
log-posterior distribution.
The proposal variance (called S.scale; see mcmc.control)
for the algorithm needs to be scaled
such that approximately 60 percent of the proposals are accepted. We
also recommend that the user to studies plots of the autocorrelations.
A list with the following components:
simulations |
an |
acc.rate |
matrix with acceptance rates from MCMC. Only returned when no prediction locations are given. |
model |
Information about the model parameters, link function and error distribution family used. |
geodata |
Information about the data. |
call |
the function call. |
Ole F. Christensen OleF.Christensen@agrsci.dk,
Paulo J. Ribeiro Jr. Paulo.Ribeiro@est.ufpr.br.
O. Papaspiliopoulus and G. O. Roberts and M. Skold (2003). Non-centered parameterizations for hierarchical models and data augmentation. Bayesian statistics 7 (eds. J. M. Bernardo, S. Bayarri, J. O. Berger, A. P. Dawid, D. Heckerman, A. F. M. Smith and M. West), Oxford University Press, 307-326.
Further information about geoRglm can be found at:
http://gbi.agrsci.dk/~ofch/geoRglm.
binom.krige for prediction with fixed parameters in the
Binomial-normal model, pois.krige for prediction with fixed parameters in the
Poisson normal model.
if(!exists(".Random.seed", envir=.GlobalEnv, inherits = FALSE)) set.seed(1234)
data(b50)
test <- glsm.mcmc(b50, model = list(family="binomial",
cov.pars = c(1,1), beta = c(1,0), trend =~ rnorm(50),
cov.model="spherical", nugget=0.3),
mcmc.input = mcmc.control(S.scale = 0.2, thin = 1))
## visulalising the MCMC output using the coda package
test.coda <- create.mcmc.coda(test, mcmc.input = list(thin = 1))
## Not run:
plot(test.coda)
autocorr.plot(test.coda)
## End(Not run)