leap.utility module

class leap.utility.Utility(config: dict | None = None, parameters: dict | None = None, table: DataFrameGroupBy | None = None)[source]

Bases: object

A class containing information about the disutility from having asthma.

parameters

A dictionary containing the following keys:

  • βcontrol: A vector of 3 parameters to be multiplied by the control levels, i.e.

    βcontrol1 * fully_controlled +
    βcontrol2 * partially_controlled +
    βcontrol3 * uncontrolled
    
  • βexac_sev_hist: A vector of 4 parameters to be multiplied by the exacerbation severity history, i.e.

    βexac_sev_hist1 * mild + βexac_sev_hist2 * moderate +
    βexac_sev_hist3 * severe + βexac_sev_hist4 * very_severe
    
table

A grouped data frame grouped by age and sex, containing information about EuroQol Group’s quality of life metric called the EQ-5D. Each data frame contains the following columns:

  • age (int): integer age, range [0, 111].

  • sex (str): sex of a person, either “M” or “F”.

  • eq5d (float): the quality of life.

  • sd (float): standard deviation of the eq5d value.

See processed_data/eq5d_canada.csv.

property parameters : dict

A dictionary containing the following keys:

  • βcontrol: A vector of 3 parameters to be multiplied by the control levels, i.e.

    βcontrol1 * fully_controlled +
    βcontrol2 * partially_controlled +
    βcontrol3 * uncontrolled
    
  • βexac_sev_hist: A vector of 4 parameters to be multiplied by the exacerbation severity history, i.e.

    βexac_sev_hist1 * mild + βexac_sev_hist2 * moderate +
    βexac_sev_hist3 * severe + βexac_sev_hist4 * very_severe
    
load_eq5d() DataFrameGroupBy[source]
compute_utility(agent: Agent) float[source]

Compute the utility for the current year due to asthma exacerbations and control.

If the agent (person) doesn’t have asthma, return the baseline utility.

Parameters:
agent: Agent

A person in the model.