Aggregate and Disaggregate Continuous Parameters for Compartmental Models

A convenient framework for aggregating and disaggregating continuously varying parameters (for example, case fatality ratio, with age) for proper parametrization of lower-resolution compartmental models (for example, with broad age categories) and subsequent upscaling of model outputs to high resolution (for example, as needed when calculating age-sensitive measures like years-life-lost). Methods and application to calculating years of life lost are described in Goodfellow et al. (2025) .


paramix

Tools for calculating aggregate parameters and for disaggregating outcomes.

Overview

For more complex infectious disease compartmental models, you may need to represent populations groups which discretize or group some continuous feature. For example, your model might use broad age groups, but you might have higher resolution data on critical processes by age. And once you've run your model, you might want outcomes associated with those processes at finer resolution for some follow on analyses.

The paramix package provides convenient functions to create both the correct aggregate parameters and to disaggregate outcomes.

Installation

install.packages("paramix")

Or install the development version from GitHub:

remotes::install_github("accidda/paramix")

Usage

Briefly, there are three steps:

  • create a translation object (alembic) based on the parameter function (e.g. the infection fatality ratio as a function of age), the density distribution of the pertinent feature (e.g. the population age pyramid), the model partitions of the feature (e.g. age groups), and the post-processing partitions of the feature (e.g. age in years).
  • create model parameters (blend) from the alembic
  • apply the alembic to model results (distill) to impute higher resolution outcomes

Reproducing the Paper Analysis

We describe the methodology and applications of paramix in:

Goodfellow L, Pearson CAB, Procter SR (2025). "paramix: An R package for parameter discretisation in compartmental models, with application to calculating years of life lost." PLOS Computational Biology, 21(9): e1013420. https://doi.org/10.1371/journal.pcbi.1013420

To reproduce the complete simulation study, figures, and numerical results from the paper using the bundled GNU Make and renv pipeline, see the vignette:

vignette("reproducing-paper-analysis", package = "paramix")

or read the online reproduction vignette.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("paramix")

0.0.3 by Carl Pearson, 3 days ago


https://accidda.github.io/paramix/, https://doi.org/10.1371/journal.pcbi.1013420


Report a bug at https://github.com/accidda/paramix/issues


Browse source code at https://github.com/cran/paramix


Authors: Carl Pearson [aut, cre] (ORCID: , Simon Proctor [aut] , Lucy Goodfellow [aut]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports data.table

Suggests covr, devtools, ggplot2, knitr, lintr, patchwork, pkgdown, pkgload, rmarkdown, roxygen2, roxyglobals, spelling, testthat, withr, wpp2019


See at CRAN