Laplace.sampling.lr {PrevMap} | R Documentation |
Langevin-Hastings MCMC for conditional simulation (low-rank approximation)
Description
This function simulates from the conditional distribution of the random effects of binomial and Poisson models.
Usage
Laplace.sampling.lr(
mu,
sigma2,
K,
y,
units.m,
control.mcmc,
messages = TRUE,
plot.correlogram = TRUE,
poisson.llik = FALSE
)
Arguments
mu |
mean vector of the linear predictor. |
sigma2 |
variance of the random effect. |
K |
random effect design matrix, or kernel matrix for the low-rank approximation. |
y |
vector of binomial/Poisson observations. |
units.m |
vector of binomial denominators, or offset if the Poisson model is used. |
control.mcmc |
output from |
messages |
logical; if |
plot.correlogram |
logical; if |
poisson.llik |
logical; if |
Details
Binomial model. Conditionally on , the data
y
follow a binomial distribution with probability and binomial denominators
units.m
. Let denote the random effects design matrix; a logistic link function is used, thus the linear predictor assumes the form
where is the mean vector component defined through
mu
.
Poisson model. Conditionally on , the data
y
follow a Poisson distribution with mean , where
is an offset set through the argument
units.m
. Let denote the random effects design matrix; a log link function is used, thus the linear predictor assumes the form
where is the mean vector component defined through
mu
.
The random effect has iid components distributed as zero-mean Gaussian variables with variance
sigma2
.
Laplace sampling. This function generates samples from the distribution of given the data
y
. Specifically, a Langevin-Hastings algorithm is used to update where
and
are the inverse of the negative Hessian and the mode of the distribution of
given
y
, respectively. At each iteration a new value for
is proposed from a multivariate Gaussian distribution with mean
where is the current value for
,
is a tuning parameter and
is the the gradient of the log-density of the distribution of
given
y
. The tuning parameter is updated according to the following adaptive scheme: the value of
at the
-th iteration, say
, is given by
where and
are pre-defined constants, and
is the acceptance rate at the
-th iteration (
is the optimal acceptance rate for a multivariate standard Gaussian distribution).
The starting value for
, and the values for
and
can be set through the function
control.mcmc.MCML
.
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