{'fraction_non_alphanumeric': 0.018856447688564478, 'fraction_numerical': 0.0, 'mean_word_length': 5.254752851711027, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Efficient and flexible methods for simulating models of time since infection.

Epidemic models are useful tools in the fight against infectious diseases, as they allow policy makers to test and compare various strategies to limit disease transmission while mitigating collateral damage on the economy. Epidemic models that are more faithful to the microscopic details of disease transmission can offer more reliable projections, which in turn can lead to more reliable control strategies. For example, many epidemic models describe disease progression via a series of artificial stages or compartments (e.g., exposed, activated, infectious, etc.) but an epidemic model that explicitly tracks time since infection (TSI) can provide a more precise description. At present, epidemic models with compartments are more common than TSI models, largely due to the higher computational cost and complexity typically associated with TSI models. Here, however, we show that with the right discretization scheme a TSI model is not much more difficult to solve than a compartment model with three or four stages for the infected class. We also provide a perspective for adding stages to a TSI model in a way that decouples the disease transmission dynamics from the residence time distributions at each stage. These results are also generalized for age-structured TSI models in an Appendix. Finally, as proof of principle for the efficiency of the proposed numerical methods, we provide calculations for optimal epidemic control by nonpharmaceutical intervention. Many of the tools described in this paper are available through the software package pyross.