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 and
data as described next.
Typically an object of the class "geodata" - a geoR data set.
If not provided the arguments coords and data must be provided instead.
The list may also contain an argument units.m as described
below. |
coords |
an n x 2 matrix, each row containing Euclidean
coordinates of the n data locations. By default it takes the
element coords of the argument geodata . |
data |
a vector with data values. By default it takes the
element data of the argument geodata . |
units.m |
n-dimensional vector of observation times for the data. By default (units.m = "default" ),
it takes geodata$units.m in case this exist and else a vector of 1's. |
model |
defines the model components. Either an object of
class likGLSM ; typically output from
likfit.glsm , or a list containing
the arguments :
|
mcmc.input |
input parameter for the MCMC algorithm. It can take an output from mcmc.control or
a list with elements as for the arguments in
mcmc.control . See documentation for
mcmc.control .ATTENTION: the argument S.scale is necessary while
all the others have default values. |
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 n x n.sim matrix with n.sim being the number of MCMC simulations. containing S_i. Each column corresponds to a conditional simulation of the conditional distribution of S_i at the data locations. |
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://www.daimi.au.dk/~olefc/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)