Generating simulated data with UCIWWEIHR ODE compartmental based model.
This package provides a way to also simulate data using the UCIWWEIHR ODE compartmental based model specified in the future paper. The function called generate_simulation_data_uciwweihr.jl
can be used to generate synthetic data for a given number of samples and features. Here we provide a demonstration using the default settings of generate_simulation_data_uciwweihr.jl
:
1. Functionality.
using UCIWWEIHR
using Plots
# Running simulation function with defaults
params = create_uciwweihr_sim_params()
df = generate_simulation_data_uciwweihr(params)
first(df, 5)
Row | obstimes | log_ww_conc | hosp | rt | wt | E_ode_comp_sol | I_ode_comp_sol | H_ode_comp_sol |
---|---|---|---|---|---|---|---|---|
Int64 | Float64 | Int64 | Float64 | Float64 | Float64 | Float64 | Float64 | |
1 | 1 | 0.0882519 | 17 | 0.99777 | 0.349492 | 200.0 | 100.0 | 20.0 |
2 | 2 | 0.407202 | 21 | 1.01468 | 0.353323 | 170.442 | 129.53 | 21.6357 |
3 | 3 | 0.416729 | 25 | 0.989119 | 0.347515 | 150.77 | 149.497 | 24.1411 |
4 | 4 | 0.829472 | 30 | 1.06904 | 0.365335 | 137.051 | 162.981 | 26.8269 |
5 | 5 | 0.75552 | 35 | 1.10915 | 0.373918 | 129.444 | 172.241 | 29.9119 |
1.2 Visualizing UCIWWEIHR model results.
Here we can make simple plots to visualize the data generated using the Plots package.
1.2.1. Concentration of pathogen genome in wastewater(WW).
plot(df.obstimes, df.log_ww_conc,
label=nothing,
xlabel="Obstimes",
ylabel="Conc. of Pathogen Genome in WW",
title="Plot of Conc. of Pathogen Genome in WW Over Time")
1.2.2. Hospitalizations.
plot(df.obstimes, df.hosp,
label=nothing,
xlabel="Obstimes",
ylabel="Hosp",
title="Plot of Hosp Over Time")
1.2.3. Reproductive number.
plot(df.obstimes, df.rt,
label=nothing,
xlabel="Obstimes",
ylabel="Rt",
title="Plot of Rt Over Time")
1.2.4. Hospitalization rate.
plot(df.obstimes, df.wt,
label=nothing,
xlabel="Obstimes",
ylabel="Rt",
title="Plot of Hospitalization Rate Over Time")
2. Alternate Functionality.
We can also use a prespecified effective repordcution number curve or a prespecified hospitaliation probability curve. Any combintation of presepcified or random walk curves can be used. Here we provide an example of using both a prespecified effective reproduction number curve and a prespecified hospitalization probability curve.
using UCIWWEIHR
using Plots
# Running simulation function with prespecified Rt and hospitalization probability
rt_custom = vcat(
range(1, stop=1.8, length=7*4),
fill(1.8, 7*2),
range(1.8, stop=1, length=7*8),
range(0.98, stop=0.8, length=7*2),
range(0.8, stop=1.1, length=7*6),
range(1.1, stop=0.97, length=7*3)
)
w_custom = vcat(
range(0.3, stop=0.38, length=7*5),
fill(0.38, 7*2),
range(0.38, stop=0.25, length=7*8),
range(0.25, stop=0.28, length=7*2),
range(0.28, stop=0.34, length=7*6),
range(0.34, stop=0.28, length=7*2)
)
params = create_uciwweihr_sim_params(
time_points = length(rt_custom),
Rt = rt_custom,
w = w_custom
)
df = generate_simulation_data_uciwweihr(params)
first(df, 5)
Row | obstimes | log_ww_conc | hosp | rt | wt | E_ode_comp_sol | I_ode_comp_sol | H_ode_comp_sol |
---|---|---|---|---|---|---|---|---|
Int64 | Float64 | Int64 | Float64 | Float64 | Float64 | Float64 | Float64 | |
1 | 1 | 0.0882519 | 17 | 1.0 | 0.3 | 200.0 | 100.0 | 20.0 |
2 | 2 | 0.407232 | 24 | 1.02963 | 0.302353 | 170.472 | 129.534 | 20.8895 |
3 | 3 | 0.417008 | 26 | 1.05926 | 0.304706 | 151.061 | 149.538 | 22.6036 |
4 | 4 | 0.831089 | 33 | 1.08889 | 0.307059 | 138.675 | 163.245 | 24.7014 |
5 | 5 | 0.759119 | 26 | 1.11852 | 0.309412 | 131.196 | 172.862 | 26.9223 |
2.2 Visualizing UCIWWEIHR model results.
We can visualize these results using the Plots package.
2.2.1. Concentration of pathogen genome in wastewater(WW).
plot(df.obstimes, df.log_ww_conc,
label=nothing,
xlabel="Obstimes",
ylabel="Conc. of Pathogen Genome in WW",
title="Plot of Conc. of Pathogen Genome in WW Over Time")
2.2.2. Hospitalizations.
plot(df.obstimes, df.hosp,
label=nothing,
xlabel="Obstimes",
ylabel="Hosp",
title="Plot of Hosp Over Time")
2.2.3. Reproductive number.
plot(df.obstimes, df.rt,
label=nothing,
xlabel="Obstimes",
ylabel="Rt",
title="Plot of Rt Over Time")
2.2.4. Hospitalization rate.
plot(df.obstimes, df.wt,
label=nothing,
xlabel="Obstimes",
ylabel="Rt",
title="Plot of Hospitalization Rate Over Time")