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)
5×11 DataFrame
Rowobstimeslog_ww_conchosphosp_incrtwtE_ode_comp_solI_ode_comp_solH_ode_comp_solCH_ode_comp_solH_ode_inc_comp_sol
Int64Float64Int64Int64Float64Float64Float64Float64Float64Float64Float64
110.08119361640.997770.349492200.0100.020.05.05.0
220.46034922101.014680.353323170.435129.5321.634310.77865.77862
330.33603425120.9891190.347515150.759149.49524.138517.85197.07325
441.0751430161.069040.365335137.042162.97526.824525.63187.77996
550.87197435121.109150.373918129.439172.23529.910434.39358.76168

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")
Example block output

1.2.2. Hospitalizations.

plot(df.obstimes, df.hosp,
    label=nothing,
    xlabel="Obstimes",
    ylabel="Hosp",
    title="Plot of Hosp Over Time")
Example block output

1.2.3. Reproductive number.

plot(df.obstimes, df.rt,
    label=nothing,
    xlabel="Obstimes",
    ylabel="Rt",
    title="Plot of Rt Over Time")
Example block output

1.2.4. Hospitalization rate.

plot(df.obstimes, df.wt,
    label=nothing,
    xlabel="Obstimes",
    ylabel="Rt",
    title="Plot of Hospitalization Rate Over Time")
Example block output

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)
5×11 DataFrame
Rowobstimeslog_ww_conchosphosp_incrtwtE_ode_comp_solI_ode_comp_solH_ode_comp_solCH_ode_comp_solH_ode_inc_comp_sol
Int64Float64Int64Int64Float64Float64Float64Float64Float64Float64Float64
110.08119361771.00.3200.0100.020.05.05.0
220.4603792341.029630.302353170.466129.53420.88919.959924.95992
330.3363012431.059260.304706151.049149.53522.602516.01386.05387
441.076751531.088890.307059138.662163.23924.700222.83876.82495
550.8755592691.118520.309412131.194172.85426.921730.22277.38398

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")
Example block output

2.2.2. Hospitalizations.

plot(df.obstimes, df.hosp,
    label=nothing,
    xlabel="Obstimes",
    ylabel="Hosp",
    title="Plot of Hosp Over Time")
Example block output

2.2.3. Reproductive number.

plot(df.obstimes, df.rt,
    label=nothing,
    xlabel="Obstimes",
    ylabel="Rt",
    title="Plot of Rt Over Time")
Example block output

2.2.4. Hospitalization rate.

plot(df.obstimes, df.wt,
    label=nothing,
    xlabel="Obstimes",
    ylabel="Rt",
    title="Plot of Hospitalization Rate Over Time")
Example block output

Tutorial Contents