View source: R/precision_builder.R
precision_builder | R Documentation |
This function constructs the precision matrix for a Conditional Autoregression (CAR).
precision_builder(
im.res,
tau = 1,
alpha = 0.75,
neighborhood = "ar1",
weight = "binary",
phi = 1,
r = NULL,
w = NULL,
h = NULL,
digits.Q = 10
)
im.res |
A vector defining the dimension of spatial data. The first entry is the number of rows and the second entry is the number of columns. |
tau |
A vector containing precision parameters. If of length 1, then
all precisions are assumed equal. Otherwise the length of |
alpha |
A scalar value between 0 and 1 that defines the strength of
correlations. Note that when |
neighborhood |
Defines the neighborhood within which conditional
correlations are non-zero. This differs from use in
|
weight |
Determines how weights are assigned. |
phi |
When |
r |
If |
w, h |
If |
digits.Q |
Determines the number of digits to round entries in the precision matrix. Default is 10. |
This formulation of the CAR model is based on a formulation found
in \insertCiteBanerjee:2015sim2Dpredictr where the joint distribution
of the of the conditionally specified random variables are assumed to be
N(0, [diag(tau^2)(D - alpha W)] ^ {-1})
and all neighbors are
weighted 1. When weights other than 1 are desired, the joint distribution
is N(0, [diag(tau^2) D (I - alpha D^{-1}W)] ^ {-1})
, e.g. as in
\insertCiteJin+Carlin+Banerjee:2005sim2Dpredictr.
A (precision) matrix.
Banerjee:2015sim2Dpredictr
\insertRefJin+Carlin+Banerjee:2005sim2Dpredictr
## Not run:
precision_builder(im.res = c(3, 3), tau = 1, alpha = 0.75,
neighborhood = "ar1")
## binary weights
precision_builder(im.res = c(3, 3), tau = 1, alpha = 0.75,
neighborhood = "round", r = 3)
## weights based on distance
precision_builder(im.res = c(3, 3), tau = 1, alpha = 0.75,
weight = "distance", phi = 1,
neighborhood = "round", r = 3)
precision_builder(im.res = c(3, 3), tau = 1, alpha = 0.75,
neighborhood = "rectangle", w = 2, h = 2)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.