List of Epidemiology Models¶
This section documents the epidemiological model created by Universities of Warwick and Lancaster. This model is used to produce a number of research reports for the World Health Organisation (WHO) Strategic Advisory Group of Experts on Immunisation (SAGE) Covid-19 Working Group.
It uses an extended version of an SEIR model and contact and region specific matrices.
Overview:
Warwick-Lancaster Model¶
- class warwickmodel.WarwickLancSEIRModel[source]¶
WarwickLancSEIRModel Class: Base class for constructing the ODE model: deterministic SEIR developed by Universities of Warwick and Lancaster to model the Covid-19 epidemic and the effects of vaccines and waning immunity on the epidemic trajectory in different countries.
The population is structured such that every individual will belong to one of the compartments of the extended SEIRD model.
The general SEIR Model has four compartments - susceptible individuals (\(S\)), exposed but not yet infectious (\(E\)), infectious (\(I\)) and recovered (\(R\)).
In the Warwick-Lancaster model framework, the exposed are split into 5x6 compartments to allow waiting time as an exposed to be Erlang-distributed, as well as depending on the immunity status due to the vaccine of the individual exposed. Meanwhile, the infectious compartment is split into 10 distinct ones: depending on whether they are symptomatic or asymptomatic infectious, and on the immunity status due to the vaccine of the individual infected. We also consider a population divided in age groups, as we expect people of different ages to interact diferently between themselves and to be affected differently by the virus, i.e. have different succeptibilities to infection and proportions of asymptomatic individuals. The model structure now becomes, for each region:
\begin{eqnarray} \frac{dS^i}{dt} &=& - \phi \omega \nu_\text{tra} \beta^i \lambda^i S^i - \text{Vac} S^i -\text{VacB} S^i + \text{WE2} S_{W2}^i + \text{WE} S_{W3}^i \\ \frac{dS_F^i}{dt} &=& - \phi \omega \nu_\text{tra,F} \beta^i \lambda^i S_F^i + \text{Vac} S^i + \text{Vac} S_{W1}^i + \text{Vac} S_{W2}^i + \text{Vac} S_{W3}^i - \text{VacB} S_F^i - \text{WE} S_F^i \\ \frac{dS_B^i}{dt} &=& - \phi \omega \nu_\text{tra,B} \beta^i \lambda^i S_B^i + \text{VacB} S_F^i + \text{VacB} S_{W1}^i + \text{VacB} S_{W2}^i + \text{VacB} S_{W3}^i - \text{WE} S_B^i + \epsilon \text{VacB} R^i\\ \frac{dS_{W1}^i}{dt} &=& - \phi \omega \nu_\text{tra,W1} \beta^i \lambda^i S_{W1}^i - \text{Vac} S_{W1}^i - \text{VacB} S_{W1}^i - \text{WE} S_{W1}^i + \text{WE} S_B^i + \text{WE} R^i \\ \frac{dS_{W2}^i}{dt} &=& - \phi \omega \nu_\text{tra,W2} \beta^i \lambda^i S_{W2}^i - \text{Vac} S_{W2}^i - \text{VacB} S_{W2}^i - \text{WE2} S_{W2}^i + \text{WE} S_F^i + \text{WE} S_{W1}^i - \text{WE3} S_{W2}^i \\ \frac{dS_{W3}^i}{dt} &=& - \phi \omega \nu_\text{tra,W3} \beta^i \lambda^i S_{W3}^i - \text{Vac} S_{W3}^i - \text{VacB} S_{W3}^i - \text{WE} S_{W3}^i + \text{WE3} S_{W2}^i \\ \frac{dE_1^i}{dt} &=& \phi \omega \nu_\text{tra} \beta^i \lambda^i S^i - \alpha E_1^i \\ \frac{dE_2^i}{dt} &=& \alpha (E_1^i - E_2^i) \\ \frac{dE_3^i}{dt} &=& \alpha (E_2^i - E_3^i) \\ \frac{dE_4^i}{dt} &=& \alpha (E_3^i - E_4^i) \\ \frac{dE_5^i}{dt} &=& \alpha (E_4^i - E_5^i) \\ \frac{dE_{1,F}^i}{dt} &=& \phi \omega \nu_\text{tra,F} \beta^i \lambda^i S_F^i - \alpha E_{1,F}^i \\ \frac{dE_{2,F}^i}{dt} &=& \alpha (E_{1,F}^i - E_{2,F}^i) \\ \frac{dE_{3,F}^i}{dt} &=& \alpha (E_{2,F}^i - E_{3,F}^i) \\ \frac{dE_{4,F}^i}{dt} &=& \alpha (E_{3,F}^i - E_{4,F}^i) \\ \frac{dE_{5,F}^i}{dt} &=& \alpha (E_{4,F}^i - E_{5,F}^i) \\ \frac{dE_{1,B}^i}{dt} &=& \phi \omega \nu_\text{tra,B} \beta^i \lambda^i S_B^i - \alpha E_{1,B}^i \\ \frac{dE_{2,B}^i}{dt} &=& \alpha (E_{1,B}^i - E_{2,B}^i) \\ \frac{dE_{3,B}^i}{dt} &=& \alpha (E_{2,B}^i - E_{3,B}^i) \\ \frac{dE_{4,B}^i}{dt} &=& \alpha (E_{3,B}^i - E_{4,B}^i) \\ \frac{dE_{5,B}^i}{dt} &=& \alpha (E_{4,B}^i - E_{5,B}^i) \\ \frac{dE_{1,W1}^i}{dt} &=& \phi \omega \nu_\text{tra,W1} \beta^i \lambda^i S_{W1}^i - \alpha E_{1,W1}^i \\ \frac{dE_{2,W1}^i}{dt} &=& \alpha (E_{1,W1}^i - E_{2,W1}^i) \\ \frac{dE_{3,W1}^i}{dt} &=& \alpha (E_{2,W1}^i - E_{3,W1}^i) \\ \frac{dE_{4,W1}^i}{dt} &=& \alpha (E_{3,W1}^i - E_{4,W1}^i) \\ \frac{dE_{5,W1}^i}{dt} &=& \alpha (E_{4,W1}^i - E_{5,W1}^i) \\ \frac{dE_{1,W2}^i}{dt} &=& \phi \omega \nu_\text{tra,W2} \beta^i \lambda^i S_{W2}^i - \alpha E_{1,W2}^i \\ \frac{dE_{2,W2}^i}{dt} &=& \alpha (E_{1,W2}^i - E_{2,W2}^i) \\ \frac{dE_{3,W2}^i}{dt} &=& \alpha (E_{2,W2}^i - E_{3,W2}^i) \\ \frac{dE_{4,W2}^i}{dt} &=& \alpha (E_{3,W2}^i - E_{4,W2}^i) \\ \frac{dE_{5,W2}^i}{dt} &=& \alpha (E_{4,W2}^i - E_{5,W2}^i) \\ \frac{dE_{1,W3}^i}{dt} &=& \phi \omega \nu_\text{tra,W3} \beta^i \lambda^i S_{W3}^i - \alpha E_{1,W3}^i \\ \frac{dE_{2,W3}^i}{dt} &=& \alpha (E_{1,W3}^i - E_{2,W3}^i) \\ \frac{dE_{3,W3}^i}{dt} &=& \alpha (E_{2,W3}^i - E_{3,W3}^i) \\ \frac{dE_{4,W3}^i}{dt} &=& \alpha (E_{3,W3}^i - E_{4,W3}^i) \\ \frac{dE_{5,W3}^i}{dt} &=& \alpha (E_{4,W3}^i - E_{5,W3}^i) \\ \frac{dI^i}{dt} &=& \nu_\text{symp}d^i \alpha E_5^i - \gamma^i I^i \\ \frac{dI_F^i}{dt} &=& \nu_\text{symp,F}d^i \alpha E_{5,F}^i - \gamma^i I_F^i \\ \frac{dI_B^i}{dt} &=& \nu_\text{symp,B}d^i \alpha E_{5,B}^i - \gamma^i I_B^i \\ \frac{dI_{W1}^i}{dt} &=& \nu_\text{symp,W1}d^i \alpha E_{5,W1}^i - \gamma^i I_{W1}^i \\ \frac{dI_{W2}^i}{dt} &=& \nu_\text{symp,W2}d^i \alpha E_{5,W2}^i - \gamma^i I_{W2}^i \\ \frac{dI_{W3}^i}{dt} &=& \nu_\text{symp,W3}d^i \alpha E_{5,W3}^i - \gamma^i I_{W3}^i \\ \frac{dA^i}{dt} &=& (1-\nu_\text{symp}d^i) \alpha E_5^i - \gamma^i A^i \\ \frac{dA_F^i}{dt} &=& (1-\nu_\text{symp,F}d^i) \alpha E_{5,F}^i - \gamma^i A_F^i \\ \frac{dA_B^i}{dt} &=& (1-\nu_\text{symp,B}d^i) \alpha E_{5,B}^i - \gamma^i A_B^i \\ \frac{dA_{W1}^i}{dt} &=& (1-\nu_\text{symp,W1}d^i) \alpha E_{5,W1}^i - \gamma^i A_{W1}^i \\ \frac{dA_{W2}^i}{dt} &=& (1-\nu_\text{symp,W2}d^i) \alpha E_{5,W2}^i - \gamma^i A_{W2}^i \\ \frac{dA_{W3}^i}{dt} &=& (1-\nu_\text{symp,W3}d^i) \alpha E_{5,W3}^i - \gamma^i A_{W3}^i \\ \frac{dR^i}{dt} &=& \gamma^i \Big(I^i + A^i\Big) + \gamma^i \Big(I_F^i + A_F^i\Big) + \gamma^i \Big(I_B^i + A_B^i\Big) + \gamma^i \Big(I_{W1}^i + A_{W1}^i\Big) + \gamma^i \Big(I_{W2}^i + A_{W2}^i\Big) + \gamma^i \Big(I_{W3}^i + A_{W3}^i\Big) - \text{WE} R^i - \epsilon \text{VacB} R^i \end{eqnarray}with:
\begin{eqnarray} \lambda^i = \sum_{j} \nu_\text{inf}C^{ij} \frac{1}{N^j} \Big(I^j + \tau^j A^j\Big) + \sum_{j} \nu_\text{inf,F} C^{ij} \frac{1}{N^j} \Big(I_F^j + \tau^j A_F^j\Big) + \sum_{j} \nu_\text{inf,B} C^{ij} \frac{1}{N^j} \Big(I_B^j + \tau^j A_B^j\Big) + \sum_{j} \nu_\text{inf,W1} C^{ij} \frac{1}{N^j} \Big(I_{W1}^j + \tau^j A_{W1}^j\Big) + \sum_{j} \nu_\text{inf,W2} C^{ij} \frac{1}{N^j} \Big(I_{W2}^j + \tau^j A_{W2}^j\Big) + \sum_{j} \nu_\text{inf,W3} C^{ij} \frac{1}{N^j} \Big(I_{W3}^j + \tau^j A_{W3}^j\Big) \end{eqnarray}where \(i\) is the age group of the individual, \(C^{ij}\) is the \((i,j)\) th element of the regional contact matrix, and represents the expected number of new infections in age group \(i\) caused by an infectious in age group \(j\).
\(\beta\) is the age-dependent transmission parameter
\(S(0) = S_0, E(0) = E_0, I(0) = I_0, A(0) = A_0, R(0) = R_0\) are also parameters of the model (evaluation at 0 refers to the compartments’ structure at intial time; we use S, E, I, A as blanket terms for all the different types of compartments that fall under these labels).
Extends
pints.ForwardModel.- age_groups_names()[source]¶
Returns the age group names.
- Returns:
List of the age group names.
- Return type:
list
- check_death_format(niu)[source]¶
Checks correct format of the inputs of number of death calculation.
- Parameters:
new_deaths (list of numpy.array) – Age-structured matrices of the number of new deaths for different vaccination statuses (unvaccinated, fully-vaccinated, boosted, partially-waned, fully-waned, previous-variant immunity) from the simulation method for the WarwickLancSEIRModel.
niu (float) – Dispersion factor for the negative binomial distribution.
- check_new_deaths_format(new_hospitalisation, pHtoD, dHtoD)[source]¶
Checks correct format of the inputs of number of death calculation.
- Parameters:
new_hospitalisation (numpy.array) – Age-structured arrays of the daily number of new hospitalised cases for different vaccination statuses (unvaccinated, fully- vaccinated, boosted, partially-waned, fully-waned, previous-variant immunity).
pHtoD (int or float) – Age-dependent fractions of the number of hospitalised cases that die.
dHtoD (list) – Distribution of the delay between onset of hospitalisation and death. Must be normalised.
- check_new_hospitalisation_format(new_infections, pItoH, dItoH)[source]¶
Checks correct format of the inputs of number of hospitalisation calculation.
- Parameters:
new_infections (list of numpy.array) – Age-structured arrays of the daily number of new symptomatic infections for different vaccination statuses (unvaccinated, fully- vaccinated, boosted, partially-waned, fully-waned, previous-variant immunity).
pItoH (list) – Age-dependent fractions of the number of symptomatic cases that end up hospitalised.
dItoH (list) – Distribution of the delay between onset of symptoms and hospitalisation. Must be normalised.
- check_positives_format(output, tests, sens, spec)[source]¶
Checks correct format of the inputs of number of positive test results calculation.
- Parameters:
output (numpy.array) – Age-structured output matrix of the simulation method for the WarwickLancSEIRModel.
tests (list) – List of conducted tests in specified region and at time point k classifed by age groups.
sens (float or int) – Sensitivity of the test (or ratio of true positives).
spec (float or int) – Specificity of the test (or ratio of true negatives).
- loglik_deaths(obs_death, new_deaths, niu, k)[source]¶
Computes the log-likelihood for the number of deaths at time step \(k\) in specified region, given the simulated timeline of susceptible number of individuals, for all age groups in the model.
The number of deaths is assumed to be distributed according to a negative binomial distribution with mean \(\mu_{r,t_k,i}\) and variance \(\mu_{r,t_k,i} (\nu + 1)\), where \(\mu_{r,t_k,i}\) is the number of new deaths in specified region, for age group \(i\) on day \(t_k\).
It uses new_infections output of the simulation method for the WarwickLancSEIRModel, taking all the rest of the parameters necessary for the computation from the way its simulation has been fitted.
- Parameters:
obs_death (list) – List of number of observed deaths by age group at time point k.
new_deaths (list of numpy.array) – Age-structured matrix of the number of new deaths for different vaccination statuses (unvaccinated, fully-vaccinated, boosted, partially-waned, fully-waned, previous-variant immunity) from the simulation method for the WarwickLancSEIRModel.
niu (float) – Dispersion factor for the negative binomial distribution.
k (int) – Index of day for which we intend to sample the number of deaths for by age group.
- Returns:
Age-structured matrix of log-likelihoods for the observed number of deaths in specified region at time \(t_k\).
- Return type:
numpy.array
Notes
Always run
WarwickLancSEIRModel.new_infections()andWarwickLancSEIRModel.check_death_format()before running this one.
- loglik_positive_tests(obs_pos, output, tests, sens, spec, k)[source]¶
Computes the log-likelihood for the number of positive tests at time step \(k\) in specified region, given the simulated timeline of susceptible number of individuals, for all age groups in the model.
The number of positive tests is assumed to be distributed according to a binomial distribution with parameters \(n = n_{r,t_k,i}\) and
\[p = k_{sens} (1-\frac{S_{r,t_k,i}}{N_{r,i}}) + ( 1-k_{spec}) \frac{S_{r,t_k,i}}{N_{r,i}}\]where \(n_{r,t_k,i}\) is the number of tests conducted for people in age group \(i\) in specified region \(r\) at time atep \(t_k\), \(k_{sens}\) and \(k_{spec}\) are the sensitivity and specificity respectively of a test, while is the probability of demise \(k-l\) days after infection and \(\delta_{r,t_l,i}^{infec}\) is the number of new infections in specified region, for age group \(i\) on day \(t_l\).
It uses an output of the simulation method for the WarwickLancSEIRModel, taking all the rest of the parameters necessary for the computation from the way its simulation has been fitted.
- Parameters:
obs_pos (list) – List of number of observed positive test results by age group at time point k.
output (numpy.array) – Age-structured output matrix of the simulation method for the WarwickLancSEIRModel.
tests (list) – List of conducted tests in specified region and at time point k classifed by age groups.
sens (float or int) – Sensitivity of the test (or ratio of true positives).
spec (float or int) – Specificity of the test (or ratio of true negatives).
k (int) – Index of day for which we intend to sample the number of positive test results by age group.
- Returns:
Age-structured matrix of log-likelihoods for the obsereved number of positive test results for each age group in specified region at time \(t_k\).
- Return type:
numpy.array
Notes
Always run
WarwickLancSEIRModel.simulate()andWarwickLancSEIRModel.check_positives_format()before running this one.
- mean_deaths(k, new_deaths)[source]¶
Computes the mean of the negative binomial distribution used to calculate number of deaths for specified age group.
- Parameters:
k (int) – Index of day for which we intend to sample the number of deaths for by age group.
new_deaths (list of numpy.array) – Age-structured matrices of the number of new deaths for different vaccination statuses (unvaccinated, fully-vaccinated, boosted, partially-waned, fully-waned, previous-variant immunity) from the simulation method for the WarwickLancSEIRModel.
- Returns:
Age-structured matrix of the expected number of deaths to be observed in specified region at time \(t_k\).
- Return type:
numpy.array
- mean_positives(sens, spec, suscep, pop)[source]¶
Computes the mean of the binomial distribution used to calculate number of positive test results for specified age group.
- Parameters:
sens (float or int) – Sensitivity of the test (or ratio of true positives).
spec (float or int) – Specificity of the test (or ratio of true negatives).
suscep (numpy.array) – Age-structured matrix of the current number of susceptibles in the population.
pop (numpy.array) – Age-structured matrix of the current number of individuals in the population.
- Returns:
Age-structured matrix of the expected number of positive test results to be observed in specified region at time \(t_k\).
- Return type:
numpy.array
- n_parameters()[source]¶
Returns the number of parameters.
- Returns:
Number of parameters.
- Return type:
int
- new_deaths(new_hospitalisation, pHtoD, dHtoD)[source]¶
Computes number of new deaths at each time step in specified region, given the simulated timeline of hospitalised number of individuals, for all age groups in the model.
It uses the array of the number of new symptomatic infections, obtained from an output of the simulation method for the WarwickLancSEIRModel, a distribution of the delay between onset of symptoms and admission to ICU, as well as the fraction of the number of hospitalised cases that end up dying.
- Parameters:
new_hospitalisation (list of numpy.array) – Age-structured arrays of the daily number of new hospitalised cases for different vaccination statuses (unvaccinated, fully- vaccinated, boosted, partially-waned, fully-waned, previous-variant immunity).
pHtoD (list) – Age-dependent fractions of the number of hospitalised cases that die.
dHtoD (list) – Distribution of the delay between onset of hospitalisation and death. Must be normalised.
- Returns:
Age-structured matrices of the number of new deaths for different vaccination statuses (unvaccinated, fully-vaccinated, boosted, partially-waned, fully-waned, previous-variant immunity) from the simulation method for the WarwickLancSEIRModel.
- Return type:
list of numpy.array
Notes
Always run
WarwickLancSEIRModel.simulate()before running this one.
- new_hospitalisations(new_infections, pItoH, dItoH)[source]¶
Computes number of new hospital admissions at each time step in specified region, given the simulated timeline of detectable symptomatic infected number of individuals, for all age groups in the model.
It uses the array of the number of new symptomatic infections, obtained from an output of the simulation method for the WarwickLancSEIRModel, a distribution of the delay between onset of symptoms and hospitalisation, as well as the fraction of the number of symptomatic cases that end up hospitalised.
- Parameters:
new_infections (list of numpy.array) – Age-structured arrays of the daily number of new symptomatic infections for different vaccination statuses (unvaccinated, fully- vaccinated, boosted, partially-waned, fully-waned, previous-variant immunity).
pItoH (list) – Age-dependent fractions of the number of symptomatic cases that end up hospitalised.
dItoH (list) – Distribution of the delay between onset of symptoms and hospitalisation. Must be normalised.
- Returns:
Age-structured matrix of the number of new hospital admissions for different vaccination statuses (unvaccinated, fully-vaccinated, boosted, partially-waned, fully-waned, previous-variant immunity) from the simulation method for the WarwickLancSEIRModel.
- Return type:
list of numpy.array
Notes
Always run
WarwickLancSEIRModel.simulate()before running this one.
- new_infections(output)[source]¶
Computes number of new symptomatic infections at each time step in specified region, given the simulated timeline of susceptible number of individuals, for all age groups in the model.
It uses an output of the simulation method for the WarwickLancSEIRModel, taking all the rest of the parameters necessary for the computation from the way its simulation has been fitted.
- Parameters:
output (numpy.array) – Age-structured output of the simulation method for the WarwickLancSEIRModel.
- Returns:
Age-structured matrices of the number of new symptomatic infections for different vaccination statuses (unvaccinated, fully-vaccinated, boosted, partially-waned, fully-waned, previous-variant immunity) from the simulation method for the WarwickLancSEIRModel.
- Return type:
list of numpy.array
Notes
Always run
WarwickLancSEIRModel.simulate()before running this one.
- new_total_infections(output)[source]¶
Computes number of new (symptomatic + asymptomatic) infections at each time step in specified region, given the simulated timeline of susceptible number of individuals, for all age groups in the model.
It uses an output of the simulation method for the WarwickLancSEIRModel, taking all the rest of the parameters necessary for the computation from the way its simulation has been fitted.
- Parameters:
output (numpy.array) – Age-structured output of the simulation method for the WarwickLancSEIRModel.
- Returns:
Age-structured matrices of the number of new (symptomatic + asymptomatic) infections for different vaccination statuses (unvaccinated, fully-vaccinated, boosted, partially-waned, fully-waned, previous-variant immunity) from the simulation method for the WarwickLancSEIRModel.
- Return type:
list of numpy.array
Notes
Always run
WarwickLancSEIRModel.simulate()before running this one.
- output_names()[source]¶
Returns the (selected) output names.
- Returns:
List of the (selected) output names.
- Return type:
list
- parameter_names()[source]¶
Returns the parameter names.
- Returns:
List of the parameter names.
- Return type:
list
- read_contact_data(matrices_contact, time_changes_contact)[source]¶
Reads in the timelines of contact data used for the modelling.
- Parameters:
matrices_contact (list of ContactMatrix) – List of time-dependent contact matrices used for the modelling.
time_changes_contact (list) – List of times at which the next contact matrix recorded starts to be used. In increasing order.
- read_regional_data(matrices_region, time_changes_region)[source]¶
Reads in the timelines of regional data used for the modelling.
- Parameters:
matrices_region (lists of RegionMatrix) – List of ime-dependent and region-specific relative susceptibility matrices used for the modelling.
time_changes_region (list) – List of times at which the next instances of region-specific relative susceptibility matrices recorded start to be used. In increasing order.
- region_names()[source]¶
Returns the regions names.
- Returns:
List of the regions names.
- Return type:
list
- samples_deaths(new_deaths, niu, k)[source]¶
Computes samples for the number of deaths at time step \(k\) in specified region, given the simulated timeline of susceptible number of individuals, for all age groups in the model.
The number of deaths is assumed to be distributed according to a negative binomial distribution with mean \(\mu_{r,t_k,i}\) and variance \(\mu_{r,t_k,i} (\nu + 1)\), where \(\mu_{r,t_k,i}\) is the number of new deaths in specified region, for age group \(i\) on day \(t_k\).
It uses an output of the simulation method for the WarwickLancSEIRModel, taking all the rest of the parameters necessary for the computation from the way its simulation has been fitted.
- Parameters:
new_deaths (numpy.array) – Age-structured matrices of the number of new deaths for different vaccination statuses (unvaccinated, fully-vaccinated, boosted, partially-waned, fully-waned, previous-variant immunity) from the simulation method for the WarwickLancSEIRModel.
niu (float) – Dispersion factor for the negative binomial distribution.
k (int) – Index of day for which we intend to sample the number of deaths for by age group.
- Returns:
Age-structured matrix of sampled number of deaths in specified region at time \(t_k\).
- Return type:
numpy.array
Notes
Always run
WarwickLancSEIRModel.new_infections()andWarwickLancSEIRModel.check_death_format()before running this one.
- samples_positive_tests(output, tests, sens, spec, k)[source]¶
Computes the samples for the number of positive tests at time step \(k\) in specified region, given the simulated timeline of susceptible number of individuals, for all age groups in the model.
The number of positive tests is assumed to be distributed according to a binomial distribution with parameters \(n = n_{r,t_k,i}\) and
\[p = k_{sens} (1-\frac{S_{r,t_k,i}}{N_{r,i}}) + ( 1-k_{spec}) \frac{S_{r,t_k,i}}{N_{r,i}}\]where \(n_{r,t_k,i}\) is the number of tests conducted for people in age group \(i\) in specified region \(r\) at time atep \(t_k\), \(k_{sens}\) and \(k_{spec}\) are the sensitivity and specificity respectively of a test, while is the probability of demise \(k-l\) days after infection and \(\delta_{r,t_l,i}^{infec}\) is the number of new infections in specified region, for age group \(i\) on day \(t_l\).
It uses an output of the simulation method for the WarwickLancSEIRModel, taking all the rest of the parameters necessary for the computation from the way its simulation has been fitted.
- Parameters:
output (numpy.array) – Age-structured output matrix of the simulation method for the WarwickLancSEIRModel.
tests (list) – List of conducted tests in specified region and at time point k classifed by age groups.
sens (float or int) – Sensitivity of the test (or ratio of true positives).
spec (float or int) – Specificity of the test (or ratio of true negatives).
k (int) – Index of day for which we intend to sample the number of positive test results by age group.
- Returns:
Age-structured matrix of sampled number of positive test results in specified region at time \(t_k\).
- Return type:
numpy.array
Notes
Always run
WarwickLancSEIRModel.simulate()andWarwickLancSEIRModel.check_positives_format()before running this one.
- set_age_groups(age_groups)[source]¶
Sets age group names and counts their number.
- Parameters:
age_groups (list) – List of age group names considered by the model.
- set_outputs(outputs)[source]¶
Checks existence of outputs and selects only those remaining.
- Parameters:
outputs (list) – List of output names that are selected.
- set_regions(regions)[source]¶
Sets region names.
- Parameters:
regions (list) – List of region names considered by the model.
- simulate(parameters)[source]¶
Simulates the Warwick-Lancaster model using a
ParametersControllerfor the model parameters.Extends the
_split_simulate(). Always apply methodsset_regions(),set_age_groups(),read_contact_data()andread_regional_data()before running theWarwickLancSEIRModel.simulate().- Parameters:
parameters (ParametersController) – Controller class for the parameters used by the forward simulation of the model.
- Returns:
Age-structured output matrix of the simulation for the specified region.
- Return type:
numpy.array