# Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Vertical Transmission Models |

Vertical transmission models allow individuals to enter infected compartments at recruitment (birth). This is sometimes called congenital infection. Compartmental models with vertical transmission can be implemented manually by specifying appropriate rate expressions in source transitions or automatically by specifying birth compartments to the functions or .

DynamicTransitionModel

Vertical transmission occurs when progeny of infected individuals are recruited into the population. Typically, the vertical transmission occurs with a probability less than 1. The symbol is used here to represent the fraction of recruitment that occurs with transmission, and for the fraction that occurs without transmission.

χ

1-χ

A simple SIR model is used only for consistency across the examples. Other types of compartmental models can be used as needed for the problem at hand.

Load the paclet:

In[14]:=

Needs["RobertNachbar`EpidemiologyModeling`"]

Age-agnostic models

ViralDemographicsModel

returns an expanded list of transitions tr i bc i r i | |

returns an expanded list of transitions tr i bc i sc ij r i |

Adding vital demographics to a compartmental model.

Vertical transmission involves individuals from infected compartments, so the second form of the recruitment rate model that includes source compartments needs to be used.

Compartment-specific recruitment rate method

Compartment-specific recruitment rates are used when the rate depends on the type of compartment, for example male vs female or healthy vs diseased. Contributions from infected compartments are modulated by or . The final recruitment rates are computed as the sum of the source compartment () sizes multiplied by the specified rate ().

χ

1-χ

sc

ij

r

i

In the model below, the recruitment into the ℐ compartment represents the vertical transmission and is specified as ℐ -> {{ℐ}, χ }, and the resulting transition rate is χ ℐ[t]. There are two different sources of recruitment into the compartment. The first source is from the and ℛ compartments, and is specified as -> {{, ℛ}, } with the resulting transition rate of (ℛ[t] + [t]). The second source is from the ℐ compartment without vertical transmission, and is specified as -> {{ℐ}, (1 - χ) } with the resulting transition rate of (1 - χ) ℐ[t].

Define the SIR model transitions and the compartments for compartment-specific recruitment rates:

In[104]:=

model=

ℐ,ℐℛ,{ℐ{{ℐ},χ},{{,ℛ},},{{ℐ},(1-χ)}}

VitalDemographicsModel |

βλ[t]

→

γ

→

Out[104]=

,ℐ,,ℐℛ,ℐ,ℛ,,ℐ

(1-χ)ℐ[t]

↦

χℐ[t]

↦

(ℛ[t]+[t])

↦

γ

→

μ

⇥

μ

⇥

μ

⇥

βλ[t]

→

The compartmental model graph is a good visual check.

Make the compartmental model graph:

In[107]:=

CompartmentalModelGraph |

options |

Out[107]=

Total recruitment rate method

If the total recruitment rate for the whole population is , then the contribution from compartment is , where is the total population size. Contributions from infected compartments are modulated by or . The final recruitment rates are computed as the sum of the source compartment () sizes multiplied by the specified rate ().

Λ

sc

j

Λ(t)

sc

j

(t)

(t)

χ

1-χ

sc

ij

r

i

In the model below, the recruitment into the ℐ compartment represents the vertical transmission and is specified as ℐ -> {{ℐ}, Λ/[t]}, and the resulting transition rate is ( Λ ℐ[t])/[t]. There are two different sources of recruitment into the compartment. The first source is from the and ℛ compartments, and is specified as -> {{, ℛ}, Λ/[t]} with the resulting transition rate of Λ(ℛ[t]+[t])/[t]. The second source is from the ℐ compartment without vertical transmission, and is specified as -> {{ℐ}, (1 - ) Λ/[t]} with the resulting transition rate of ((1 - ) Λ ℐ[t])/[t].

Define the SIR model transitions and the compartments for recruitment (births):

In[108]:=

model=

ℐ,ℐℛ,{ℐ{{ℐ},Λ/[t]},{{,ℛ},Λ/[t]},{{ℐ},(1-)Λ/[t]}}

VitalDemographicsModel |

βλ[t]

→

γ

→

Out[108]=

,ℐ,,ℐℛ,ℐ,ℛ,,ℐ

(1-)Λℐ[t]

[t]

↦

Λℐ[t]

[t]

↦

Λ(ℛ[t]+[t])

[t]

↦

γ

→

μ

⇥

μ

⇥

μ

⇥

βλ[t]

→

The compartmental model graph is a good visual check.

Make the compartmental model graph:

In[111]:=

CompartmentalModelGraph |

options |

Out[111]=

The total recruitment rate should equal Λ, and that can be checked with the following code.

Select the recruitment transitions and compute the sum of their rates:

In[24]:=

Casesmodel,_rate/.[t][t]+ℐ[t]+ℛ[t]//Total//Simplify

rate_

↦

Out[24]=

Λ

Age-stratified models

DynamicTransitonModel

returns an association of model data for the input transitions in tr i t |

Adding vital demographics to a compartmental model along with age stratification of model transitions.

The options relevant for recruitment and age stratification are show below.

"BirthCompartments" | a list rules { bc i r i { bc i sc ij r i bc i sc ij r i |

"AgeStratification" | a list {symb,n} symb n |

"AgeStratifiedParameters" | a list of parameters to stratify by age along with the compartments; integers are used for the indices |

Options for needed for recruitment and age stratification.

DynamicTransitionModel

Compartment-specific recruitment rate method

Compartment-specific recruitment rates are used when the rate depends on the type of compartment, for example male vs female or healthy vs diseased. Contributions from infected compartments are modulated by or . The final recruitment rates are computed as the sum of the source compartment () sizes multiplied by the specified rate ().In the model below, the recruitment rates are specified with the option "ForceOfInfection". The recruitment into the ℐ compartment represents the vertical transmission and is specified as ℐ -> {{ℐ}, χ }, and the resulting transition rate is χ ℐ[t]. There are two different sources of recruitment into the compartment. The first source is from the and ℛ compartments, and is specified as -> {{, ℛ}, } with the resulting transition rate of (ℛ[t] + [t]). The second source is from the ℐ compartment without vertical transmission, and is specified as -> {{ℐ}, (1 - χ) } with the resulting transition rate of (1 - χ) ℐ[t].

χ

1-χ

sc

ij

r

i

The option "AgeStratification" -> {α, 3} specifies that will be the age group transfer rate and that there are 3 age groups in the model. The option "AgeStratifiedParameters" -> {, } specifies that the age-stratified recruitment rate parameters are and .

α

i

$i

$i

Define the SIR model transitions and the compartments for compartment- and age-specific recruitment rates:

In[100]:=

modelData=

ℐ,ℐℛ,t,"ForceOfInfection"{λ,{ℐ}},"BirthCompartments"{ℐ{{ℐ},χ},{{,ℛ},},{{ℐ},(1-χ)}},"AgeStratification"{α,3},"AgeStratifiedParameters"{,};

DynamicTransmissionModel |

βλ[t]

→

γ

→

The compartmental model graph is a good visual check.

Make the compartmental model graph:

In[94]:=

CompartmentalModelGraph |

options |

wrap edge labels |

Out[94]=

Total recruitment rate method

In the model below, the recruitment rates are specified with the option "ForceOfInfection". The recruitment into the ℐ compartment represents the vertical transmission and is specified as ℐ -> {{ℐ}, Λ/[t]}, and the resulting transition rate is ( Λ ℐ[t])/[t]. There are two different sources of recruitment into the compartment. The first source is from the and ℛ compartments, and is specified as -> {{, ℛ}, Λ/[t]} with the resulting transition rate of Λ(ℛ[t]+[t])/[t]. The second source is from the ℐ compartment without vertical transmission, and is specified as -> {{ℐ}, (1 - ) Λ/[t]} with the resulting transition rate of ((1 - ) Λ ℐ[t])/[t].

Define the SIR model transitions and the compartments for recruitment (births):

The compartmental model graph is a good visual check.

Make the compartmental model graph:

The total recruitment rate should equal Λ, and that can be checked with the following code.

Select the recruitment transitions and compute the sum of their rates: