Using EpiEconShocks.jl with realistic epidemic outcomes
This example shows how to use EpiEconShocks.jl with realistic epidemic model outputs.
We use the Julia implementation of the Daedalus model provided in Daedalus.jl to provide epidemic trajectories for this example.
Note that this is a proof-of-concept and a work in progress.
using Daedalus
using EpiEconShocks
using Plots
output = daedalus("United Kingdom", "influenza 2009", time_end=100.0);
horizon = 100
workers = sum(Daedalus.DataLoader.get_country("United Kingdom").workers)
# get cumulative number of infectious symptomatic, hospitalised, and dead
# in each quarter
working_groups = 5:49
labour_loss = sum(
Daedalus.Outputs.get_values(output, "Is", horizon, working_groups) .+
Daedalus.Outputs.get_values(output, "H", horizon, working_groups) .+
Daedalus.Outputs.get_values(output, "D", horizon, working_groups)
)
labour_prop_loss = labour_loss / (workers * horizon)
labour_available = 1.0 - labour_prop_loss0.9921644896953428Next we pass the proportional losses in labour supply to the function shock_gtap() to compute new equilibria for each level of available labour supply.
# pass a shock to a model using example data and view outputs
# assumes equal shocks to all regions
example_model = EpiEconShocks.Example.get_example_model();
labour_shock = ParameterShock(
"qe", ["skilled labor", "unskilled labor"], labour_available
)
output = EpiEconShocks.Example.shock_gtap_example(example_model, [labour_shock]);
comparisons = compare_gtaps(example_model, output)
comparisons.y7×1 Named Matrix{Float64}
A ╲ B │ 1
───────────────────┼──────────
oceania │ 1.42881e6
asis │ 2.29668e7
americas │ 2.44092e7
eu │ 1.32398e7
other europe │ 5.48657e6
mena │ 3.73011e6
sub-saharan africa │ 1.58478e6comparisons.ev7×1 Named Matrix{Float64}
A ╲ B │ 1
───────────────────┼───────────
oceania │ -6546.96
asis │ -98230.0
americas │ -1.10408e5
eu │ -57260.9
other europe │ -24271.8
mena │ -14458.0
sub-saharan africa │ -6257.97comparisons.delta_gdp7-element Named NamedArrays.NamedVector{Float64, Vector{Float64}, Tuple{OrderedCollections.OrderedDict{String, Int64}}}
A │
───────────────────┼────────────
oceania │ -0.00437253
asis │ -0.00434868
americas │ -0.00452007
eu │ -0.00440987
other europe │ -0.00432656
mena │ -0.00337801
sub-saharan africa │ -0.00373156