The Core Mortality Model

Summary

The mortality component models all cause mortality and allows for disease models to contribute cause specific mortality. At each timestep the currently “alive” population is subjected to a mortality event using the mortality rate to determine probabilities of death for each simulant. A weighted probable cause of death is used to choose the cause of death. The years of life lost are calculated by subtracting a simulant’s age from the population TMRLE and the population is updated.

Columns Created

  • cause_of_death

  • years_of_life_lost

Pipelines Exposed

  • cause_specific_mortality_rate

  • mortality_rate

  • affected_unmodeled.cause_specific_mortality_rate

  • affected_unmodeled.cause_specific_mortality_rate.paf

All cause mortality is read from the artifact (GBD). At setup cause specific mortality is initialized to an empty table. As disease models are registered, they affect cause specific mortality by means of the cause_specific_mortality_rate pipeline. This is population level data.

If there are causes of death which are unmodeled, but may be impacted by some modeled entity, they can be specified using the configuration key “unmodeled_causes”.

The mortality component’s mortality_rate pipeline reflects the cause deleted mortality rate (ACMR - CSMR). Then the impact of unmodeled causes on mortality is calculated, by subtracting the raw unmodeled csmr before adding back the modified unmodeled csmr.

class vivarium_public_health.population.mortality.Mortality[source]
CONFIGURATION_DEFAULTS: Dict[str, Any] = {'unmodeled_causes': []}

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

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 time_step_priority: int

Provides the priority of this component’s time_step listener.

Returns:

The priority of this component’s time_step listener. This value can range from 0 to 9, inclusive.

Return type:

int

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

get_randomness_stream(builder)[source]
Return type:

RandomnessStream

get_cause_specific_mortality_rate(builder)[source]
Parameters:

builder (Builder) –

Return type:

Pipeline

get_mortality_rate(builder)[source]
Parameters:

builder (Builder) –

Return type:

Pipeline

get_all_cause_mortality_rate(builder)[source]

Load all cause mortality rate data and build a lookup table or pipeline.

Parameters:

builder (Builder) – Interface to access simulation managers.

Returns:

A lookup table or pipeline returning the all cause mortality rate.

Return type:

Union[LookupTable, Pipeline]

get_life_expectancy(builder)[source]

Load life expectancy data and build a lookup table or pipeline.

Parameters:

builder (Builder) – Interface to access simulation managers.

Returns:

A lookup table or pipeline returning the life expectancy.

Return type:

Union[LookupTable, Pipeline]

get_raw_unmodeled_csmr(builder)[source]

Load unmodeled cause specific mortality rate data and build a lookup table or pipeline.

Parameters:

builder (Builder) – Interface to access simulation managers.

Returns:

A lookup table or pipeline returning the unmodeled csmr.

Return type:

Union[LookupTable, Pipeline]

get_unmodeled_csmr(builder)[source]
Parameters:

builder (Builder) –

Return type:

Pipeline

get_unmodeled_csmr_paf(builder)[source]
Parameters:

builder (Builder) –

Return type:

Pipeline

on_initialize_simulants(pop_data)[source]

Method that vivarium will run during simulant initialization.

This method is intended to be overridden by subclasses if there are operations they need to perform specifically during the simulant initialization phase.

Parameters:

pop_data (SimulantData) – The data associated with the simulants being initialized.

Return type:

None

on_time_step(event)[source]

Method that vivarium will run during the time_step event.

This method is intended to be overridden by subclasses if there are operations they need to perform specifically during the time_step event.

Parameters:

event (Event) – The event object associated with the time_step event.

Return type:

None

calculate_mortality_rate(index)[source]
Parameters:

index (Index) –

Return type:

DataFrame

get_unmodeled_csmr_source(index)[source]
Parameters:

index (Index) –

Return type:

Series