Reduces structurally eligible random-effect covariance factor states to a diagonal contribution and structurally certified loading columns for every supplied row block. Eligibility and factor dimension are determined from compiled metadata, never from evaluated covariance values. Known group covariance uses its fixed Cholesky factor while retaining the complete coefficient covariance. Sampled zero SDs do not alter the structural supports.

random_effects_marginal_diagonal_factor(factors, cache = NULL)

Arguments

factors

A BayesTools_random_effects_marginal_factor_states object, or a single bridge-likelihood factor_state value carrying factor_plans, factor_states, and row_blocks.

cache

Optional environment used to retain the invariant reduction plan across repeated evaluations of one bridge-likelihood factor-state contract. Changing numerical factor states are still validated on every call. The reduction is keyed on the identity of the compiled contract, so the cache serves factor states that share it: calls of random_effects_marginal_factor_states() that pass one common cache, or the states of one bridge likelihood. States of a separately compiled contract signal a changed contract.

Value

A list with a numeric diagonal matrix, one loading array and structural rank per row block, and row_blocks. The loading_supports list contains one logical row-by-loading matrix per block, derived from compiled metadata independently of the evaluated loading values. The logical diagonal_support vector marks rows with a structurally declared diagonal contribution, including when its evaluated SD is zero.

Details

Structurally unavailable representations signal BayesTools_random_effects_marginal_factor_unavailable, inheriting from BayesTools_random_effects_error, error, and condition. Its stable reason field accompanies message and call. The shared parent also includes invalid allocation support errors; it alone does not identify structural unavailability.