Skip to content

Include calculations of the net present value of flows in output_tables.py #1131

Description

@jdebacker

It's proved useful in many projects to compute the next present value of the changes in flow variables such as GDP. It'd be helpful to easily create such a table with output_tables.py.

The cost could look like something from the Cost of Disease repo:

# Find NPV of levels of GDP over NUM_YEARS_NPV years
    results_NPV = {"Discount Rate": [r"1\%", r"2\%", r"3\%", r"4\%", r"6\%"]}
    npv_dict = {
        "Discount Rate": [0.01, 0.02, 0.03, 0.04, 0.06],
        "Discount Rate Label": [r"1\%", r"2\%", r"3\%", r"4\%", r"6\%"],
    }
    for k in reform_dict.keys():
        results_NPV[k] = []
        for r in npv_dict["Discount Rate"]:
            results_NPV[k].append(
                (
                    GDP_series["Diffs"][k][:NUM_YEARS_NPV]
                    / (1 + r) ** np.arange(NUM_YEARS_NPV)
                ).sum()
                / 1e9  # convert to billions of dollars
            )

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions