# The power of the contact matrix

[latexpage]

Now we introduced the contact matrix, we will use it in combination with the SIR model. In the end we will subdivide the population in age-classes: 0-1 year, 1-2 year and so on to the age of 100. Data from a contact study gives the corresponding mixing matrix, discussed on the previous page. Doing simulations using the SIR model can give us a better understanding in the effects of vaccination. We can for example conclude on what age-class we best focus the vaccination in order to decrease the impact of the disease.

#### Combining the SIR model with the contact matrix

Consider a population which is subdivided into $k$ sub-classes with an assosiated contact matrix $C = \begin{pmatrix} \beta_{11} & \beta_{12} & \cdots & \beta_{1k} \\ \beta_{21} & \beta_{22} & \cdots & \beta_{2k} \\ \vdots & \vdots & \ddots & \vdots \\ \beta_{k1} & \beta_{k2} & \cdots & \beta_{kk} \end{pmatrix} .$ A sub-class $i$ may contain both susceptible $S^i$, infected $I^i$ and immune $R^i$ people. The healthy people in this class can be infected by infected people from all the $k$ sub-classes. The rate at which new infections are created in sub-class $i$ due to contact with people from sub-class $j$ is just as before proportional to the amount of contacts made between healthy people form class $i$ and infected people from class $j$. By the formula on the previous page, the number of those contacts is given by $\beta_{ij} I^j S^i$. The number of newly infected people is proportional to this number and is just a factor away, absorbing this factor in the $\beta_{ij}$ we can now state that the newly infected people in subclass $i$ due to contacts with subclass $j$ is given by $\beta_{ij} I^j S^i$.  Summing over all subclasses gives the formula $I^i_{t+1} = I^i_{t} + \sum_{j=1}^k \beta_{ij} I^j_t S^i_t- g I^i_t,$ which holds for all $i:1, \ldots, k$. The number of newly infected people is taken away from the $S^i$ subclass and hence we can state $S^i_{t+1} = S^i_t – \sum_{j=1}^k \beta_{ij} I^j_t S^i_t.$ We further give the formula for the recovery class, which is just the same as before $R^i_{t+1} = R^i_t +gI^i_t.$

#### Applying to contact data

We present some simulations which uses the SIR model with age-classes (0-1y, 1-2y,…,99-100y). Given a contact takes place, there isn’t necessary a transmission of the infection. To randomize this somewhat, we do the same as earlier and take the number of newly infected people from a probability distribution with the corresponding mean. The simulations displays this for the Poisson and the binomial distribution. The first block of code does some calibrations and sets initial values. Then there follows the calculations of the SIR model, followed by a graph which displays the amount of infected people versus the time. The second part of the code contains the same modeling, but for the SIRS model. In the SIRS model, there is still a migration from the $R$ class to the $S$ class. We take the factor governing the migration the same over all sub-classes.

We have two contact matrices, one with real (heterogeneous) data and another one which is homogeneous. This means that all the elements of the contact matrix are the same, the sub-classes are all treated the same and actually the result is the same as the ordinary SIR model. Having two diferent matrices and two probabilty distributions gives four simulations in the links below.