Compiles the same structural covariance representation used by bridge sampling and evaluates its draw-varying factor states for fitted rows. This avoids constructing dense draw x row x row arrays when a downstream likelihood can consume covariance factors directly.

random_effects_marginal_factor_states(
  fit,
  parameter = NULL,
  posterior_samples = NULL,
  prior_list = NULL,
  blocks = NULL,
  row_blocks,
  cache = NULL,
  ...
)

Arguments

fit, parameter, posterior_samples, prior_list, blocks

See random_effects_marginal_vcov().

row_blocks

a list of integer row-index vectors that partitions the fitted rows without separating any structurally nonzero covariance contribution.

cache

optional environment used to retain the compiled contract – the design, its priors, the selected blocks and the evaluator – across repeated calls that differ only in their posterior draws. The key is compared by value, so a different contract recompiles.

...

reserved for future extensions. Unused arguments are rejected.

Value

A list of class BayesTools_random_effects_marginal_factor_states with invariant factor_plans, one factor_states list per posterior draw, row_blocks, a contract_id identifying the compiled contract, and structural metadata.