Per-subject SAEM conditional distribution of random effects

Description

Returns the per-subject / per-eta conditional distribution summary produced by the opt-in SAEM conditional-distribution pass ([fit_options] conddist = true). This is the shrinkage-unbiased analogue of saemix’s conddist.saemix / Monolix’s “Conditional Distribution” task: rather than only the conditional mode (the EBE on fit$ebe_etas), it reports the conditional mean and SD of each subject’s eta, i.e. p(eta_i | y_i; theta_hat).

Usage

ferx_conddist(fit)

Arguments

  • fit: A ferx_fit object returned by [ferx_fit](ferx_fit.qmd) (or [ferx_load_fit](ferx_load_fit.qmd)), fit with method = "saem" and settings = list(conddist = TRUE).

Seealso

[ferx_fit](ferx_fit.qmd)’s conddist fit option (see [fit_options] in the model-file docs); [ferx_get_warnings](ferx_get_warnings.qmd)for other post-fit diagnostics. Other diagnostics: [check_diagnostics](check_diagnostics.qmd)(), [ferx_cov_screen](ferx_cov_screen.qmd)(), [ferx_get_warnings](ferx_get_warnings.qmd)(), [ferx_runlog_iters](ferx_runlog_iters.qmd)(), [ferx_trace](ferx_trace.qmd)(), [plot.ferx_fit](plot.ferx_fit.qmd)(), [summary.ferx_fit](summary.ferx_fit.qmd)()

Concept

diagnostics

Value

A data frame (classed ferx_conddist) with one row per subject x eta: ID, ETA, COND_MEAN, COND_SD, COND_MODE. The distribution-based eta-shrinkage (parallel to fit$eta_names) and the retained-draw bookkeeping are attached as attributes "shrinkage", "nsamp", "burnin".

Examples

ex  <- ferx_example("warfarin_saem")
fit <- ferx_fit(ex$model, ex$data, method = "saem",
                 settings = list(conddist = TRUE))
cd  <- ferx_conddist(fit)
head(cd)
attr(cd, "shrinkage")