CurrentModule = Daedalus
This is some minimal documentation for Daedalus.jl.
Daedalus.jl is a Julia package that aims to mirror the R package {daedalus}.
This section shows how to run the Daedalus Julia model. Functionality compared to the R package is limited.
Daedalus.jl can be installed from GitHub using the Julia package manager Pkg.jl.
using Pkg
Pkg.add(url="git@github.com:pratikunterwegs/Daedalus.jl.git")using Daedalus
using Plots
# pump up r0 to get peak within 50 days
infection = Daedalus.DataLoader.get_pathogen("sars-cov-2 delta")
infection.r0 = 5.0
data = daedalus("Canada", infection, time_end=600.0);
# plot exposed group
times = Daedalus.Outputs.get_times(data)
# functiong get_values() bins into 90 days by default, set to 1 for no binning
exposed = Daedalus.Outputs.get_values(data, "E", 1)
hosp = Daedalus.Outputs.get_values(data, "H", 1)
# plot the output to see lag in hospitalisations
plot(times, exposed, label="exposed")
plot!(times, hosp, label="hosp")
xlabel!("Time (days)")
ylabel!("# individuals")
# plot recorded Rt
vecRt = Daedalus.Outputs.get_values(data, "Rt", 1)
plot(times, vecRt, label="Rt")
xlabel!("Time (days)")
ylabel!("Rt")
Pass a country name string directly to daedalus to use country-specific demography, contact patterns, and workforce data.
using Daedalus
using Plots
# Run the model using UK demography and contact patterns
infection_uk = Daedalus.DataLoader.get_pathogen("sars-cov-2 delta")
infection_uk.r0 = 2.5
data_uk = daedalus("United Kingdom", infection_uk, time_end=600.0)
times_uk = Daedalus.Outputs.get_times(data_uk)
exposed_uk = Daedalus.Outputs.get_values(data_uk, "E", 1)
hosp_uk = Daedalus.Outputs.get_values(data_uk, "H", 1)
plot(times_uk, exposed_uk, label = "exposed")
plot!(times_uk, hosp_uk, label = "hospitalised")
xlabel!("Time (days)")
ylabel!("# individuals")
title!("United Kingdom — SEIR dynamics")
# Effective reproduction number over time
rt_uk = Daedalus.Outputs.get_values(data_uk, "Rt", 1)
plot(times_uk, rt_uk, label = "Rt", color = :red)
hline!([1.0], linestyle = :dash, color = :black, label = "Rt = 1")
xlabel!("Time (days)")
ylabel!("Rt")
title!("United Kingdom — effective reproduction number")
See Country and pathogen data for a full overview of the bundled data and how to use pathogen-specific parameters.