- formula
A formula for the covariate part of the model using the syntax of the lm()
function. Offsets can be included here using the offset() function. The response
and each covariate should be vectors of length (KN)*1, where K is the number of
spatial units and N is the number of time periods. Each vector should be ordered
so that the first K data points are the set of all K spatial locations at time 1,
the next K are the set of spatial locations for time 2 and so on. The response
must NOT contain missing (NA) values.
- family
One of either "binomial", "gaussian", or "poisson", which respectively specify a
binomial likelihood model with a logistic link function, a Gaussian likelihood
model with an identity link function, or a Poisson likelihood model with a log
link function.
- data
An optional data.frame containing the variables in the formula.
- trials
A vector the same length and in the same order as the response containing the
total number of trials for each area and time period. Only used if family="binomial".
- W
A non-negative K by K neighbourhood matrix (where K is the number of spatial units).
Typically a binary specification is used, where the jkth element equals one if
areas (j, k) are spatially close (e.g. share a common border) and is zero otherwise.
For this model the matrix must be binary.
- burnin
The number of MCMC samples to discard as the burn-in period.
- n.sample
The number of MCMC samples to generate.
- thin
The level of thinning to apply to the MCMC samples to reduce their temporal
autocorrelation. Defaults to 1 (no thinning).
- prior.mean.beta
A vector of prior means for the regression parameters beta (Gaussian priors are
assumed). Defaults to a vector of zeros.
- prior.var.beta
A vector of prior variances for the regression parameters beta (Gaussian priors
are assumed). Defaults to a vector with values 100,000.
- prior.nu2
The prior shape and scale in the form of c(shape, scale) for an Inverse-Gamma(shape, scale)
prior for nu2. Defaults to c(1, 0.01) and only used if family="Gaussian".
- prior.tau2
The prior shape and scale in the form of c(shape, scale) for an Inverse-Gamma(shape, scale)
prior for tau2. Defaults to c(1, 0.01).
- rho
The value in the interval [0, 1] that the spatial dependence parameter rho is
fixed at if it should not be estimated. If this arugment is NULL then rho is
estimated in the model. Setting rho=1, reduces the random effects prior to the
intrinsic CAR model but does require epsilon>0.
- epsilon
Diagonal ridge parameter to add to the random effects prior precision matrix, only
required when rho = 1, and the prior precision is improper. Defaults to 0.
- MALA
Logical, should the function use Metropolis adjusted Langevin algorithm (MALA)
updates (TRUE, default) or simple random walk (FALSE) updates for the regression
parameters. Not applicable if family="gaussian".
- verbose
Logical, should the function update the user on its progress.