Opioid Epidemic

State

class whynot.simulators.opioid.State[source]

State of the opioid simulator.

Default values correspond to the mean initial state used in the Chen paper.

illicit_users = 328371

Illicit opioid users (e.g. users of heroin/fentanyl as opposed to presciption opioids)

nonmedical_users = 10029859

Non-medical users of prescription opioids

oud_users = 1369218

Non-medical users of prescription opioid with prescription opioid use disorder.

Config

class whynot.simulators.opioid.Config[source]

Parameterization of the dynamics for opioid epidemic simulator.

By default, the confiruation uses the mean parameter values specified in eTable 4 and the pessimistic-case scenario (overdose mortality and incidence for illicit use stabilizes in 2025) and considers the scenario with no improvement in incidence after 2015.

Examples

>>> # Standard run of the dynamics with slightly rate of overdose
>>> # deaths from nonmedial opioids.
>>> opioid.Config(start_time=2002, end_time=2030, nonmedical_overdose=0.002)
delta_t = 0.1

Resolution of the recorded simulator output (in years)

end_time = 2030

Time to end the simulation (in years)

illicit_exit = 0.319

“Exit rate” of illicit opioid users.

illicit_incidence = <whynot.simulators.opioid.simulator.TimeVaryingParam object>

Annual incidence of illicit opioid use from sources other than prescription opioids.

illicit_overdose = <whynot.simulators.opioid.simulator.TimeVaryingParam object>

Overdose mortality rate for illicit opioid use.

nonmedical_exit = 0.177

“Exit rate” from nonmedical users group. (Either stop using or die from non-opioid causes).

nonmedical_incidence = <whynot.simulators.opioid.simulator.TimeVaryingParam object>

Annual incidence of nonmedical prescription opioid use.

nonmedical_overdose = 0.001

Overdose mortality rate for nonmedial prescription opioid use.

nonmedical_to_illicit = 0.002

Annual transition rate of nonmedial to illicit opioid users

nonmedical_to_oud = 0.06

Annual transition rate of non-medical opioid use to opioid use disorder.

oud_exit = <whynot.simulators.opioid.simulator.TimeVaryingParam object>

“Exit rate” from opioid user disorder group.

oud_overdose = <whynot.simulators.opioid.simulator.TimeVaryingParam object>

Overdose mortality rate for opioid use disorder.

oud_to_illicit = <whynot.simulators.opioid.simulator.TimeVaryingParam object>

Annual transition rate of users with opioid user disorder to illicit opioid users.

start_time = 2002

Time to start the simulation (in years)

update(intervention)[source]

Return a new config after applying intervention.

class whynot.simulators.opioid.simulator.TimeVaryingParam(baseline, alpha_1, joinpoint=None, alpha_2=None, intervention_year=None, intervention_val=0.0, start_year=2002, stabilize_year=None)[source]

Encapsulate a time-varying parameter obtained from a joinpoint model.

__init__(baseline, alpha_1, joinpoint=None, alpha_2=None, intervention_year=None, intervention_val=0.0, start_year=2002, stabilize_year=None)[source]

Specify a joinpoint model for a time-varying parameter.

Parameters:
  • baseline (float) – Baseline value at initial time point
  • alpha_1 (float) – Annual percentage change (APC) before joinpoint
  • joinpoint (float) – (Optional) time indicating signifcant change in APC
  • alpha_2 (float) – (Optional) Annual percentage change (APC) after joinpoint
  • intervention_year (float) – (Optional) Year to intervene on the APC
  • intervention_val (float) – (Optional) New value for the APC after intevention. Default 0 is no change.
  • start_year (float) – (Optional) initial time point
  • stabilize_year (float) – (Optional) Year (after 2015) to set APC decrease to 0.

Interventions

class whynot.simulators.opioid.Intervention[source]

Intervention parameters for opioid epidemic simulator.

Currently, the simulator only supports interventions to reduce nonmedical and illicit opioid use because these are the only interventions considered in the originl Chen et al. paper.

Examples

>>> # Intervene in 2017 to reduce nonmedical incidence by 5%
>>> opioid.Intervention(nonmedical_incidence=-0.05, time=2017)

Experiments

Basic experiments for opioid simulator.

whynot.simulators.opioid.experiments.RCT = opioid_rct

RCT on the opioid simulator to see how reducing nonmedical opioid use reduces overdose deaths.

whynot.simulators.opioid.experiments.Confounding = confounded_opioid_experiment

Observational version of RCT with confounding on observed nonmedical use overdose deaths.

whynot.simulators.opioid.experiments.UnobservedConfounding = unobserved_confounding_opioid_experiment

Observational version of RCT with unobserved confounding on nonmedical use overdose deaths.

whynot.simulators.opioid.experiments.Mediation = opioid_mediation

Observational version of RCT with mediation induced by observing future states.