car_precision {stcos} | R Documentation |
CAR Precision Matrix
Description
A convenience function to compute the CAR precision matrix based on a given adjacency matrix.
Usage
car_precision(A, tau = 1, scale = FALSE)
Arguments
A |
An adjacency matrix. |
tau |
The CAR dependency parameter |
scale |
Whether to scale matrix entries. See "Value".
Default: |
Details
Suppose is an
adjacency matrix and
If
scale
is FALSE
, return the CAR precision matrix
If scale
is TRUE
, return a scaled version
An error is thrown if scale = TRUE
and any of
are equal to 0.
Taking
corresponds to the Intrinsic CAR
precision matrix.
Typically in a modeling context, the precision matrix will be
multiplied by a scaling parameter; e.g., a CAR model for
random effects could be
where .
Value
CAR precision matrix.
Examples
data("acs_sf")
dom = acs5_2013[1:4,]
A = adjacency_matrix(dom)
Q = car_precision(A)
[Package stcos version 0.3.1 Index]