
Calibration diagnostics report (PDF)
Source:R/plot_model_calibration_report.R
plot_model_calibration_report.RdPages:
Enough simulations? The overall convergence status (green / yellow / red) over a table of its four checks (metric and formula, what it tells you, value, green / yellow target, status), then, below a "not part of the status" divider, the ESS growth, the budget and the ensemble size; the fit to data (cases and deaths, every scored day and, when they fit, tier 1-2 days); the reasons a check is not green, the flags (the fixed-budget flag is not shown: the run line says so) and the sampling details. On the right, the posterior ESS against the draws (log-log) over the best log-likelihood found so far.
Parameters. Monte Carlo error of each posterior mean (left) and prior-to-posterior KL divergence (right). Above 60 parameters the location-specific parameters are grouped by base name.
Fit. The fit table (and the worst-fitting locations of a multi-location run) over the weekly series: every complete week, the ensemble central line and its 50 and 95 percent predictive intervals from weekly-summed member trajectories, observed weekly totals on the scored weeks; unscored weeks shaded light grey, the burn-in darker.
Predicted vs observed. Weekly log-log scatter over the square-root-scale distributions of weekly counts, cases and deaths.
Appendix. What each metric shown means, generated from the glossary, and the metrics retired in 1.4.0.
A file written before MOSAIC 1.5.1 lacks the display fields; they are
completed in memory from its numbers and the glossary
(render_MOSAIC_figures() also writes the completed file, with the
full-week series rebuilt from the run's ensemble). A panel whose inputs are
missing is replaced by a note rather than failing the report.
Usage
plot_model_calibration_report(
diagnostics,
dir_output = NULL,
file = "calibration_report.pdf",
verbose = TRUE
)Arguments
- diagnostics
Path to
calibration_diagnostics.json, or the list it parses to. Must carryschema_version"2".- dir_output
Directory the PDF is written to (created if needed). Default
NULL: the directory holdingdiagnosticswhen it is a path.- file
File name of the PDF. Default
"calibration_report.pdf".- verbose
Logical; report the written path. Default
TRUE.
Details
Renders the MOSAIC calibration-diagnostics report from
3_results/calibration_diagnostics.json (summary.json schema 2
companion). The report answers the three calibration questions, each on
its own page, and reads nothing but that file and the metric glossary
(inst/extdata/metric_glossary.yml): every number and display string
comes from the file, every word, formula and target template from the
glossary. No samples, predictions or configs are opened, so it can be
re-rendered from a finished run.
The PDF is vector (base pdf() device, 11 x 8.5 in, WinAnsi
encoding for the dashes; formulas and Greek letters in plotmath) and is
written to a temporary file then renamed, so an interrupted render never
leaves a truncated report. The notation writes the likelihood of draw
\(i\) as \(L_i\) (no script l: the PDF fonts have no glyph for it).
A run made before MOSAIC 1.4.0 has no
calibration_diagnostics.json; its figures carry the notice from
.mosaic_calibration_report_legacy_notice() in place of a status.