icar_precision_from_adjacency: Generate an ICAR precision matrix based on an adjacency...

Description Usage Arguments Details Value

View source: R/model_functions.R

Description

Generate a precision matrix for the intrinsic correlated autoregressive (ICAR) model specification, a special case of the correlated autoregressive (CAR) class of Markov random field models. This precision matrix is usually denoted as "Q".

Usage

1
icar_precision_from_adjacency(W, scale_variance = TRUE)

Arguments

W

Adjacency matrix, with w_ij = w_ji = 1 if areal units i and j are neighbors, and zero otherwise. See function details for more information

scale_variance

[default TRUE] Should the precision matrix be rescaled so that the generalized variance is equal to 1? Setting to TRUE may help with prior specification.

Details

The precision matrix is fully specified by the adjacency weights, matrix W, defined as W = w_ij where w_ij is 1 if i and j are neighbors, and 0 otherwise. The precision matrix Q is defined as Q = D_w - W, where D_w is a diagonal matrix with each diagonal term d_ii equal to the sum of row i in W.

Note that the ICAR model is improper, in that the conditional distributions specified by the precision matrix do not determine a full joint distribution that integrates to 1; in other words, the precision matrix Q is not invertible. The ICAR precision matrix can still be used as a prior in a hierarchical model.

This function includes optional argument 'scale_variance'. If set to 'TRUE' (the default), the function will rescale the precision matrix to have a generalized variance of 1, which may aid in prior specifications that are comparable across areal spatial models with different geometries.

For more details, see: Banerjee, Carlin, and Gelfand (2015). Hierarchical Modeling and Analysis for Spatial Data, 2nd Edition. Section 6.4.3.3: CAR models and their difficulties. Riebler et al. (2016). An intuitive Bayesian sptial model for disease mapping that accounts for scaling. Statistical methods in medical research, 25(4):1145-65.

Value

Sparse ICAR precision matrix Q. See function details for more information.


njhenry/covidemr documentation built on Feb. 2, 2022, 2:31 a.m.