View source: R/mungeCARdata4stan_irregular.R
mungeCARdata4stan_irregular | R Documentation |
stan
.The underlying 'stan' code can work without explicitly calling or building the adjacency matrix, but to do so requires some processing, which is done here.
mungeCARdata4stan_irregular(adjBUGS, numBUGS)
adjBUGS |
A vector of neighbor indices. |
numBUGS |
A vector containing the number of neighbors for each point. |
Returns a list where J
is the number predictors,
J_edges
is the number of edges in connected graph representing the
spatial data, and node1, node2
are required to fit the model without
explicitly specifying an adjacency matrix.
This function is derivative from Mitzi Morris's code
\insertCiteMorris:2017,Morris:2019ssnet. The "original" is
mungeCARdata4stan()
, but in that function it was assumed that the
number of edges was easily calculated. Some spatial settings do not adhere
to this setup, and errors arise. This version, thus far, appears to work as
intended in less standard settings.
Morris:2017ssnet
\insertRefMorris:2019ssnet
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.