Returns conservative row adjacency implied by compiled random-effect group maps, known group covariance, and the fixed coefficient supports of id() and diag() blocks. Disjoint independent coefficient supports do not connect rows. Other covariance structures retain conservative group dependencies. This is independent of posterior draws, sampled covariance, and compile mode. Downstream likelihoods can combine this matrix with their sampling dependencies before partitioning rows.

random_effects_dependency_matrix(random_effects, n_rows, blocks = NULL)

Arguments

random_effects

Compiled random_effects terms from a BayesTools_formula_design, or the metadata$blocks returned by random_effects_marginal_vcov() for prediction rows.

n_rows

Number of observation rows.

blocks

Optional character vector of block names to include. NULL includes every block; character() includes none.

Value

A symmetric logical n_rows by n_rows matrix with a true diagonal.