Fertility Models

This module contains several different models of fertility.

class vivarium_public_health.population.add_new_birth_cohorts.FertilityDeterministic[source]

Deterministic model of births.

CONFIGURATION_DEFAULTS: Dict[str, Any] = {'fertility': {'number_of_new_simulants_each_year': 1000}}

A dictionary containing the defaults for any configurations managed by this component. An empty dictionary indicates no managed configurations.

setup(builder)[source]

Defines custom actions this component needs to run during the setup lifecycle phase.

This method is intended to be overridden by subclasses to perform any necessary setup operations specific to the component. By default, it does nothing.

Parameters:

builder (Builder) – The builder object used to set up the component.

Return type:

None

on_time_step(event)[source]

Adds a set number of simulants to the population each time step.

Parameters:

event (Event) – The event that triggered the function call.

Return type:

None

class vivarium_public_health.population.add_new_birth_cohorts.FertilityCrudeBirthRate[source]

Population-level model of births using crude birth rate.

The number of births added each time step is calculated as

new_births = sim_pop_size_t0 * live_births / true_pop_size * step_size

Where

sim_pop_size_t0 = the initial simulation population size live_births = annual number of live births in the true population true_pop_size = the true population size

This component has configuration flags that determine whether the live births and the true population size should vary with time.

Notes

The OECD definition of crude birth rate can be found on their website, while a more thorough discussion of fertility and birth rate models can be found on Wikipedia or in demography textbooks.

CONFIGURATION_DEFAULTS: Dict[str, Any] = {'fertility': {'time_dependent_live_births': True, 'time_dependent_population_fraction': False}}

A dictionary containing the defaults for any configurations managed by this component. An empty dictionary indicates no managed configurations.

setup(builder)[source]

Defines custom actions this component needs to run during the setup lifecycle phase.

This method is intended to be overridden by subclasses to perform any necessary setup operations specific to the component. By default, it does nothing.

Parameters:

builder (Builder) – The builder object used to set up the component.

Return type:

None

on_time_step(event)[source]

Adds new simulants every time step based on the Crude Birth Rate and an assumption that birth is a Poisson process :param event: The event that triggered the function call.

Parameters:

event (Event) –

Return type:

None

class vivarium_public_health.population.add_new_birth_cohorts.FertilityAgeSpecificRates[source]

A simulant-specific model for fertility and pregnancies.

property columns_created: List[str]

Provides names of columns created by the component.

Returns:

Names of the columns created by this component, or an empty list if none.

Return type:

List[str]

property columns_required: List[str] | None

Provides names of columns required by the component.

Returns:

Names of required columns not created by this component. An empty list means all available columns are needed. None means no additional columns are necessary.

Return type:

Optional[List[str]]

property initialization_requirements: Dict[str, List[str]]

Provides the names of all values required by this component during simulant initialization.

Returns:

A dictionary containing the additional requirements of this component during simulant initialization. An omitted key or an empty list for a key implies no requirements for that key during initialization.

Return type:

Dict[str, List[str]]

setup(builder)[source]

Setup the common randomness stream and age-specific fertility lookup tables. :param builder: Framework coordination object. :type builder: vivarium.engine.Builder

Parameters:

builder (Builder) –

Return type:

None

load_age_specific_fertility_rate_data(builder)[source]
Parameters:

builder (Builder) –

Return type:

DataFrame

on_initialize_simulants(pop_data)[source]

Adds ‘last_birth_time’ and ‘parent’ columns to the state table.

Parameters:

pop_data (SimulantData) –

Return type:

None

on_time_step(event)[source]

Produces new children and updates parent status on time steps. :param event: The event that triggered the function call. :type event: vivarium.population.PopulationEvent

Parameters:

event (Event) –

Return type:

None