diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index fcbeedb..6259a54 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2024-10-22T22:26:15","documenter_version":"1.7.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2024-10-23T00:48:40","documenter_version":"1.7.0"}} \ No newline at end of file diff --git a/dev/index.html b/dev/index.html index 55b2eeb..6cb845d 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,3 +1,3 @@ HOME · UCIWWEIHR.jl

UCIWWEIHR.jl

Welcome to the UCIWWEIHR.jl package documentation! CURRENTLY UNDER DEVELOPMENT!!!

By : Christian O. Bernal Zelaya & Volodymyr M. Minin.

Introduction

UCIWWEIHR.jl is a Julia package for forecasting and nowcasting COVID-19 hospitalizations using pathogen genome concentrations. UCIWWEIHR.jl Package License

Features

  • Comprehensive library of Bayesian models
  • Simulation of infectious disease
  • Model calibration
  • Sensitivity analysis and uncertainty quantification?
  • Visualization of results and MCMC evaluations(live?)

Installation

To install UCIWWEIHR.jl, you can use the Julia package manager. Open the Julia REPL and run the following command:

using Pkg
-Pkg.add("https://github.com/cbernalz/UCIWWEIHR.jl.git")
+Pkg.add("https://github.com/cbernalz/UCIWWEIHR.jl.git") diff --git a/dev/license/index.html b/dev/license/index.html index f456d5b..323e675 100644 --- a/dev/license/index.html +++ b/dev/license/index.html @@ -1,2 +1,2 @@ -LICENSE · UCIWWEIHR.jl

UCIWWEIHR.jl Package License

The UCIWWEIHR.jl package is licensed under the MIT License.

MIT License

MIT License

Copyright (c) 2024 Christian O. Bernal Zelaya

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+LICENSE · UCIWWEIHR.jl

UCIWWEIHR.jl Package License

The UCIWWEIHR.jl package is licensed under the MIT License.

MIT License

MIT License

Copyright (c) 2024 Christian O. Bernal Zelaya

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/dev/reference/index.html b/dev/reference/index.html index 6b97088..0aa67f4 100644 --- a/dev/reference/index.html +++ b/dev/reference/index.html @@ -1,4 +1,4 @@ -REFERENCE · UCIWWEIHR.jl

Reference

Contents

Index

UCIWWEIHR.uciwweihr_model_paramsType
uciwweihr_model_params

Struct for holding parameters used in the UCIWWEIHR ODE compartmental model. Use create_uciwweihr_model_params to create an instance of this struct.

Fields

  • E_init_sd::Float64=50.0: Standard deviation for the initial number of exposed individuals.
  • E_init_mean::Int64=200: Mean for the initial number of exposed individuals.
  • I_init_sd::Float64=20.0: Standard deviation for the initial number of infected individuals.
  • I_init_mean::Int64=100: Mean for the initial number of infected individuals.
  • H_init_sd::Float64=5.0: Standard deviation for the initial number of hospitalized individuals.
  • H_init_mean::Int64=20: Mean for the initial number of hospitalized individuals.
  • gamma_sd::Float64=0.02: Standard deviation for the rate of incubation.
  • log_gamma_mean::Float64=log(1/4): Mean for the rate of incubation on log scale.
  • nu_sd::Float64=0.02: Standard deviation for the rate of leaving the infected compartment.
  • log_nu_mean::Float64=log(1/7): Mean for the rate of leaving the infected compartment on the log scale.
  • epsilon_sd::Float64=0.02: Standard deviation for the rate of hospitalization recovery.
  • log_epsilon_mean::Float64=log(1/5): Mean for the rate of hospitalization recovery on the log scale.
  • rho_gene_sd::Float64=0.02: Standard deviation for the rho prior.
  • log_rho_gene_mean::Float64=log(0.011): Mean for the row prior on log scale.
  • sigma_wastewater::Float64=log(0.1): Standard deviation for the negative binomial distribution for wastewater data. Not infered.
  • sigma_hosp::Float64=500.0: Standard deviation for the negative binomial distribution for hospital data. Not infered.
  • Rt_init_sd::Float64=0.3: Standard deviation for the initial value of the time-varying reproduction number.
  • Rt_init_mean::Float64=0.2: Mean for the initial value of the time-varying reproduction number.
  • sigma_Rt_sd::Float64=0.2: Standard deviation for normal prior of log time-varying reproduction number standard deviation.
  • sigma_Rt_mean::Float64=-3.0: Mean for normal prior of log time-varying reproduction number standard deviation.
  • w_init_sd::Float64=0.1: Standard deviation for the initial value of the time-varying hospitalization rate.
  • w_init_mean::Float64=log(0.35): Mean for the initial value of the time-varying hospitalization rate.
  • sigma_w_sd::Float64=0.2: Standard deviation for normal prior of log time-varying hospitalization rate standard deviation.
  • sigma_w_mean::Float64=-3.5: Mean for normal prior of time-varying hospitalization rate standard deviation.
source
UCIWWEIHR.uciwweihr_sim_paramsType
uciwweihr_sim_params

Struct for holding parameters used in the UCIWWEIHR ODE compartmental model simulation. Use create_uciwweihr_sim_params to create an instance of this struct.

Fields

  • time_points::Int64: Number of time points for the simulation.
  • seed::Int64: Seed for random number generation.
  • E_init::Int64: Initial number of exposed individuals.
  • I_init::Int64: Initial number of infected individuals.
  • H_init::Int64: Initial number of hospitalized individuals.
  • gamma::Float64: Rate of incubation.
  • nu::Float64: Rate of leaving the infected compartment.
  • epsilon::Float64: Rate of hospitalization recovery.
  • rho_gene::Float64: Contribution of infected individual's pathogen genome into wastewater.
  • tau::Float64: Scale/variation of the log concentration of pathogen genome in wastewater.
  • df::Float64: Degrees of freedom for generalized t-distribution for log concentration of pathogen genome in wastewater.
  • sigma_hosp::Float64: Standard deviation for the negative binomial distribution for hospital data.
  • Rt::Union{Float64, Vector{Float64}}: Initial value or time series of the time-varying reproduction number.
  • sigma_Rt::Float64: Standard deviation for random walk of time-varying reproduction number.
  • w::Union{Float64, Vector{Float64}}: Initial value or time series of the time-varying hospitalization rate.
  • sigma_w::Float64: Standard deviation for random walk of time-varying hospitalization rate.
  • rt_init::Float64: Initial value of the time-varying reproduction number, NOT USER SPECIFIED create_uciwweihr_params TAKES CARE OF THIS.
  • w_init::Float64: Initial value of the time-varying hospitalization rate, NOT USER SPECIFIED create_uciwweihr_params TAKES CARE OF THIS.
source
UCIWWEIHR.ChainsCustomIndexMethod
ChainsCustomIndex(c::Chains, indices_to_keep::BitMatrix)

Reduce Chains object to only wanted indices.

Function created by Damon Bayer.

source
UCIWWEIHR.NegativeBinomial2Method

Create a re-parametrized negative binomial distribution in terms of mean and overdispersion.

Arguments

  • μ: Mean of the distribution.
  • ϕ: Overdispersion parameter.

Returns

A Distributions.NegativeBinomial distribution object.

source
UCIWWEIHR.calculate_quantilesMethod
calculate_quantiles(df, chain, var_prefix, quantiles)

Calculate quantiles for a given chain and variable prefix. Quantiles can be any user desired quantile.

source
UCIWWEIHR.create_uciwweihr_model_paramsMethod
create_uciwweihr_model_params(; kwargs...)

Creates a uciwweihr_sim_params struct with the option to either use a predetermined Rt and w or generate them as random walks.

Arguments

  • kwargs...: Named arguments corresponding to the fields in uciwweihr_sim_params.

Returns

  • params::uciwweihr_sim_params: A struct with simulation parameters.
source
UCIWWEIHR.create_uciwweihr_sim_paramsMethod

createuciwweihrsim_params(; kwargs...)

Creates a uciwweihr_sim_params struct with the option to either use a predetermined Rt and w or generate them as random walks.

Arguments

  • kwargs...: Named arguments corresponding to the fields in uciwweihr_sim_params.

Returns

  • params::uciwweihr_sim_params: A struct with simulation parameters.
source
UCIWWEIHR.eihr_ode!Method

eihr_ode!(du, u, p, t)

Calculate the ordinary differential equations (ODEs) for the EIHR model.

Parameters:

  • du: Array{Float64,1} - The derivative of the state variables.
  • u: Array{Float64,1} - The current state variables.
  • p: Tuple{Float64,Float64,Float64,Float64,Float64} - The model parameters (alpha, gamma, nu, w, epsilon).
  • t: Float64 - The current time.

Returns:

  • du: Array{Float64,1} - The derivative of the state variables.
source
UCIWWEIHR.generate_logit_normal_random_walkMethod
generate_logit_normal_random_walk(time_points::Int64, sigma::Float64, init_val::Float64)

Generates a logit-normal random walk time series.

Arguments

  • time_points::Int64: Number of time points.
  • sigma::Float64: Standard deviation of the random walk in logit space.
  • init_val::Float64: Initial value of the random walk on the probability scale.

Returns

  • walk::Vector{Float64}: Generated random walk on the probability scale.
source
UCIWWEIHR.generate_random_walkMethod
generate_random_walk(time_points::Int64, sigma::Float64, init_val::Float64)

Generates a random walk time series.

Arguments

  • time_points::Int64: Number of time points.
  • sigma::Float64: Standard deviation of the random walk.
  • init_val::Float64: Initial value of the random walk.

Returns

  • walk::Vector{Float64}: Generated random walk.
source
UCIWWEIHR.generate_simulation_data_agentFunction

Generating Simulation Data for Agent Based Model

To generate simulation data using the agent based model, you can use the generate_simulation_data_agent function defined in the UCIWWEIHR.jl package. This function allows you to customize various parameters for the simulation. NOT FINISHED, STILL NEEDS WW AND RT

Function Signature

Arguments

  • seed::Int64: Seed for random number generation. Default value is 1.
  • pop_size::Int64: Size of the population. Default value is 1000.
  • I_init::Int64: Initial number of infected individuals. Default value is 200.
  • H_init::Int64: Initial number of hospitalized individuals. Default value is 20.
  • beta::Float64: Transmission rate. Default value is 0.001.
  • gamma::Float64: Rate of exposed individuals becoming infectious. Default value is 1/4.
  • nu::Float64: Rate of infected individuals recovering or getting hospitalized. Default value is 1/7.
  • epsilon::Float64: Rate of hospitalized individuals recovering. Default value is 1/5.
  • w_init::Float64: Probability of an infected individual becoming hospitalized. Default value is 0.35.

Returns

  • df::DataFrame: A DataFrame containing the simulation data with columns Time, S, E, I, H, and R.
source
UCIWWEIHR.generate_simulation_data_uciwweihrMethod
generate_simulation_data(params::UCIWWEIHRParams)

Generates simulation data for the UCIWWEIHR ODE compartmental model.

Arguments

  • params::uciwweihr_sim_params: Struct containing parameters for the simulation.

Returns

  • df::DataFrame: A DataFrame containing the simulation data with columns obstimes, log_ww_conc, hosp, rt, and wt.
source
UCIWWEIHR.mcmcdiags_visMethod
mcmcdiags_vis(...)

Default visualizer for results of the UCIWWEIHR model, includes posterior/priors of generated quantities and posterior predictive samples for forecasting. Forecasting plots will have the observed data alongside.

Arguments

  • gq_samples: Generated quantities samples from the posterior/prior distribution, index 2 in uciwweihrgqpp output.
  • desired_params: A list of lists of parameters to visualize. Each list will be visualized in a separate plot. Default is [["Einit", "Iinit", "Hinit"], ["gamma", "nu", "epsilon"], ["rhogene", "tau", "df"], ["sigma_hosp"]].
  • actual_non_time_varying_vals::uciwweihr_sim_params: A uciwweihrsimparams object of actual non-time varying parameter values if user has access to them. Default is nothing.
  • save_plots::Bool=false: A boolean to indicate if user wants to save the plots as pngs into a plots folder.
  • plot_name_to_save: A string to indicate the name of the plot to save. Default is "mcmcdiagnosisplots".
source
UCIWWEIHR.non_time_varying_param_visMethod
non_time_varying_param_vis(...)

Used in the uciwweihr_visualizer to create visuals for non-time varying parameters.

Arguments

  • build_params::uciwweihr_model_params: A struct of model parameters used to build gq_samples, used only if user desired priors next to posteriors.
  • data_hosp: Hospitalization data, used only if user desired priors next to posteriors.
  • data_wastewater: Wastewater data, if model does not use this do not specify this, if user desires priors next to plot (do not specify if you do not want prior plots).
  • obstimes_hosp: An array of time points for hospital data, used only if user desired priors next to posteriors.
  • obstimes_wastewater: An array of time points for wastewater data, used only if user desired priors next to posteriors.
  • param_change_times: An array of time points where the parameters change, used only if user desired priors next to posteriors.
  • seed: An integer to set the seed for reproducibility, used only if user desired priors next to posteriors.
  • forecast: A boolean to indicate if user wants to forecast, used only if user desired priors next to posteriors.
  • forecast_weeks: An integer to indicate the number of weeks to forecast, used only if user desired priors next to posteriors.
  • gq_samples: Generated quantities samples from the posterior/prior distribution, index 2 in uciwweihrgqpp output.
  • desired_params: A list of lists of parameters to visualize. Each list will be visualized in a separate plot. Default is any parameter not in this list : ["alphat", "wt", "rtvals", "loggenes_mean", "H"]
  • actual_non_time_varying_vals::uciwweihr_sim_params: A uciwweihrsimparams object of actual non-time varying parameter values if user has access to them. Default is nothing.
  • save_plots::Bool=false: A boolean to indicate if user wants to save the plots as pngs into a plots folder.
  • plot_name_to_save: A string to indicate the name of the plot to save. Default is "mcmcnontimevaryingparameterplots".
source
UCIWWEIHR.powerMethod
power(a,b)
+REFERENCE · UCIWWEIHR.jl

Reference

Contents

Index

UCIWWEIHR.uciwweihr_model_paramsType
uciwweihr_model_params

Struct for holding parameters used in the UCIWWEIHR ODE compartmental model. Use create_uciwweihr_model_params to create an instance of this struct.

Fields

  • E_init_sd::Float64=50.0: Standard deviation for the initial number of exposed individuals.
  • E_init_mean::Int64=200: Mean for the initial number of exposed individuals.
  • I_init_sd::Float64=20.0: Standard deviation for the initial number of infected individuals.
  • I_init_mean::Int64=100: Mean for the initial number of infected individuals.
  • H_init_sd::Float64=5.0: Standard deviation for the initial number of hospitalized individuals.
  • H_init_mean::Int64=20: Mean for the initial number of hospitalized individuals.
  • gamma_sd::Float64=0.02: Standard deviation for the rate of incubation.
  • log_gamma_mean::Float64=log(1/4): Mean for the rate of incubation on log scale.
  • nu_sd::Float64=0.02: Standard deviation for the rate of leaving the infected compartment.
  • log_nu_mean::Float64=log(1/7): Mean for the rate of leaving the infected compartment on the log scale.
  • epsilon_sd::Float64=0.02: Standard deviation for the rate of hospitalization recovery.
  • log_epsilon_mean::Float64=log(1/5): Mean for the rate of hospitalization recovery on the log scale.
  • rho_gene_sd::Float64=0.02: Standard deviation for the rho prior.
  • log_rho_gene_mean::Float64=log(0.011): Mean for the row prior on log scale.
  • sigma_wastewater::Float64=log(0.1): Standard deviation for the negative binomial distribution for wastewater data. Not infered.
  • sigma_hosp::Float64=500.0: Standard deviation for the negative binomial distribution for hospital data. Not infered.
  • Rt_init_sd::Float64=0.3: Standard deviation for the initial value of the time-varying reproduction number.
  • Rt_init_mean::Float64=0.2: Mean for the initial value of the time-varying reproduction number.
  • sigma_Rt_sd::Float64=0.2: Standard deviation for normal prior of log time-varying reproduction number standard deviation.
  • sigma_Rt_mean::Float64=-3.0: Mean for normal prior of log time-varying reproduction number standard deviation.
  • w_init_sd::Float64=0.1: Standard deviation for the initial value of the time-varying hospitalization rate.
  • w_init_mean::Float64=log(0.35): Mean for the initial value of the time-varying hospitalization rate.
  • sigma_w_sd::Float64=0.2: Standard deviation for normal prior of log time-varying hospitalization rate standard deviation.
  • sigma_w_mean::Float64=-3.5: Mean for normal prior of time-varying hospitalization rate standard deviation.
source
UCIWWEIHR.uciwweihr_sim_paramsType
uciwweihr_sim_params

Struct for holding parameters used in the UCIWWEIHR ODE compartmental model simulation. Use create_uciwweihr_sim_params to create an instance of this struct.

Fields

  • time_points::Int64: Number of time points for the simulation.
  • seed::Int64: Seed for random number generation.
  • E_init::Int64: Initial number of exposed individuals.
  • I_init::Int64: Initial number of infected individuals.
  • H_init::Int64: Initial number of hospitalized individuals.
  • gamma::Float64: Rate of incubation.
  • nu::Float64: Rate of leaving the infected compartment.
  • epsilon::Float64: Rate of hospitalization recovery.
  • rho_gene::Float64: Contribution of infected individual's pathogen genome into wastewater.
  • tau::Float64: Scale/variation of the log concentration of pathogen genome in wastewater.
  • df::Float64: Degrees of freedom for generalized t-distribution for log concentration of pathogen genome in wastewater.
  • sigma_hosp::Float64: Standard deviation for the negative binomial distribution for hospital data.
  • Rt::Union{Float64, Vector{Float64}}: Initial value or time series of the time-varying reproduction number.
  • sigma_Rt::Float64: Standard deviation for random walk of time-varying reproduction number.
  • w::Union{Float64, Vector{Float64}}: Initial value or time series of the time-varying hospitalization rate.
  • sigma_w::Float64: Standard deviation for random walk of time-varying hospitalization rate.
  • rt_init::Float64: Initial value of the time-varying reproduction number, NOT USER SPECIFIED create_uciwweihr_params TAKES CARE OF THIS.
  • w_init::Float64: Initial value of the time-varying hospitalization rate, NOT USER SPECIFIED create_uciwweihr_params TAKES CARE OF THIS.
source
UCIWWEIHR.ChainsCustomIndexMethod
ChainsCustomIndex(c::Chains, indices_to_keep::BitMatrix)

Reduce Chains object to only wanted indices.

Function created by Damon Bayer.

source
UCIWWEIHR.NegativeBinomial2Method

Create a re-parametrized negative binomial distribution in terms of mean and overdispersion.

Arguments

  • μ: Mean of the distribution.
  • ϕ: Overdispersion parameter.

Returns

A Distributions.NegativeBinomial distribution object.

source
UCIWWEIHR.calculate_quantilesMethod
calculate_quantiles(df, chain, var_prefix, quantiles)

Calculate quantiles for a given chain and variable prefix. Quantiles can be any user desired quantile.

source
UCIWWEIHR.create_uciwweihr_model_paramsMethod
create_uciwweihr_model_params(; kwargs...)

Creates a uciwweihr_sim_params struct with the option to either use a predetermined Rt and w or generate them as random walks.

Arguments

  • kwargs...: Named arguments corresponding to the fields in uciwweihr_sim_params.

Returns

  • params::uciwweihr_sim_params: A struct with simulation parameters.
source
UCIWWEIHR.create_uciwweihr_sim_paramsMethod

createuciwweihrsim_params(; kwargs...)

Creates a uciwweihr_sim_params struct with the option to either use a predetermined Rt and w or generate them as random walks.

Arguments

  • kwargs...: Named arguments corresponding to the fields in uciwweihr_sim_params.

Returns

  • params::uciwweihr_sim_params: A struct with simulation parameters.
source
UCIWWEIHR.eihr_ode!Method

eihr_ode!(du, u, p, t)

Calculate the ordinary differential equations (ODEs) for the EIHR model.

Parameters:

  • du: Array{Float64,1} - The derivative of the state variables.
  • u: Array{Float64,1} - The current state variables.
  • p: Tuple{Float64,Float64,Float64,Float64,Float64} - The model parameters (alpha, gamma, nu, w, epsilon).
  • t: Float64 - The current time.

Returns:

  • du: Array{Float64,1} - The derivative of the state variables.
source
UCIWWEIHR.generate_logit_normal_random_walkMethod
generate_logit_normal_random_walk(time_points::Int64, sigma::Float64, init_val::Float64)

Generates a logit-normal random walk time series.

Arguments

  • time_points::Int64: Number of time points.
  • sigma::Float64: Standard deviation of the random walk in logit space.
  • init_val::Float64: Initial value of the random walk on the probability scale.

Returns

  • walk::Vector{Float64}: Generated random walk on the probability scale.
source
UCIWWEIHR.generate_random_walkMethod
generate_random_walk(time_points::Int64, sigma::Float64, init_val::Float64)

Generates a random walk time series.

Arguments

  • time_points::Int64: Number of time points.
  • sigma::Float64: Standard deviation of the random walk.
  • init_val::Float64: Initial value of the random walk.

Returns

  • walk::Vector{Float64}: Generated random walk.
source
UCIWWEIHR.generate_simulation_data_agentFunction

Generating Simulation Data for Agent Based Model

To generate simulation data using the agent based model, you can use the generate_simulation_data_agent function defined in the UCIWWEIHR.jl package. This function allows you to customize various parameters for the simulation. NOT FINISHED, STILL NEEDS WW AND RT

Function Signature

Arguments

  • seed::Int64: Seed for random number generation. Default value is 1.
  • pop_size::Int64: Size of the population. Default value is 1000.
  • I_init::Int64: Initial number of infected individuals. Default value is 200.
  • H_init::Int64: Initial number of hospitalized individuals. Default value is 20.
  • beta::Float64: Transmission rate. Default value is 0.001.
  • gamma::Float64: Rate of exposed individuals becoming infectious. Default value is 1/4.
  • nu::Float64: Rate of infected individuals recovering or getting hospitalized. Default value is 1/7.
  • epsilon::Float64: Rate of hospitalized individuals recovering. Default value is 1/5.
  • w_init::Float64: Probability of an infected individual becoming hospitalized. Default value is 0.35.

Returns

  • df::DataFrame: A DataFrame containing the simulation data with columns Time, S, E, I, H, and R.
source
UCIWWEIHR.generate_simulation_data_uciwweihrMethod
generate_simulation_data(params::UCIWWEIHRParams)

Generates simulation data for the UCIWWEIHR ODE compartmental model.

Arguments

  • params::uciwweihr_sim_params: Struct containing parameters for the simulation.

Returns

  • df::DataFrame: A DataFrame containing the simulation data with columns obstimes, log_ww_conc, hosp, rt, and wt.
source
UCIWWEIHR.mcmcdiags_visMethod
mcmcdiags_vis(...)

Default visualizer for results of the UCIWWEIHR model, includes posterior/priors of generated quantities and posterior predictive samples for forecasting. Forecasting plots will have the observed data alongside.

Arguments

  • gq_samples: Generated quantities samples from the posterior/prior distribution, index 2 in uciwweihrgqpp output.
  • desired_params: A list of lists of parameters to visualize. Each list will be visualized in a separate plot. Default is [["Einit", "Iinit", "Hinit"], ["gamma", "nu", "epsilon"], ["rhogene", "tau", "df"], ["sigma_hosp"]].
  • actual_non_time_varying_vals::uciwweihr_sim_params: A uciwweihrsimparams object of actual non-time varying parameter values if user has access to them. Default is nothing.
  • save_plots::Bool=false: A boolean to indicate if user wants to save the plots as pngs into a plots folder.
  • plot_name_to_save: A string to indicate the name of the plot to save. Default is "mcmcdiagnosisplots".
source
UCIWWEIHR.non_time_varying_param_visMethod
non_time_varying_param_vis(...)

Used in the uciwweihr_visualizer to create visuals for non-time varying parameters.

Arguments

  • build_params::uciwweihr_model_params: A struct of model parameters used to build gq_samples, used only if user desired priors next to posteriors.
  • data_hosp: Hospitalization data, used only if user desired priors next to posteriors.
  • data_wastewater: Wastewater data, if model does not use this do not specify this, if user desires priors next to plot (do not specify if you do not want prior plots).
  • obstimes_hosp: An array of time points for hospital data, used only if user desired priors next to posteriors.
  • obstimes_wastewater: An array of time points for wastewater data, used only if user desired priors next to posteriors.
  • param_change_times: An array of time points where the parameters change, used only if user desired priors next to posteriors.
  • seed: An integer to set the seed for reproducibility, used only if user desired priors next to posteriors.
  • forecast: A boolean to indicate if user wants to forecast, used only if user desired priors next to posteriors.
  • forecast_weeks: An integer to indicate the number of weeks to forecast, used only if user desired priors next to posteriors.
  • gq_samples: Generated quantities samples from the posterior/prior distribution, index 2 in uciwweihrgqpp output.
  • desired_params: A list of lists of parameters to visualize. Each list will be visualized in a separate plot. Default is any parameter not in this list : ["alphat", "wt", "rtvals", "loggenes_mean", "H"]
  • actual_non_time_varying_vals::uciwweihr_sim_params: A uciwweihrsimparams object of actual non-time varying parameter values if user has access to them. Default is nothing.
  • save_plots::Bool=false: A boolean to indicate if user wants to save the plots as pngs into a plots folder.
  • plot_name_to_save: A string to indicate the name of the plot to save. Default is "mcmcnontimevaryingparameterplots".
source
UCIWWEIHR.predictive_param_visMethod
predictive_param_vis(...)

Used in the uciwweihr_visualizer to create visuals for wastewater data and hospitalization data.

Arguments

  • pp_samples: A DataFrame of posterior or prior predictive samples.
  • data_wastewater: An array of actual wastewater values if user has access to them assumed, using time scale of observed time points. Default is nothing.
  • data_hosp: An array of actual hospitalization values if user has access to them assumed, , using time scale of observed time points. Default is nothing.
  • forecast_weeks: An integer of the number of weeks forecasted. Default is 0.
  • vars_to_pred: A list of variables to predict. Default is ["datawastewater", "datahosp"].
  • quantiles: A list of quantiles to calculate for ploting uncertainty. Default is [0.5, 0.8, 0.95].
  • bayes_dist_type: A string to indicate if user is using Posterior or Prior distribution. Default is "Posterior".
  • save_plots::Bool=false: A boolean to indicate if user wants to save the plots as pngs into a plots folder.
  • plot_name_to_save: A string to indicate the name of the plot to save. Default is "mcmcpredparameter_plots".
source
UCIWWEIHR.repeated_forecastMethod
repeated_forecast(...)

This is the function to make repreated forecast for a given forecast time span, n_forecast_weeks, and for given time points, forecast_points. Plots can be made for these forecasts. The output is an array of uciwweihr_gq_pp results for each forecast_points.

Arguments

  • data_hosp: The hospitalization data.
  • data_wastewater: The wastewater data.
  • obstimes_hosp: The time points for the hospitalization data.
  • obstimes_wastewater: The time points for the wastewater data.
  • n_samples: The number of samples to draw from the posterior.
  • param_change_times: The time points where the parameters change.
  • params::uciwweihr_model_params: The model parameters.
  • n_forecast_weeks: The number of weeks to forecast.
  • forecast_points: The time points to forecast, thees points should be present in obstimes_hosp.

Returns

  • An array of uciwweihr_gq_pp resuts and timeseries used for building for each forecast_points.
source
UCIWWEIHR.uciwweihr_fitMethod
uciwweihr_fit(...)

This is the sampler for the bayesian semi-parametric model for the wastewater EIHR compartmental model. The defaults for this fuction will follow those of the default simulation in generatesimulationdatawweihr.jl function.

Arguments

  • data_hosp: An array of hospital data.
  • data_wastewater: An array of pathogen genome concentration in localized wastewater data. If this is not avaliable, the model used will be one that only uses hospital data.
  • obstimes: An array of timepoints for observed hosp/wastewater.
  • priors_only::Bool=false: A boolean to indicate if only priors are to be sampled.
  • n_samples::Int64=500: Number of samples to be drawn.
  • n_chains::Int64=1: Number of chains to be run.
  • seed::Int64=2024: Seed for the random number generator.
  • params::uciwweihr_model_params: A struct containing parameters for the model.

Returns

  • Samples from the posterior or prior distribution.
source
UCIWWEIHR.uciwweihr_modelMethod
uciwweihr_model(...)

This is the bayesian semi-parametric model for the wastewater EIHR compartmental model. The defaults for this fuction will follow those of the default simulation in generatesimulationdatawweihr.jl function.

Arguments

  • data_hosp: An array of hospital data.
  • data_wastewater: An array of pathogen genome concentration in localized wastewater data. If this is not avaliable, the model used will be one that only uses hospital data.
  • obstimes_hosp: An array of timepoints for observed hospital data.
  • obstimes_wastewater: An array of timepoints for observed wastewater data.
  • param_change_times: An array of timepoints where the parameters change.
  • params::uciwweihr_model_params: A struct containing parameters for the model.
source
+Raise `a` to the `b` power
source
UCIWWEIHR.predictive_param_visMethod
predictive_param_vis(...)

Used in the uciwweihr_visualizer to create visuals for wastewater data and hospitalization data.

Arguments

  • pp_samples: A DataFrame of posterior or prior predictive samples.
  • data_wastewater: An array of actual wastewater values if user has access to them assumed, using time scale of observed time points. Default is nothing.
  • data_hosp: An array of actual hospitalization values if user has access to them assumed, , using time scale of observed time points. Default is nothing.
  • forecast_weeks: An integer of the number of weeks forecasted. Default is 0.
  • vars_to_pred: A list of variables to predict. Default is ["datawastewater", "datahosp"].
  • quantiles: A list of quantiles to calculate for ploting uncertainty. Default is [0.5, 0.8, 0.95].
  • bayes_dist_type: A string to indicate if user is using Posterior or Prior distribution. Default is "Posterior".
  • save_plots::Bool=false: A boolean to indicate if user wants to save the plots as pngs into a plots folder.
  • plot_name_to_save: A string to indicate the name of the plot to save. Default is "mcmcpredparameter_plots".
source
UCIWWEIHR.repeated_forecastMethod
repeated_forecast(...)

This is the function to make repreated forecast for a given forecast time span, n_forecast_weeks, and for given time points, forecast_points. Plots can be made for these forecasts. The output is an array of uciwweihr_gq_pp results for each forecast_points.

Arguments

  • data_hosp: The hospitalization data.
  • data_wastewater: The wastewater data.
  • obstimes_hosp: The time points for the hospitalization data.
  • obstimes_wastewater: The time points for the wastewater data.
  • n_samples: The number of samples to draw from the posterior.
  • param_change_times: The time points where the parameters change.
  • params::uciwweihr_model_params: The model parameters.
  • n_forecast_weeks: The number of weeks to forecast.
  • forecast_points: The time points to forecast, thees points should be present in obstimes_hosp.

Returns

  • An array of uciwweihr_gq_pp resuts and timeseries used for building for each forecast_points.
source
UCIWWEIHR.uciwweihr_fitMethod
uciwweihr_fit(...)

This is the sampler for the bayesian semi-parametric model for the wastewater EIHR compartmental model. The defaults for this fuction will follow those of the default simulation in generatesimulationdatawweihr.jl function.

Arguments

  • data_hosp: An array of hospital data.
  • data_wastewater: An array of pathogen genome concentration in localized wastewater data. If this is not avaliable, the model used will be one that only uses hospital data.
  • obstimes: An array of timepoints for observed hosp/wastewater.
  • priors_only::Bool=false: A boolean to indicate if only priors are to be sampled.
  • n_samples::Int64=500: Number of samples to be drawn.
  • n_chains::Int64=1: Number of chains to be run.
  • seed::Int64=2024: Seed for the random number generator.
  • params::uciwweihr_model_params: A struct containing parameters for the model.

Returns

  • Samples from the posterior or prior distribution.
source
UCIWWEIHR.uciwweihr_modelMethod
uciwweihr_model(...)

This is the bayesian semi-parametric model for the wastewater EIHR compartmental model. The defaults for this fuction will follow those of the default simulation in generatesimulationdatawweihr.jl function.

Arguments

  • data_hosp: An array of hospital data.
  • data_wastewater: An array of pathogen genome concentration in localized wastewater data. If this is not avaliable, the model used will be one that only uses hospital data.
  • obstimes_hosp: An array of timepoints for observed hospital data.
  • obstimes_wastewater: An array of timepoints for observed wastewater data.
  • param_change_times: An array of timepoints where the parameters change.
  • params::uciwweihr_model_params: A struct containing parameters for the model.
source
diff --git a/dev/tutorial_index/index.html b/dev/tutorial_index/index.html index 08b3402..c56ea7c 100644 --- a/dev/tutorial_index/index.html +++ b/dev/tutorial_index/index.html @@ -1,2 +1,2 @@ -TUTORIAL CONTENTS · UCIWWEIHR.jl
+TUTORIAL CONTENTS · UCIWWEIHR.jl
diff --git a/dev/tutorials/agent_based_simulation_data/557436bd.svg b/dev/tutorials/agent_based_simulation_data/23baef23.svg similarity index 87% rename from dev/tutorials/agent_based_simulation_data/557436bd.svg rename to dev/tutorials/agent_based_simulation_data/23baef23.svg index dbf7778..1cdc001 100644 --- a/dev/tutorials/agent_based_simulation_data/557436bd.svg +++ b/dev/tutorials/agent_based_simulation_data/23baef23.svg @@ -1,58 +1,58 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/agent_based_simulation_data/index.html b/dev/tutorials/agent_based_simulation_data/index.html index 4274d66..95e5b20 100644 --- a/dev/tutorials/agent_based_simulation_data/index.html +++ b/dev/tutorials/agent_based_simulation_data/index.html @@ -10,4 +10,4 @@ plot!(df.Time, df.E, label = "Exposed") plot!(df.Time, df.I, label = "Infected") plot!(df.Time, df.H, label = "Hospitalized") -plot!(df.Time, df.R, label = "Recovered")Example block output

Tutorial Contents

+plot!(df.Time, df.R, label = "Recovered")Example block output

Tutorial Contents

diff --git a/dev/tutorials/getting_started/index.html b/dev/tutorials/getting_started/index.html index b5d245f..844947a 100644 --- a/dev/tutorials/getting_started/index.html +++ b/dev/tutorials/getting_started/index.html @@ -1,3 +1,3 @@ GETTING STARTED · UCIWWEIHR.jl

Getting Started

Welcome to the Tutorials page for the UCIWWEIHR.jl project. This section provides step-by-step guides and examples to help you get started with using the package and understanding its features.

1. Installation.

To install the UCIWWEIHR.jl package, open the Julia REPL and run the following command:

using Pkg
-Pkg.add("https://github.com/cbernalz/UCIWWEIHR.jl.git")

Tutorial Contents

+Pkg.add("https://github.com/cbernalz/UCIWWEIHR.jl.git")

Tutorial Contents

diff --git a/dev/tutorials/uciwweihr_model_repeated_forecasts/index.html b/dev/tutorials/uciwweihr_model_repeated_forecasts/index.html index 3fda423..f4de3d0 100644 --- a/dev/tutorials/uciwweihr_model_repeated_forecasts/index.html +++ b/dev/tutorials/uciwweihr_model_repeated_forecasts/index.html @@ -23,7 +23,7 @@ w = w_custom ) df = generate_simulation_data_uciwweihr(params) -first(df, 5)
5×5 DataFrame
Rowobstimeslog_ww_conchosprtwt
Int64Float64Int64Float64Float64
110.347026181.00.3
220.550405261.029630.302353
330.503247291.059260.304706
440.885447361.088890.307059
550.794372281.118520.309412

2. Constructing Repeat Forecasts.

We use the repeated_forecast function to generate forecasts for a given number of weeks, for a given number of time points. Along with this we need to specify presets. Output of this function is an array with the first index controlling which result we are looking at. The next contains a uciwweihr_gq_pp output.

data_hosp = df.hosp
+first(df, 5)
5×8 DataFrame
Rowobstimeslog_ww_conchosprtwtE_ode_comp_solI_ode_comp_solH_ode_comp_sol
Int64Float64Int64Float64Float64Float64Float64Float64
110.347026181.00.3170.466129.53420.8891
220.550405261.029630.302353150.527149.47322.5594
330.503247291.059260.304706137.656163.00724.6122
440.885447361.088890.307059129.721172.36426.7834
550.794372281.118520.309412125.254179.06428.9256

2. Constructing Repeat Forecasts.

We use the repeated_forecast function to generate forecasts for a given number of weeks, for a given number of time points. Along with this we need to specify presets. Output of this function is an array with the first index controlling which result we are looking at. The next contains a uciwweihr_gq_pp output.

data_hosp = df.hosp
 data_wastewater = df.log_ww_conc
 obstimes_hosp = df.obstimes
 obstimes_wastewater = df.obstimes
@@ -215,4 +215,4 @@
 MCMC Diagnostics Plots are not requested.
 MCMC time varying parameter results are not requested.
 MCMC non-time varying parameter results are not requested.
-Plot saved to plots/mcmc_pred_parameter_plots_rep_res4.png

3.1. Forecast Point 1.

Plot 1

3.2. Forecast Point 2.

Plot 2

3.3. Forecast Point 3.

Plot 3

3.4. Forecast Point 4.

Plot 4

Tutorial Contents

+Plot saved to plots/mcmc_pred_parameter_plots_rep_res4.png

3.1. Forecast Point 1.

Plot 1

3.2. Forecast Point 2.

Plot 2

3.3. Forecast Point 3.

Plot 3

3.4. Forecast Point 4.

Plot 4

Tutorial Contents

diff --git a/dev/tutorials/uciwweihr_simulation_data/c8bd6c26.svg b/dev/tutorials/uciwweihr_simulation_data/194e413a.svg similarity index 87% rename from dev/tutorials/uciwweihr_simulation_data/c8bd6c26.svg rename to dev/tutorials/uciwweihr_simulation_data/194e413a.svg index 933f94f..c29e5db 100644 --- a/dev/tutorials/uciwweihr_simulation_data/c8bd6c26.svg +++ b/dev/tutorials/uciwweihr_simulation_data/194e413a.svg @@ -1,39 +1,39 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/807f0942.svg b/dev/tutorials/uciwweihr_simulation_data/24844ea9.svg similarity index 85% rename from dev/tutorials/uciwweihr_simulation_data/807f0942.svg rename to dev/tutorials/uciwweihr_simulation_data/24844ea9.svg index a75f990..cafa99c 100644 --- a/dev/tutorials/uciwweihr_simulation_data/807f0942.svg +++ b/dev/tutorials/uciwweihr_simulation_data/24844ea9.svg @@ -1,41 +1,41 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/88781e68.svg b/dev/tutorials/uciwweihr_simulation_data/28e15a89.svg similarity index 87% rename from dev/tutorials/uciwweihr_simulation_data/88781e68.svg rename to dev/tutorials/uciwweihr_simulation_data/28e15a89.svg index a9309b4..bc3b1e6 100644 --- a/dev/tutorials/uciwweihr_simulation_data/88781e68.svg +++ b/dev/tutorials/uciwweihr_simulation_data/28e15a89.svg @@ -1,39 +1,39 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/43807cd6.svg b/dev/tutorials/uciwweihr_simulation_data/47ee9a3a.svg similarity index 87% rename from dev/tutorials/uciwweihr_simulation_data/43807cd6.svg rename to dev/tutorials/uciwweihr_simulation_data/47ee9a3a.svg index 4429da5..644e22d 100644 --- a/dev/tutorials/uciwweihr_simulation_data/43807cd6.svg +++ b/dev/tutorials/uciwweihr_simulation_data/47ee9a3a.svg @@ -1,39 +1,39 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/3023dc0b.svg b/dev/tutorials/uciwweihr_simulation_data/5d1651cd.svg similarity index 87% rename from dev/tutorials/uciwweihr_simulation_data/3023dc0b.svg rename to dev/tutorials/uciwweihr_simulation_data/5d1651cd.svg index 0f4ac75..02998b1 100644 --- a/dev/tutorials/uciwweihr_simulation_data/3023dc0b.svg +++ b/dev/tutorials/uciwweihr_simulation_data/5d1651cd.svg @@ -1,41 +1,41 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/617b6b8b.svg b/dev/tutorials/uciwweihr_simulation_data/60ea2827.svg similarity index 87% rename from dev/tutorials/uciwweihr_simulation_data/617b6b8b.svg rename to dev/tutorials/uciwweihr_simulation_data/60ea2827.svg index f3ccffe..f4c83a7 100644 --- a/dev/tutorials/uciwweihr_simulation_data/617b6b8b.svg +++ b/dev/tutorials/uciwweihr_simulation_data/60ea2827.svg @@ -1,41 +1,41 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/729ef860.svg b/dev/tutorials/uciwweihr_simulation_data/68cd836d.svg similarity index 87% rename from dev/tutorials/uciwweihr_simulation_data/729ef860.svg rename to dev/tutorials/uciwweihr_simulation_data/68cd836d.svg index 974d634..9dadc32 100644 --- a/dev/tutorials/uciwweihr_simulation_data/729ef860.svg +++ b/dev/tutorials/uciwweihr_simulation_data/68cd836d.svg @@ -1,39 +1,39 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/2cc0ee4d.svg b/dev/tutorials/uciwweihr_simulation_data/c0269935.svg similarity index 86% rename from dev/tutorials/uciwweihr_simulation_data/2cc0ee4d.svg rename to dev/tutorials/uciwweihr_simulation_data/c0269935.svg index 91438b2..ea7e255 100644 --- a/dev/tutorials/uciwweihr_simulation_data/2cc0ee4d.svg +++ b/dev/tutorials/uciwweihr_simulation_data/c0269935.svg @@ -1,39 +1,39 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/index.html b/dev/tutorials/uciwweihr_simulation_data/index.html index 5d4b564..250f0ef 100644 --- a/dev/tutorials/uciwweihr_simulation_data/index.html +++ b/dev/tutorials/uciwweihr_simulation_data/index.html @@ -4,23 +4,23 @@ # Running simulation function with defaults params = create_uciwweihr_sim_params() df = generate_simulation_data_uciwweihr(params) -first(df, 5)
5×5 DataFrame
Rowobstimeslog_ww_conchosprtwt
Int64Float64Int64Float64Float64
110.346996180.997770.349492
220.550305241.014680.353323
330.502858400.9891190.347515
440.883632311.069040.365335
550.790455331.109150.373918

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,
+first(df, 5)
5×8 DataFrame
Rowobstimeslog_ww_conchosprtwtE_ode_comp_solI_ode_comp_solH_ode_comp_sol
Int64Float64Int64Float64Float64Float64Float64Float64
110.346996180.997770.349492170.433129.5321.6338
220.550305241.014680.353323150.46149.45824.069
330.502858400.9891190.347515137.304162.94326.8819
440.883632311.069040.365335127.935172.05129.5661
550.790455331.109150.373918123.352178.36432.5075

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,
+    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,
+    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,
+    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
+    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(
@@ -45,20 +45,20 @@
     w = w_custom
 )
 df = generate_simulation_data_uciwweihr(params)
-first(df, 5)
5×5 DataFrame
Rowobstimeslog_ww_conchosprtwt
Int64Float64Int64Float64Float64
110.347026181.00.3
220.550405261.029630.302353
330.503247291.059260.304706
440.885447361.088890.307059
550.794372281.118520.309412

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,
+first(df, 5)
5×8 DataFrame
Rowobstimeslog_ww_conchosprtwtE_ode_comp_solI_ode_comp_solH_ode_comp_sol
Int64Float64Int64Float64Float64Float64Float64Float64
110.347026181.00.3170.466129.53420.8891
220.550405261.029630.302353150.527149.47322.5594
330.503247291.059260.304706137.656163.00724.6122
440.885447361.088890.307059129.721172.36426.7834
550.794372281.118520.309412125.254179.06428.9256

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,
+    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,
+    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,
+    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

+ title="Plot of Hospitalization Rate Over Time")Example block output

Tutorial Contents

diff --git a/dev/tutorials/uciwwiehr_model_fitting_forecast/index.html b/dev/tutorials/uciwwiehr_model_fitting_forecast/index.html index b29e743..fc91d18 100644 --- a/dev/tutorials/uciwwiehr_model_fitting_forecast/index.html +++ b/dev/tutorials/uciwwiehr_model_fitting_forecast/index.html @@ -10,7 +10,7 @@ time_points = 178 ) df_ext = generate_simulation_data_uciwweihr(params_ext) -first(df, 5)
5×5 DataFrame
Rowobstimeslog_ww_conchosprtwt
Int64Float64Int64Float64Float64
110.346996180.997770.349492
220.550305241.014680.353323
330.502858400.9891190.347515
440.883632311.069040.365335
550.790455331.109150.373918
first(df_ext, 5)
5×5 DataFrame
Rowobstimeslog_ww_conchosprtwt
Int64Float64Int64Float64Float64
110.346996240.997770.349492
220.550305251.014680.353323
330.502858170.9891190.347515
440.883632291.069040.365335
550.790455261.109150.373918

2. Sampling from the Posterior Distribution and Posterior Predictive Distribution.

Here we sample from the posterior distribution using the uciwweihr_fit.jl function. First, we setup some presets, where we need to use create_uciwweihr_model_params() to get default parameters for the model. Then we have an array where index 1 contains the posterior/prior predictive samples, index 2 contains the posterior/prior generated quantities samples, and index 3 contains the original sampled parameters for the model. The difference here is that we set forecast = true and forecast_weeks = 4 to forecast 4 weeks into the future. One other thing to note, is that we allow misalignment of hospital and wastewater data's observed times. For this tutorial, we use the same observed points.

data_hosp = df.hosp
+first(df, 5)
5×8 DataFrame
Rowobstimeslog_ww_conchosprtwtE_ode_comp_solI_ode_comp_solH_ode_comp_sol
Int64Float64Int64Float64Float64Float64Float64Float64
110.346996180.997770.349492170.433129.5321.6338
220.550305241.014680.353323150.46149.45824.069
330.502858400.9891190.347515137.304162.94326.8819
440.883632311.069040.365335127.935172.05129.5661
550.790455331.109150.373918123.352178.36432.5075
first(df_ext, 5)
5×8 DataFrame
Rowobstimeslog_ww_conchosprtwtE_ode_comp_solI_ode_comp_solH_ode_comp_sol
Int64Float64Int64Float64Float64Float64Float64Float64
110.346996240.997770.349492170.433129.5321.6338
220.550305251.014680.353323150.46149.45824.069
330.502858170.9891190.347515137.304162.94326.8819
440.883632291.069040.365335127.935172.05129.5661
550.790455261.109150.373918123.352178.36432.5075

2. Sampling from the Posterior Distribution and Posterior Predictive Distribution.

Here we sample from the posterior distribution using the uciwweihr_fit.jl function. First, we setup some presets, where we need to use create_uciwweihr_model_params() to get default parameters for the model. Then we have an array where index 1 contains the posterior/prior predictive samples, index 2 contains the posterior/prior generated quantities samples, and index 3 contains the original sampled parameters for the model. The difference here is that we set forecast = true and forecast_weeks = 4 to forecast 4 weeks into the future. One other thing to note, is that we allow misalignment of hospital and wastewater data's observed times. For this tutorial, we use the same observed points.

data_hosp = df.hosp
 data_wastewater = df.log_ww_conc
 obstimes_hosp = df.obstimes
 obstimes_wastewater = df.obstimes
@@ -97,4 +97,4 @@
 Sampling (1 threads) 100%|██████████████████████████████| Time: 0:00:00
 Using uciwweihr_model with wastewater!!!
 Plot saved to plots/mcmc_nontime_varying_parameter_plots1.png
-Plot saved to plots/mcmc_pred_parameter_plots1.png

3.1. MCMC Diagnostic Plots.

Plot 1

3.2. Time Varying Parameter Results Plot.

Plot 2

3.3. Non-Time Varying Parameter Results Plot.

Plot 3

3.4. Posterior Predictive Distribution Plot.

Plot 4

Tutorial Contents

+Plot saved to plots/mcmc_pred_parameter_plots1.png

3.1. MCMC Diagnostic Plots.

Plot 1

3.2. Time Varying Parameter Results Plot.

Plot 2

3.3. Non-Time Varying Parameter Results Plot.

Plot 3

3.4. Posterior Predictive Distribution Plot.

Plot 4

Tutorial Contents

diff --git a/dev/tutorials/uciwwiehr_model_fitting_no_forecast/index.html b/dev/tutorials/uciwwiehr_model_fitting_no_forecast/index.html index 5878cfa..e0ee360 100644 --- a/dev/tutorials/uciwwiehr_model_fitting_no_forecast/index.html +++ b/dev/tutorials/uciwwiehr_model_fitting_no_forecast/index.html @@ -23,7 +23,7 @@ w = w_custom ) df = generate_simulation_data_uciwweihr(params) -first(df, 5)
5×5 DataFrame
Rowobstimeslog_ww_conchosprtwt
Int64Float64Int64Float64Float64
110.347026181.00.3
220.550405261.029630.302353
330.503247291.059260.304706
440.885447361.088890.307059
550.794372281.118520.309412

2. Sampling from the Posterior Distribution and Posterior Predictive Distribution.

Here we sample from the posterior distribution using the uciwweihr_fit.jl function. First, we setup some presets, where we need to use create_uciwweihr_model_params() to get default parameters for the model. Then we have an array where index 1 contains the posterior/prior predictive samples, index 2 contains the posterior/prior generated quantities samples, and index 3 contains the original sampled parameters for the model. Again, we can allow misalignment of hospital and wastewater data's observed times. For this tutorial, we use the same observed points.

data_hosp = df.hosp
+first(df, 5)
5×8 DataFrame
Rowobstimeslog_ww_conchosprtwtE_ode_comp_solI_ode_comp_solH_ode_comp_sol
Int64Float64Int64Float64Float64Float64Float64Float64
110.347026181.00.3170.466129.53420.8891
220.550405261.029630.302353150.527149.47322.5594
330.503247291.059260.304706137.656163.00724.6122
440.885447361.088890.307059129.721172.36426.7834
550.794372281.118520.309412125.254179.06428.9256

2. Sampling from the Posterior Distribution and Posterior Predictive Distribution.

Here we sample from the posterior distribution using the uciwweihr_fit.jl function. First, we setup some presets, where we need to use create_uciwweihr_model_params() to get default parameters for the model. Then we have an array where index 1 contains the posterior/prior predictive samples, index 2 contains the posterior/prior generated quantities samples, and index 3 contains the original sampled parameters for the model. Again, we can allow misalignment of hospital and wastewater data's observed times. For this tutorial, we use the same observed points.

data_hosp = df.hosp
 data_wastewater = df.log_ww_conc
 obstimes_hosp = df.obstimes
 obstimes_wastewater = df.obstimes
@@ -104,4 +104,4 @@
 Sampling (1 threads) 100%|██████████████████████████████| Time: 0:00:00
 Using uciwweihr_model with wastewater!!!
 Plot saved to plots/mcmc_nontime_varying_parameter_plots.png
-Plot saved to plots/mcmc_pred_parameter_plots.png

3.1. MCMC Diagnostic Plots.

Plot 1

3.2. Time Varying Parameter Results Plot.

Plot 2

3.3. Non-Time Varying Parameter Results Plot.

Plot 3

3.4. Posterior Predictive Distribution Plot.

Plot 4

Tutorial Contents

+Plot saved to plots/mcmc_pred_parameter_plots.png

3.1. MCMC Diagnostic Plots.

Plot 1

3.2. Time Varying Parameter Results Plot.

Plot 2

3.3. Non-Time Varying Parameter Results Plot.

Plot 3

3.4. Posterior Predictive Distribution Plot.

Plot 4

Tutorial Contents