Compare two or more mlumr_fit objects by DIC (default), LOO, or WAIC.
For LOO/WAIC, loo::loo_compare() is used under the hood; the output
is the standard loo_compare table. The pointwise scores are paired
observation by observation, so the fits must be of the same data in the
same row order; fits whose stored outcomes differ are refused. For DIC the
return is a data frame ordered by DIC.
Arguments
- ...
Two or more
mlumr_fitobjects. For DIC,mlumr_dicobjects are also accepted.- criterion
One of
"dic"(default),"loo", or"waic". LOO and WAIC require the optionalloopackage.- survival_unit
For survival fits compared by
"loo"/"waic", the pointwise unit forwarded tocalculate_loo()/calculate_waic():"observation"(default; per reconstructed comparator pseudo-individual, optimistic),"arm", or"aggregate". Choose"arm"or"aggregate"to select on whole-external-arm predictive fit. Ignored for non-survival families and forcriterion = "dic".
Value
For "loo" / "waic": a compare.loo table from
loo::loo_compare(). For "dic": a data frame (invisibly) with
columns Model, DIC, pD, Delta_DIC.