Applies the covariance represented by random_effects_marginal_factor_states() to one row vector per posterior draw without constructing a dense draw x row x row covariance array.

random_effects_marginal_factor_product(factors, vectors, by_block = FALSE)

Arguments

factors

a BayesTools_random_effects_marginal_factor_states object.

vectors

numeric matrix with one posterior draw per row and one fitted observation per column.

by_block

whether to return one product matrix per random-effect block.

Value

A numeric matrix when by_block = FALSE; otherwise a named list of numeric matrices in fitted random-block order.