hivdat <- system.file("hiv", "HIVtutorial.Rdata", package="ICI3D")
attach(hivdat)
require(deSolve)
startYear <- 1975
endYear <- 2025
setB <- 0.029
setMu <- 0.018
setDelta <- 0.1
setBoxes <- 4


Overview {.tabset}

In this tutorial, we will fit a series of models with different model structures to HIV prevalence data from antenatal clinics (ANC data). **You should first complete the tutorial using the Harare data. If you have time, you can then move on to repeat the exercise with one of the other datasets.** In this tutorial, we'll fit the data _by eye_, which is not a very rigorous approach but is a good way to develop an intution for the model-fitting process. Please scroll down for detailed instructions.
wzxhzdk:2

Model 1

wzxhzdk:3
#### Instructions The basic model structure is shown in the diagram to the right. You can view/hide the code used to specify the model or to produce the plot (below) by toggling the associated **Code** button. 1. **Investigate the model structure.** - Make sure you understand what each of the parameters means. What are the units for each? - How is the incidence of infection calculated, and how would you write this as a mathematical expression? - Where in the code does it show that the instantaneous rate of change of the infectious compartment is calculated as incidence of infection, minus the background mortality rate, minus the total rate at which infected individuals die of AIDS? - How is the total mortality rate for infectious individuals calculated, and how would you write this as a mathematical expression? - Now look at the plot below. The estimated HIV infection prevalence (based on ANC data) is shown as green points. 2. **Run the model and compare the model predictions to the ANC data.** - Click on the "Show model output" button to the right. - The model's prediction for the trajectory of HIV prevalence is now shown in dark green on the plot below. Mortality (blue) and incidence (red) trajectories are also shown. - Visually compare the model prediction to the available data. Does the model do a good job of predicting the data? - The model prediction based on the default parameter values and initial conditions is very bad. - Try adjusting the parameter values by setting $\lambda$ to 0.4 and 0.6 and by setting the natural log of initial prevalence to be -6 and -9. - No matter what values we use for the model parameters, the model prediction does not look like the data: the prevalence is always much too high and the population crashes (see bottom panel, below the main plot). - Continue to adjust the parameters and initial conditions until you're convinced the model will not fit the data. _You can now move on to Model 2._ wzxhzdk:4 wzxhzdk:5 wzxhzdk:6
wzxhzdk:7 #### Parameters and initial conditions: wzxhzdk:8

Model 2

wzxhzdk:9
#### Instructions For Model 1, we found that the prevalence always remained much too high relative to the decline observed in the data. Since some people are likely to have lots of sex, and get infected quickly, while others are likely to have no sex, and never get infected, we may want to modify the model to reflect this heterogeniety in infection risk. There are many ways we could do this, but one of the simplest options -- as described in Jonathan's heterogeneity lecture -- is to define the transmission coefficient as a function of infection prevalence; here, we use the functional form $\hat{\lambda} = \lambda e^{-aP}$, where $a$ is a parameter that determines how rapidly transmisison declines as a function of prevalence and $P = \frac{I}{N}$ is the prevalence of infection. 3. **Investigate the new model structure.** - Make sure you understand what each of the parameters means. What are the units of each? - Where in the model code is the hetergeneity represented? 4. **Run the model and compare the model predictions to ANC data.** - Click on the "Show model output" button to the right. - The model's prediction for the trajectory of HIV prevalence is now shown in dark green on the plot below. Mortality (blue) and incidence (red) trajectories are also shown. - Visually compare the model prediction to the available data. Does the model do a good job of predicting the data? - Try adjusting the value of $a$ to see if you can improve the fit. - We can never get the prevalence curve to peak and then come down. - Nevertheless, if we set $a$ to about 8, we can bring the prevalence down to about the right level. Do this, and then change the values of $\lambda$ and $b$ to see how well you can fit the initial rise of infection. Looking at the graph, we see that the mortality precisely follows the trend in prevalence while we know that there should be a delay between the rise in prevalence and the rise in mortality. The reason the mortality curve tracks the prevalence curve is that we have assumed a constant _per capita_ death rate for infected individuals, whereas we know that probability of dying after HIV infection increases with the time since infection. Next, we will modify the model to account for this delay. _You can now move on to Model 3._ wzxhzdk:10 wzxhzdk:11 wzxhzdk:12
wzxhzdk:13 #### Parameters and initial conditions: wzxhzdk:14 wzxhzdk:15

Model 3

wzxhzdk:16 wzxhzdk:17
#### Instructions The easiest way to get the right shape for the survival curve is to modify the way we represent the course of infection. Instead of having a single infected compartment, we can introduce additional compartments that infected individuals must flow through before they can die of AIDS. This changes the survival curve to look much more like the observed survival curve (see the inset on the model diagram figure). 5. **Investigate the new model structure.** - This model structure adds three additional stages of infection. In each of these three stages, people enter from the previous stage at rate $g$ and exit to the next stage at rate $g$. We also let the mortality depend on the total rate at which people exit the fourth stage, rather than the first stage. Where does each of these changes appear in the model code? - Make sure you understand what each of the parameters means. Why do we set $g=4\delta$? 6. **Run the model and compare the model predictions to ANC data.** - Click on the "Show model output" button to the right below. - The model's prediction for the trajectory of HIV prevalence is now shown in dark green on the plot below. Mortality (blue) and incidence (red) trajectories are also shown. - What is the effect of adding the delay in AIDS-related death on the relative timing of the rises in mortality and prevalence? - Visually compare the model prediction to the available data. Does the model do a good job of predicting the data? - Try changing the values of $a$ and $\lambda$ to see how well you can now fit the initial rise of infection. We still cannot fit the decline in prevalence but at least we know that AIDS deaths are not sufficient to bring about the decline. Next, we will modify the model to account for the fact that people might respond to the epidemic. _You can now move on to Model 4._
wzxhzdk:18 wzxhzdk:19 wzxhzdk:20
#### Parameters and initial conditions: wzxhzdk:21 wzxhzdk:22

Model 4

wzxhzdk:23 wzxhzdk:24
#### Instructions The easiest way to add a control intervention is to assume that the control takes effect following a logistic curve (see inset above). 7. **Investigate the new model structure.** - This model requires three additional parameters: the maximum effect of the intervention on the effective contact rate (equivalent to 0 if there is no reduction and 1 for a completely effective intervention), the rate at which the intervention happens, and the time at which the intervention reaches half its maximum effectiveness. - Make sure you understand what each of the parameters means. Where in the code does the intervention appear? - What is the mathematical expression for the relative reduction in the effective contact rate at a given point in time? 8. **Run the model and compare the model predictions to ANC data.** - Click on the "Show model output" button to the right below. - The model's prediction for the trajectory of HIV prevalence is now shown in dark green on the plot below. Mortality (blue) and incidence (red) trajectories are also shown. - The lower graph below shows the intervention as a function of time. You can vary the intervention paramters to view their effect. - Try varying the effectiveness of the intervention to see if you can get a good fit to the data. - Also try adjusting the other paramters. What paramter combination gives the best fit to the data? Think about how to interpret these parameters. Do they seem plausible in the real world? Why or why not? People may also respond to the epidemic by changing their own behavior, even in the absence of an explicit intervention. Next, we'll investigate to what extent this affects the predicted model behavior. _You can now move on to Model 5._
wzxhzdk:25 wzxhzdk:26 wzxhzdk:27 wzxhzdk:28 wzxhzdk:29
#### Parameters and initial conditions: wzxhzdk:30 wzxhzdk:31

Model 5

wzxhzdk:32 wzxhzdk:33
#### Instructions The reduction in transmission could be due to a strong intervention, as we saw in Model 4, or it could just be that as people become aware of AIDS deaths, they are likely to change their behaviour to reduce their personal risk. We'll now implement a phenomenological representation of this type of behaviour change, where transmission risk decreases exponentially with instantaneous observed AIDS-related mortality (see inset above). 9. **Investigate the new model structure.** - Make sure you understand what the parameter $q$ means. Where in the code is this behvioural response to mortality represented? 10. **Run the model and compare the model predictions to ANC data.** - Click on the "Show model output" button to the right below. - The model's prediction for the trajectory of HIV prevalence is now shown in dark green on the plot below. Mortality (blue) and incidence (red) trajectories are also shown. - Try varying the value of $q$ to see if you can get a good fit to the prevalence data. You may have to play with the values of $\lambda$, $a$, and $p_0$ as well. In particular, you will have to make $a$ much smaller. This tells us that both $a$ and $q$ are helping to bring the prevalence down. We see that we can get an equally good fit by assuming that the behaviour change is a response to AIDS deaths, rather than the effect of an explicit intervention. But there is a big difference in the predicted dynamics. In the long term, this version of the model predicts that the prevalence should rise again, whereas Model 4 predicted that the prevalence should keep declining. What do you think underlies this difference in model predictions? You might also want to compare the incidence in the two models. What do you think is going on, and which model do you think will do a better job of accurately predicting future prevalence trends? _If you have time, you may now move on to examining one of the other datasets._
wzxhzdk:34 wzxhzdk:35 wzxhzdk:36
#### Parameters and initial conditions: wzxhzdk:37 wzxhzdk:38


detach()


ICI3D/ici3d-pkg documentation built on July 2, 2023, 1:59 p.m.