explain_model() renders the random-effects guidance surface for an
mm_spec returned by compile_model() or, in later phases, an mm_fit.
It formats the upstream RandomTermCard and diagnostic payloads; Rust
remains the source of truth for per-block English wording and design facts.
Arguments
- spec
An
mm_specproduced bycompile_model()or anmm_fit.
Value
An object of class mm_explanation carrying:
textthe rendered explanation text
cardsthe upstream random-term cards
cross_card_constraintsreport-level constraints between cards
diagnosticsthe upstream diagnostics used for design notes
reportthe parsed upstream
ModelAuditReport
Errors
Raises an mm_schema_error if spec is not an mm_spec/mm_fit or does
not carry a valid compiled artifact.
Examples
if (FALSE) { # \dontrun{
df <- data.frame(
y = rnorm(20),
t = rep(0:3, 5),
s = factor(rep(1:5, each = 4))
)
explain_model(compile_model(y ~ t + (1 | s), df))
} # }