Observed-versus-Model Marginal Resistance Validation
Source:R/daly_resistance_validation.R
validate_marginal_calibration.RdFor every hospital x pathogen x antibiotic-class cell with adequate
observed testing support, compares the observed marginal resistance rate
against the model's fitted probability \(\Phi(\mu_{ed})\), averaged over
the same tested-event cohort and over posterior draws. This is a
model-validation calculation: it uses the fitted probability for TESTED
cells (unlike compute_event_profile_probabilities(), which never
overwrites an observed value). A calibration residual near 0 and interval
coverage near the nominal CI level indicate the model reproduces the
observed marginal resistance rates; it does not by itself validate joint
(pairwise/profile) structure.
Usage
validate_marginal_calibration(
fitted_model,
n_posterior_draws_for_validation = 2000L,
seed = 123L,
ci_level = 0.95,
min_tested = NULL,
min_resistant = NULL,
min_susceptible = NULL
)Arguments
- fitted_model
List returned by
fit_bayesian_multivariate_probit().- n_posterior_draws_for_validation
Integer. Posterior draws used. Default
2000L.- seed
Integer. Random seed (draw subsampling only). Default
123L.- ci_level
Numeric. Credible interval coverage. Default
0.95.- min_tested, min_resistant, min_susceptible
Integer or
NULL. Eligibility thresholds. When allNULL(default), eligibility is taken fromfitted_model$eligibility_report$marginal(the same approved rules used for profile panels) rather than re-deriving new thresholds. Supplying any of these overrides that report and applies the supplied thresholds instead.