Identifies the sole declared estimate-level term from the compiled grouping maps. This classification selects a source term; it does not assert independent observations or alter its covariance representation.

random_effects_level_roles(random_effects, n_rows)

Arguments

random_effects

Compiled random_effects terms from a BayesTools_formula_design.

n_rows

Number of retained observation rows.

Value

A named character vector, keyed by block name, containing "estimate" or "other" for every term.

Details

A term is "estimate" when its group_map has a distinct grouping level for every retained row. There may be zero or one such term; multiple qualifying terms are an error. All remaining terms are "other", including terms with independent or mixed coefficient supports within repeated groups.

A qualifying term keeps the estimate role even when a known group covariance correlates its distinct levels. Consumers must preserve that full covariance and its row dependencies. Roles do not depend on SD values, coefficient supports, posterior draws, or sampled versus marginalized compile modes. random_effects_source_roles() separately describes covariance geometry.