mungeCARdata4stan_irregular: Prepare necessary components of the IAR model for use in...

View source: R/mungeCARdata4stan_irregular.R

mungeCARdata4stan_irregularR Documentation

Prepare necessary components of the IAR model for use in stan.

Description

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.

Usage

mungeCARdata4stan_irregular(adjBUGS, numBUGS)

Arguments

adjBUGS

A vector of neighbor indices.

numBUGS

A vector containing the number of neighbors for each point.

Value

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.

Note

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.

References

\insertRef

Morris:2017ssnet

\insertRef

Morris:2019ssnet


jmleach-bst/ssnet documentation built on March 4, 2024, 5:04 p.m.