sim_MM_matrix {CARME} | R Documentation |
Simulation of MM matrix based
Description
sim_MM_matrix
returns a multiple membership matrix simulated based on an
adjacency matrix according to the method described in
Usage
sim_MM_matrix(W, m, ord = 3, w_ord, id_vec, excess_areas = FALSE, red_areas)
Arguments
W |
Symmetric adjacency matrix of size |
m |
Integer. Number of membership to simulate |
ord |
Integer. Maximum order of neighbours to be used to simulate the
memberships based on the adjacency matrix |
w_ord |
A vector of length |
id_vec |
Vector of zeros and ones of length |
excess_areas |
if different from FALSE it indicates the indices of the
areas to reuse in simulating memberships, whenever |
red_areas |
vector of indices of areas to use if |
Value
an m x n matrix of weights
References
Marco Gramatica. Silvia Liverani. Peter Congdon. "Structure Induced by a Multiple Membership Transformation on the Conditional Autoregressive Model." Bayesian Analysis Advance Publication 1 - 25, 2023. https://doi.org/10.1214/23-BA1370
Examples
set.seed(455)
#---- Load data
data(W_sel)
## Number of areas
n <- nrow(W_sel)
## Number of memberships
m <- 153
#---- Simulate MM matrix
w_ord <- c(.5, .35, .15) # Weight of each neighbours orders
ord <- length(w_ord) - 1 # Order of neighbours to include
H_sel_sim <- sim_MM_matrix(
W = W_sel, m = m, ord = ord, w_ord = w_ord, id_vec = rep(1, nrow(W_sel))
)