Workshop 2: calibrating a stochastic model
1 Objectives
In this workshop, you will learn how to perform history matching with emulation on stochastic models, using the hmer package. Much of the calibration process is the same for stochastic and deterministic models, and we therefore recommend that before starting this workshop you complete Workshop 1, which shows how to perform history matching with emulation on deterministic models. In this workshop, we cover the overall process in less detail, with new information that is specific to stochastic models highlighted using boxes:
There are two reasons why epidemiologists may choose to use a stochastic model structure. The first is when modelling small numbers (e.g. a small population size, or small numbers of cases), where we are interested in the results of individual runs (e.g. to answer the question of what is the probability of an outbreak taking off following the introduction of an infection?). In this first case, we may wish to find input parameter sets where any individual model run is consistent with the calibration targets.
The second is when some characteristic that we wish to include in a model requires the use of an individual-based model, which are necessarily stochastic (e.g. if we wish to accurately capture patterns of repeated contact within and outside households). In this second case, we are not interested in the variation between individual runs at the same input parameter set, only in the mean result when averaged over large numbers of model runs. We therefore want to find input parameter sets where the mean outputs are consistent with the calibration targets.
In this workshop we focus on the second case, and develop an emulator structure that helps us match to the mean of the model. This allows us to rule out large portions of the input parameter space, and it can be very useful even in the case in which one is interested in single runs of the model. An implementation of history matching with emulation dealing with single runs of stochastic models will appear in future versions of our package.
Note that when running the workshop code on your device, you should not expect the hmer visualisation tools to produce the same exact output as the one you can find in the following sections. This is mainly because the maximinLHS function, that you will use to define the initial parameter sets on which emulators are trained, does return different Latin Hypercube designs at each call.
Before starting the tutorial, you will need to run the code contained in the box below: it will load all relevant dependencies and a few helper functions which will be introduced and used later.