The documentation for brms::extract_draws()
says this about the sample_new_levels
option:
Indicates how to sample new levels for grouping factors specified in
re_formula
. This argument is only relevant if newdata is provided andallow_new_levels
is set to TRUE. If"uncertainty"
(default), include group-level uncertainty in the predictions based on the variation of the existing levels. If"gaussian"
, sample new levels from the (multivariate) normal distribution implied by the group-level standard deviations and correlations. This options may be useful for conducting Bayesian power analysis. If"old_levels"
, directly sample new levels from the existing levels.
Iām having a hard time understanding what the differences between the three options (āuncertaintyā, āgaussianā, and āold_levelsā) are.
How does āuncertaintyā include group-level uncertainty based on the variation of the existing levels? Does it randomly sample from the existing group levels?
For āgaussianā, am I correct that for a term like (1 | grp)
, this option would return something like rnorm(n_draws, 0, sd_grp__Intercept)
?
For āold_levelsā, is one of the group levels chosen randomly at the start, and then only its draws are used?
Iāve read this discussion on the brms github and Iāve taken a look at the code for extract_draws.R but Iām still unsure on this.