Laplace.sampling {PrevMap}R Documentation

Langevin-Hastings MCMC for conditional simulation

Description

This function simulates from the conditional distribution of a Gaussian random effect, given binomial or Poisson observations y.

Usage

Laplace.sampling(
  mu,
  Sigma,
  y,
  units.m,
  control.mcmc,
  ID.coords = NULL,
  messages = TRUE,
  plot.correlogram = TRUE,
  poisson.llik = FALSE
)

Arguments

mu

mean vector of the marginal distribution of the random effect.

Sigma

covariance matrix of the marginal distribution of the random effect.

y

vector of binomial/Poisson observations.

units.m

vector of binomial denominators, or offset if the Poisson model is used.

control.mcmc

output from control.mcmc.MCML.

ID.coords

vector of ID values for the unique set of spatial coordinates obtained from create.ID.coords. These must be provided if, for example, spatial random effects are defined at household level but some of the covariates are at individual level. Warning: the household coordinates must all be distinct otherwise see jitterDupCoords. Default is NULL.

messages

logical; if messages=TRUE then status messages are printed on the screen (or output device) while the function is running. Default is messages=TRUE.

plot.correlogram

logical; if plot.correlogram=TRUE the autocorrelation plot of the conditional simulations is displayed.

poisson.llik

logical; if poisson.llik=TRUE a Poisson model is used or, if poisson.llik=FALSE, a binomial model is used.

Details

Binomial model. Conditionally on the random effect SS, the data y follow a binomial distribution with probability pp and binomial denominators units.m. The logistic link function is used for the linear predictor, which assumes the form

log(p/(1p))=S.\log(p/(1-p))=S.

Poisson model. Conditionally on the random effect SS, the data y follow a Poisson distribution with mean mλm\lambda, where mm is an offset set through the argument units.m. The log link function is used for the linear predictor, which assumes the form

log(λ)=S.\log(\lambda)=S.

The random effect SS has a multivariate Gaussian distribution with mean mu and covariance matrix Sigma.

Laplace sampling. This function generates samples from the distribution of SS given the data y. Specifically a Langevin-Hastings algorithm is used to update S~=Σ~1/2(Ss~)\tilde{S} = \tilde{\Sigma}^{-1/2}(S-\tilde{s}) where Σ~\tilde{\Sigma} and s~\tilde{s} are the inverse of the negative Hessian and the mode of the distribution of SS given y, respectively. At each iteration a new value s~prop\tilde{s}_{prop} for S~\tilde{S} is proposed from a multivariate Gaussian distribution with mean

s~curr+(h/2)logf(S~y),\tilde{s}_{curr}+(h/2)\nabla \log f(\tilde{S} | y),

where s~curr\tilde{s}_{curr} is the current value for S~\tilde{S}, hh is a tuning parameter and logf(S~y)\nabla \log f(\tilde{S} | y) is the the gradient of the log-density of the distribution of S~\tilde{S} given y. The tuning parameter hh is updated according to the following adaptive scheme: the value of hh at the ii-th iteration, say hih_{i}, is given by

hi=hi1+c1ic2(αi0.547),h_{i} = h_{i-1}+c_{1}i^{-c_{2}}(\alpha_{i}-0.547),

where c1>0c_{1} > 0 and 0<c2<10 < c_{2} < 1 are pre-defined constants, and αi\alpha_{i} is the acceptance rate at the ii-th iteration (0.5470.547 is the optimal acceptance rate for a multivariate standard Gaussian distribution). The starting value for hh, and the values for c1c_{1} and c2c_{2} can be set through the function control.mcmc.MCML.

Random effects at household-level. When the data consist of two nested levels, such as households and individuals within households, the argument ID.coords must be used to define the household IDs for each individual. Let ii and jj denote the ii-th household and the jj-th person within that household; the logistic link function then assumes the form

log(pij/(1pij))=μij+Si\log(p_{ij}/(1-p_{ij}))=\mu_{ij}+S_{i}

where the random effects SiS_{i} are now defined at household level and have mean zero. Warning: this modelling option is available only for the binomial model.

Value

A list with the following components

samples: a matrix, each row of which corresponds to a sample from the predictive distribution.

h: vector of the values of the tuning parameter at each iteration of the Langevin-Hastings MCMC algorithm.

Author(s)

Emanuele Giorgi e.giorgi@lancaster.ac.uk

Peter J. Diggle p.diggle@lancaster.ac.uk

See Also

control.mcmc.MCML, create.ID.coords.


[Package PrevMap version 1.5.4 Index]