diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index d15f0d4..e857358 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2024-08-29T04:36:00","documenter_version":"1.5.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2024-08-31T18:00:07","documenter_version":"1.6.0"}} \ No newline at end of file diff --git a/dev/assets/documenter.js b/dev/assets/documenter.js index b2bdd43..82252a1 100644 --- a/dev/assets/documenter.js +++ b/dev/assets/documenter.js @@ -77,30 +77,35 @@ require(['jquery'], function($) { let timer = 0; var isExpanded = true; -$(document).on("click", ".docstring header", function () { - let articleToggleTitle = "Expand docstring"; - - debounce(() => { - if ($(this).siblings("section").is(":visible")) { - $(this) - .find(".docstring-article-toggle-button") - .removeClass("fa-chevron-down") - .addClass("fa-chevron-right"); - } else { - $(this) - .find(".docstring-article-toggle-button") - .removeClass("fa-chevron-right") - .addClass("fa-chevron-down"); +$(document).on( + "click", + ".docstring .docstring-article-toggle-button", + function () { + let articleToggleTitle = "Expand docstring"; + const parent = $(this).parent(); + + debounce(() => { + if (parent.siblings("section").is(":visible")) { + parent + .find("a.docstring-article-toggle-button") + .removeClass("fa-chevron-down") + .addClass("fa-chevron-right"); + } else { + parent + .find("a.docstring-article-toggle-button") + .removeClass("fa-chevron-right") + .addClass("fa-chevron-down"); - articleToggleTitle = "Collapse docstring"; - } + articleToggleTitle = "Collapse docstring"; + } - $(this) - .find(".docstring-article-toggle-button") - .prop("title", articleToggleTitle); - $(this).siblings("section").slideToggle(); - }); -}); + parent + .children(".docstring-article-toggle-button") + .prop("title", articleToggleTitle); + parent.siblings("section").slideToggle(); + }); + } +); $(document).on("click", ".docs-article-toggle-button", function (event) { let articleToggleTitle = "Expand docstring"; @@ -110,7 +115,7 @@ $(document).on("click", ".docs-article-toggle-button", function (event) { debounce(() => { if (isExpanded) { $(this).removeClass("fa-chevron-up").addClass("fa-chevron-down"); - $(".docstring-article-toggle-button") + $("a.docstring-article-toggle-button") .removeClass("fa-chevron-down") .addClass("fa-chevron-right"); @@ -119,7 +124,7 @@ $(document).on("click", ".docs-article-toggle-button", function (event) { $(".docstring section").slideUp(animationSpeed); } else { $(this).removeClass("fa-chevron-down").addClass("fa-chevron-up"); - $(".docstring-article-toggle-button") + $("a.docstring-article-toggle-button") .removeClass("fa-chevron-right") .addClass("fa-chevron-down"); diff --git a/dev/index.html b/dev/index.html index d601c68..340c687 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("git@github.com:cbernalz/UCIWWEIHR.jl.git")
+Pkg.add("git@github.com:cbernalz/UCIWWEIHR.jl.git") diff --git a/dev/license/index.html b/dev/license/index.html index 877af84..6d414a2 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/objects.inv b/dev/objects.inv index 6dc95c4..6acc1d6 100644 Binary files a/dev/objects.inv and b/dev/objects.inv differ diff --git a/dev/reference/index.html b/dev/reference/index.html index 84550a9..6a3ba63 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.
  • tau_sd::Float64=0.02: Standard deviation for the scale/variation of the log scale data.
  • log_tau_mean::Float64=log(0.1): Mean for the scale/variation of the log scale data on log scale itself.
  • df_shape::Float64=2.0: Shape parameter for the gamma distribution.
  • df_scale::Float64=10.0: Scale parameter for the gamma distribution.
  • sigma_hosp_sd::Float64=50.0: Standard deviation for the negative binomial distribution for hospital data.
  • sigma_hosp_mean::Float64=500.0: Mean for the negative binomial distribution for hospital data.
  • 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

  • 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"]
  • bayes_dist_type: A string to indicate if user is using Posterior or Prior distribution. Default is "Posterior".
  • 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.
  • tau_sd::Float64=0.02: Standard deviation for the scale/variation of the log scale data.
  • log_tau_mean::Float64=log(0.1): Mean for the scale/variation of the log scale data on log scale itself.
  • df_shape::Float64=2.0: Shape parameter for the gamma distribution.
  • df_scale::Float64=10.0: Scale parameter for the gamma distribution.
  • sigma_hosp_sd::Float64=50.0: Standard deviation for the negative binomial distribution for hospital data.
  • sigma_hosp_mean::Float64=500.0: Mean for the negative binomial distribution for hospital data.
  • 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

  • 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"]
  • bayes_dist_type: A string to indicate if user is using Posterior or Prior distribution. Default is "Posterior".
  • 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.time_varying_param_visMethod
time_varying_param_vis(...)

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

Arguments

  • gq_samples: Generated quantities samples from the posterior/prior distribution, index 2 in uciwweihrgqpp output.
  • actual_rt_vals: An array of actual Rt values if user has access to them assumed to be on a daily scale. This typically will come from some simulation. Default is nothing.
  • actual_w_t: An array of actual w_t values if user has access to them assumed to be on a daily scale. This typically will come from some simulation. Default is nothing.
  • time_varying_params: A list of time varying parameters to visualize. Default is ["rtvals", "wt"].
  • quantiles: A list of quantiles to calculate for ploting uncertainty. Default is [0.5, 0.8, 0.95].
  • 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 "mcmctimevaryingparameterplots".
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: An array of timepoints for observed hosp/wastewater.
  • param_change_times: An array of timepoints where the parameters change.
  • params::uciwweihr_model_params: A struct containing parameters for the model.
source
UCIWWEIHR.uciwweihr_visualizerMethod
uciwweihr_visualizer(...)

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

  • pp_sampeles: Posterior predictive samples from the posterior/prior distribution, index 1 in uciwweihrgqpp output.
  • gq_samples: Generated quantities samples from the posterior/prior distribution, index 2 in uciwweihrgqpp output.
  • data_hosp: An array of hospital data.
  • data_wastewater: An array of pathogen genome concentration in localized wastewater data.
  • actual_rt_vals: An array of actual Rt values if user has access to them assumed to be on a daily scale. This typically will come from some simulation. Default is nothing.
  • actual_w_t: An array of actual w_t values if user has access to them assumed to be on a daily scale. This typically will come from some simulation. Default is nothing.
  • 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.
  • forecast_weeks: Number of weeks to forecasted. Default is 0.
  • 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"]].
  • time_varying_params: A list of time varying parameters to visualize. Default is ["rtvals", "wt"].
  • var_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 ("Posterior" / "Prior").
  • mcmcdaigs::Bool=true: A boolean to indicate if user wants to visualize mcmc diagnosis plots and Effective Sample Size(ESS).
  • time_varying_plots::Bool=true: A boolean to indicate if user wants to visualize time varying parameters.
  • non_time_varying_plots::Bool=true: A boolean to indicate if user wants to visualize non-time varying parameters.
  • pred_param_plots::Bool=true: A boolean to indicate if user wants to visualize posterior (or prior) predictive parameter results.
  • 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_mcmcdiag: A string to indicate the name of the plot to save for MCMC diagnostics. Default is "mcmcdiagnosisplots".
  • plot_name_to_save_time_varying: A string to indicate the name of the plot to save for time varying parameters. Default is "mcmctimevaryingparameterplots".
  • plot_name_to_save_non_time_varying: A string to indicate the name of the plot to save for non-time varying parameters. Default is "mcmcnontimevaryingparameterplots".
  • plot_name_to_save_pred_param: A string to indicate the name of the plot to save for posterior (or prior) predictive parameter results. Default is "mcmcpredparameter_plots".
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.time_varying_param_visMethod
time_varying_param_vis(...)

Used in the uciwweihr_visualizer to create visuals for 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: An array of time points for the 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.
  • actual_rt_vals: An array of actual Rt values if user has access to them assumed to be on a daily scale. This typically will come from some simulation. Default is nothing.
  • actual_w_t: An array of actual w_t values if user has access to them assumed to be on a daily scale. This typically will come from some simulation. Default is nothing.
  • time_varying_params: A list of time varying parameters to visualize. Default is ["rtvals", "wt"].
  • quantiles: A list of quantiles to calculate for ploting uncertainty. Default is [0.5, 0.8, 0.95].
  • 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 "mcmctimevaryingparameterplots".
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: An array of timepoints for observed hosp/wastewater.
  • param_change_times: An array of timepoints where the parameters change.
  • params::uciwweihr_model_params: A struct containing parameters for the model.
source
UCIWWEIHR.uciwweihr_visualizerMethod
uciwweihr_visualizer(...)

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

  • build_params::uciwweihr_model_params: A uciwweihrmodelparams object, if user desires priors next to plot (do not specify if you do not want prior plots).
  • data_hosp: An array of hospital data used for model fitting, if user desires priors next to plot (do not specify if you do not want prior plots).
  • data_wastewater: An array of wastewater data used for model fitting, 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: An array of timepoints for observed hosp/wastewater, if user desires priors next to plot (do not specify if you do not want prior plots).
  • param_change_times: An array of timepoints where the parameters change, if user desires priors next to plot (do not specify if you do not want prior plots).
  • seed: Seed for the random number generator, if user desires priors next to plot (do not specify if you do not want prior plots).
  • forecast: A boolean to indicate if forecasting is to be done, if user desires priors next to plot (do not specify if you do not want prior plots).
  • forecast_weeks: Number of weeks to forecast, if user desires priors next to plot (do not specify if you do not want prior plots).
  • pp_sampeles: Posterior predictive samples from the posterior/prior distribution, index 1 in uciwweihrgqpp output.
  • gq_samples: Generated quantities samples from the posterior/prior distribution, index 2 in uciwweihrgqpp output.
  • obs_data_hosp: An array of hospital data, data used for model fitting or extened timeseries for evaluation of forecast.
  • obs_data_wastewater: An array of wastewater data, data used for model fitting or extened timeseries for evaluation of forecast.
  • actual_rt_vals: An array of actual Rt values if user has access to them assumed to be on a daily scale. This typically will come from some simulation. Default is nothing.
  • actual_w_t: An array of actual w_t values if user has access to them assumed to be on a daily scale. This typically will come from some simulation. Default is nothing.
  • 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.
  • 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"]].
  • time_varying_params: A list of time varying parameters to visualize. Default is ["rtvals", "wt"].
  • var_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 ("Posterior" / "Prior").
  • mcmcdaigs::Bool=true: A boolean to indicate if user wants to visualize mcmc diagnosis plots and Effective Sample Size(ESS).
  • time_varying_plots::Bool=true: A boolean to indicate if user wants to visualize time varying parameters.
  • non_time_varying_plots::Bool=true: A boolean to indicate if user wants to visualize non-time varying parameters.
  • pred_param_plots::Bool=true: A boolean to indicate if user wants to visualize posterior (or prior) predictive parameter results.
  • 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_mcmcdiag: A string to indicate the name of the plot to save for MCMC diagnostics. Default is "mcmcdiagnosisplots".
  • plot_name_to_save_time_varying: A string to indicate the name of the plot to save for time varying parameters. Default is "mcmctimevaryingparameterplots".
  • plot_name_to_save_non_time_varying: A string to indicate the name of the plot to save for non-time varying parameters. Default is "mcmcnontimevaryingparameterplots".
  • plot_name_to_save_pred_param: A string to indicate the name of the plot to save for posterior (or prior) predictive parameter results. Default is "mcmcpredparameter_plots".
source
diff --git a/dev/search_index.js b/dev/search_index.js index c0f8aca..b2ace34 100644 --- a/dev/search_index.js +++ b/dev/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"tutorial_index/#tutorial_home","page":"TUTORIAL CONTENTS","title":"Tutorial Contents","text":"","category":"section"},{"location":"tutorial_index/","page":"TUTORIAL CONTENTS","title":"TUTORIAL CONTENTS","text":"Future Description.","category":"page"},{"location":"tutorial_index/#Contents","page":"TUTORIAL CONTENTS","title":"Contents","text":"","category":"section"},{"location":"tutorial_index/","page":"TUTORIAL CONTENTS","title":"TUTORIAL CONTENTS","text":"Getting Started\nGenerating simulated data with UCIWWEIHR ODE compartmental based model.\nGenerating simulated data with an agent based model.\nGenerating posterior distribution samples with UCIWWEIHR ODE compartmental based model without forecasting.\nGenerating posterior distribution samples with UCIWWEIHR ODE compartmental based model with forecasting.","category":"page"},{"location":"license/#license","page":"LICENSE","title":"UCIWWEIHR.jl Package License","text":"","category":"section"},{"location":"license/","page":"LICENSE","title":"LICENSE","text":"The UCIWWEIHR.jl package is licensed under the MIT License.","category":"page"},{"location":"license/#MIT-License","page":"LICENSE","title":"MIT License","text":"","category":"section"},{"location":"license/","page":"LICENSE","title":"LICENSE","text":"MIT License","category":"page"},{"location":"license/","page":"LICENSE","title":"LICENSE","text":"Copyright (c) 2024 Christian O. Bernal Zelaya","category":"page"},{"location":"license/","page":"LICENSE","title":"LICENSE","text":"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:","category":"page"},{"location":"license/","page":"LICENSE","title":"LICENSE","text":"The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.","category":"page"},{"location":"license/","page":"LICENSE","title":"LICENSE","text":"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.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"using Plots, StatsPlots; gr()\nPlots.reset_defaults()\n","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#uciwwiehr_model_fitting_with_forecast","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"Generating Posterior Distribution Samples with UCIWWEIHR ODE Compartmental Based Model with Forecasting.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"Here we extend the previous tutorial to include forecasting capabilities. We start with generating out data using generate_simulation_data_uciwweihr's alternate parameterization where we do not prespecify the effective reproduction number and hospitalization probability but instead preform a log-normal random walk and a logit-normal random walk respectively. We then sample from the posterior distribution using the uciwweihr_fit.jl function. We then generate desired quantities and forecast for a given time period with the posterior predictive distribution, using uciwweihr_gq_pp.jl.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#1.-Data-Generation.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"1. Data Generation.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"Here we generate two datasets, one with 150 time points and one with 178 time points. We will use the 150 time point dataset for fitting and the 178 time point dataset for forecast evaluation.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"using UCIWWEIHR\n# Running simulation function with presets\nparams = create_uciwweihr_sim_params(\n time_points = 150\n)\ndf = generate_simulation_data_uciwweihr(params)\n\nparams_ext = create_uciwweihr_sim_params(\n time_points = 178\n)\ndf_ext = generate_simulation_data_uciwweihr(params_ext)\nfirst(df, 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"first(df_ext, 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#2.-Sampling-from-the-Posterior-Distribution-and-Posterior-Predictive-Distribution.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"2. Sampling from the Posterior Distribution and Posterior Predictive Distribution.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"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.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"data_hosp = df.hosp\ndata_wastewater = df.log_ww_conc\nobstimes = df.obstimes\nparam_change_times = 1:7:length(obstimes) # Change every week\npriors_only = false\nn_samples = 200\nforecast = true\nforecast_weeks = 4\n\nmodel_params = create_uciwweihr_model_params()\nsamples = uciwweihr_fit(\n data_hosp,\n data_wastewater;\n obstimes,\n param_change_times,\n priors_only,\n n_samples,\n params = model_params\n)\nmodel_output = uciwweihr_gq_pp(\n samples,\n data_hosp,\n data_wastewater;\n obstimes = obstimes,\n param_change_times = param_change_times,\n params = model_params,\n forecast = forecast,\n forecast_weeks = forecast_weeks\n)\n\nfirst(model_output[1][:,1:5], 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"first(model_output[2][:,1:5], 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"first(model_output[3][:,1:5], 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#3.-MCMC-Diagnostic-Plots/Results-Along-with-Posterior-Predictive-Distribution.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"3. MCMC Diagnostic Plots/Results Along with Posterior Predictive Distribution.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"We can again look at model diagnostics, posterior distribution of time or non-time varying parameters, and the posterior predictive distribution extended for forecasting.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"uciwweihr_visualizer(\n pp_samples = model_output[1],\n gq_samples = model_output[2],\n data_hosp = df_ext.hosp,\n data_wastewater = df_ext.log_ww_conc, \n actual_rt_vals = df_ext.rt, \n actual_w_t = df_ext.wt, \n actual_non_time_varying_vals = params,\n forecast_weeks = forecast_weeks,\n bayes_dist_type = \"Posterior\",\n save_plots = true,\n plot_name_to_save_mcmcdiag = \"mcmc_diagnosis_plots1\",\n plot_name_to_save_time_varying = \"mcmc_time_varying_parameter_plots1\",\n plot_name_to_save_non_time_varying = \"mcmc_nontime_varying_parameter_plots1\",\n plot_name_to_save_pred_param = \"mcmc_pred_parameter_plots1\"\n)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#3.1.-MCMC-Diagnostic-Plots.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"3.1. MCMC Diagnostic Plots.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"(Image: Plot 1)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#3.2.-Time-Varying-Parameter-Results-Plot.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"3.2. Time Varying Parameter Results Plot.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"(Image: Plot 2)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#3.3.-Non-Time-Varying-Parameter-Results-Plot.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"3.3. Non-Time Varying Parameter Results Plot.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"(Image: Plot 3)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#3.4.-Posterior-Predictive-Distribution-Plot.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"3.4. Posterior Predictive Distribution Plot.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"(Image: Plot 4)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#[Tutorial-Contents](@ref-tutorial_home)","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"Tutorial Contents","text":"","category":"section"},{"location":"tutorials/agent_based_simulation_data/#agent_based_simulation_data","page":"AGENT-BASED SIMULATION DATA","title":"Generating simulated data with an agent based model.","text":"","category":"section"},{"location":"tutorials/agent_based_simulation_data/","page":"AGENT-BASED SIMULATION DATA","title":"AGENT-BASED SIMULATION DATA","text":"This package provides a way to also simulate data using the agent based model in the future paper. The function called generate_simulation_data_agent.jl can be used to generate synthetic data for a given population size and features. Here we provide a demonstration using the default settings of generate_simulation_data_agent.jl :","category":"page"},{"location":"tutorials/agent_based_simulation_data/#1.-Functionality.","page":"AGENT-BASED SIMULATION DATA","title":"1. Functionality.","text":"","category":"section"},{"location":"tutorials/agent_based_simulation_data/","page":"AGENT-BASED SIMULATION DATA","title":"AGENT-BASED SIMULATION DATA","text":"using UCIWWEIHR\nusing Plots\n# Running simulation function with defaults\ndf = generate_simulation_data_agent()\nfirst(df, 5)","category":"page"},{"location":"tutorials/agent_based_simulation_data/#2.-Visualizing-SEIHR-compartments.","page":"AGENT-BASED SIMULATION DATA","title":"2. Visualizing SEIHR compartments.","text":"","category":"section"},{"location":"tutorials/agent_based_simulation_data/","page":"AGENT-BASED SIMULATION DATA","title":"AGENT-BASED SIMULATION DATA","text":"We can also use the Plots package to visualize the data generated.","category":"page"},{"location":"tutorials/agent_based_simulation_data/","page":"AGENT-BASED SIMULATION DATA","title":"AGENT-BASED SIMULATION DATA","text":"plot(df.Time, df.S, label = \"Suseptible\", \n xlabel = \"Time\", \n ylabel = \"Number of Individuals\", \n title = \"Agent Based Model Simulation Results\")\nplot!(df.Time, df.E, label = \"Exposed\")\nplot!(df.Time, df.I, label = \"Infected\")\nplot!(df.Time, df.H, label = \"Hospitalized\")\nplot!(df.Time, df.R, label = \"Recovered\")","category":"page"},{"location":"tutorials/agent_based_simulation_data/#[Tutorial-Contents](@ref-tutorial_home)","page":"AGENT-BASED SIMULATION DATA","title":"Tutorial Contents","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"using Plots, StatsPlots; gr()\nPlots.reset_defaults()\n","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#uciwwiehr_model_fitting_no_forecast","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"Generating Posterior Distribution Samples with UCIWWEIHR ODE Compartmental Based Model without Forecasting.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"This package has a way to sample from a posterior or prior that is defined in the future paper using the uciwweihr_fit.jl and uciwweihr_model.jl. We can then generate desired quantities and forecast for a given time period with the posterior predictive distribution, using uciwweihr_gq_pp.jl. We first generate data using the generate_simulation_data_uciwweihr function which is a non-mispecified version of the model, we will also be using prespecified effective reporduction curves and prespecified hospitalization probability curves.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#1.-Data-Generation.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"1. Data Generation.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"using UCIWWEIHR\n# Running simulation function with presets\nrt_custom = vcat(\n range(1, stop=1.8, length=7*4),\n fill(1.8, 7*2),\n range(1.8, stop=1, length=7*8),\n range(0.98, stop=0.8, length=7*2),\n range(0.8, stop=1.1, length=7*6),\n range(1.1, stop=0.97, length=7*3)\n)\nw_custom = vcat(\n range(0.3, stop=0.38, length=7*5),\n fill(0.38, 7*2),\n range(0.38, stop=0.25, length=7*8),\n range(0.25, stop=0.28, length=7*2),\n range(0.28, stop=0.34, length=7*6),\n range(0.34, stop=0.28, length=7*2)\n)\nparams = create_uciwweihr_sim_params(\n time_points = length(rt_custom),\n Rt = rt_custom, \n w = w_custom\n)\ndf = generate_simulation_data_uciwweihr(params)\nfirst(df, 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#2.-Sampling-from-the-Posterior-Distribution-and-Posterior-Predictive-Distribution.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"2. Sampling from the Posterior Distribution and Posterior Predictive Distribution.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"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.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"data_hosp = df.hosp\ndata_wastewater = df.log_ww_conc\nobstimes = df.obstimes\nparam_change_times = 1:7:length(obstimes) # Change every week\npriors_only = false\nn_samples = 200\n\nmodel_params = create_uciwweihr_model_params()\nsamples = uciwweihr_fit(\n data_hosp,\n data_wastewater;\n obstimes,\n param_change_times,\n priors_only,\n n_samples,\n params = model_params\n)\nmodel_output = uciwweihr_gq_pp(\n samples,\n data_hosp,\n data_wastewater;\n obstimes = obstimes,\n param_change_times = param_change_times,\n params = model_params\n)\n\nfirst(model_output[1][:,1:5], 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"first(model_output[2][:,1:5], 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"first(model_output[3][:,1:5], 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#3.-MCMC-Diagnostic-Plots/Results-Along-with-Posterior-Predictive-Distribution.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"3. MCMC Diagnostic Plots/Results Along with Posterior Predictive Distribution.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"We also provide a very basic way to visualize some MCMC diagnostics along with effective sample sizes of desired generated quantities(does not include functionality for time-varying quantities). Along with this, we can also visualize the posterior predictive distribution with actual observed values, which can be used to examine forecasts generated by the model.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"uciwweihr_visualizer(\n pp_samples = model_output[1],\n gq_samples = model_output[2],\n data_hosp = data_hosp,\n data_wastewater = data_wastewater, \n actual_rt_vals = df.rt, \n actual_w_t = df.wt, \n actual_non_time_varying_vals = params,\n bayes_dist_type = \"Posterior\",\n save_plots = true\n)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#3.1.-MCMC-Diagnostic-Plots.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"3.1. MCMC Diagnostic Plots.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"(Image: Plot 1)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#3.2.-Time-Varying-Parameter-Results-Plot.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"3.2. Time Varying Parameter Results Plot.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"(Image: Plot 2)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#3.3.-Non-Time-Varying-Parameter-Results-Plot.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"3.3. Non-Time Varying Parameter Results Plot.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"(Image: Plot 3)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#3.4.-Posterior-Predictive-Distribution-Plot.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"3.4. Posterior Predictive Distribution Plot.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"(Image: Plot 4)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#[Tutorial-Contents](@ref-tutorial_home)","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"Tutorial Contents","text":"","category":"section"},{"location":"tutorials/getting_started/#getting_started","page":"GETTING STARTED","title":"Getting Started","text":"","category":"section"},{"location":"tutorials/getting_started/","page":"GETTING STARTED","title":"GETTING STARTED","text":"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.","category":"page"},{"location":"tutorials/getting_started/#1.-Installation.","page":"GETTING STARTED","title":"1. Installation.","text":"","category":"section"},{"location":"tutorials/getting_started/","page":"GETTING STARTED","title":"GETTING STARTED","text":"To install the UCIWWEIHR.jl package, open the Julia REPL and run the following command:","category":"page"},{"location":"tutorials/getting_started/","page":"GETTING STARTED","title":"GETTING STARTED","text":"using Pkg\nPkg.add(\"git@github.com:cbernalz/UCIWWEIHR.jl.git\")","category":"page"},{"location":"tutorials/getting_started/#[Tutorial-Contents](@ref-tutorial_home)","page":"GETTING STARTED","title":"Tutorial Contents","text":"","category":"section"},{"location":"reference/#reference","page":"REFERENCE","title":"Reference","text":"","category":"section"},{"location":"reference/#Contents","page":"REFERENCE","title":"Contents","text":"","category":"section"},{"location":"reference/","page":"REFERENCE","title":"REFERENCE","text":"Pages = [\"reference.md\"]","category":"page"},{"location":"reference/#Index","page":"REFERENCE","title":"Index","text":"","category":"section"},{"location":"reference/","page":"REFERENCE","title":"REFERENCE","text":"Pages = [\"reference.md\"]","category":"page"},{"location":"reference/","page":"REFERENCE","title":"REFERENCE","text":"Modules = [UCIWWEIHR]","category":"page"},{"location":"reference/#UCIWWEIHR.uciwweihr_model_params","page":"REFERENCE","title":"UCIWWEIHR.uciwweihr_model_params","text":"uciwweihr_model_params\n\nStruct for holding parameters used in the UCIWWEIHR ODE compartmental model. Use create_uciwweihr_model_params to create an instance of this struct.\n\nFields\n\nE_init_sd::Float64=50.0: Standard deviation for the initial number of exposed individuals.\nE_init_mean::Int64=200: Mean for the initial number of exposed individuals.\nI_init_sd::Float64=20.0: Standard deviation for the initial number of infected individuals.\nI_init_mean::Int64=100: Mean for the initial number of infected individuals.\nH_init_sd::Float64=5.0: Standard deviation for the initial number of hospitalized individuals.\nH_init_mean::Int64=20: Mean for the initial number of hospitalized individuals.\ngamma_sd::Float64=0.02: Standard deviation for the rate of incubation.\nlog_gamma_mean::Float64=log(1/4): Mean for the rate of incubation on log scale.\nnu_sd::Float64=0.02: Standard deviation for the rate of leaving the infected compartment.\nlog_nu_mean::Float64=log(1/7): Mean for the rate of leaving the infected compartment on the log scale.\nepsilon_sd::Float64=0.02: Standard deviation for the rate of hospitalization recovery.\nlog_epsilon_mean::Float64=log(1/5): Mean for the rate of hospitalization recovery on the log scale.\nrho_gene_sd::Float64=0.02: Standard deviation for the rho prior.\nlog_rho_gene_mean::Float64=log(0.011): Mean for the row prior on log scale.\ntau_sd::Float64=0.02: Standard deviation for the scale/variation of the log scale data.\nlog_tau_mean::Float64=log(0.1): Mean for the scale/variation of the log scale data on log scale itself.\ndf_shape::Float64=2.0: Shape parameter for the gamma distribution.\ndf_scale::Float64=10.0: Scale parameter for the gamma distribution.\nsigma_hosp_sd::Float64=50.0: Standard deviation for the negative binomial distribution for hospital data.\nsigma_hosp_mean::Float64=500.0: Mean for the negative binomial distribution for hospital data.\nRt_init_sd::Float64=0.3: Standard deviation for the initial value of the time-varying reproduction number.\nRt_init_mean::Float64=0.2: Mean for the initial value of the time-varying reproduction number.\nsigma_Rt_sd::Float64=0.2: Standard deviation for normal prior of log time-varying reproduction number standard deviation.\nsigma_Rt_mean::Float64=-3.0: Mean for normal prior of log time-varying reproduction number standard deviation.\nw_init_sd::Float64=0.1: Standard deviation for the initial value of the time-varying hospitalization rate.\nw_init_mean::Float64=log(0.35): Mean for the initial value of the time-varying hospitalization rate.\nsigma_w_sd::Float64=0.2: Standard deviation for normal prior of log time-varying hospitalization rate standard deviation.\nsigma_w_mean::Float64=-3.5: Mean for normal prior of time-varying hospitalization rate standard deviation.\n\n\n\n\n\n","category":"type"},{"location":"reference/#UCIWWEIHR.uciwweihr_sim_params","page":"REFERENCE","title":"UCIWWEIHR.uciwweihr_sim_params","text":"uciwweihr_sim_params\n\nStruct for holding parameters used in the UCIWWEIHR ODE compartmental model simulation. Use create_uciwweihr_sim_params to create an instance of this struct.\n\nFields\n\ntime_points::Int64: Number of time points for the simulation.\nseed::Int64: Seed for random number generation.\nE_init::Int64: Initial number of exposed individuals.\nI_init::Int64: Initial number of infected individuals.\nH_init::Int64: Initial number of hospitalized individuals.\ngamma::Float64: Rate of incubation.\nnu::Float64: Rate of leaving the infected compartment.\nepsilon::Float64: Rate of hospitalization recovery.\nrho_gene::Float64: Contribution of infected individual's pathogen genome into wastewater.\ntau::Float64: Scale/variation of the log concentration of pathogen genome in wastewater.\ndf::Float64: Degrees of freedom for generalized t-distribution for log concentration of pathogen genome in wastewater.\nsigma_hosp::Float64: Standard deviation for the negative binomial distribution for hospital data.\nRt::Union{Float64, Vector{Float64}}: Initial value or time series of the time-varying reproduction number.\nsigma_Rt::Float64: Standard deviation for random walk of time-varying reproduction number.\nw::Union{Float64, Vector{Float64}}: Initial value or time series of the time-varying hospitalization rate.\nsigma_w::Float64: Standard deviation for random walk of time-varying hospitalization rate.\nrt_init::Float64: Initial value of the time-varying reproduction number, NOT USER SPECIFIED create_uciwweihr_params TAKES CARE OF THIS.\nw_init::Float64: Initial value of the time-varying hospitalization rate, NOT USER SPECIFIED create_uciwweihr_params TAKES CARE OF THIS.\n\n\n\n\n\n","category":"type"},{"location":"reference/#UCIWWEIHR.ChainsCustomIndex-Tuple{MCMCChains.Chains, BitMatrix}","page":"REFERENCE","title":"UCIWWEIHR.ChainsCustomIndex","text":"ChainsCustomIndex(c::Chains, indices_to_keep::BitMatrix)\n\nReduce Chains object to only wanted indices. \n\nFunction created by Damon Bayer. \n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.NegativeBinomial2-Tuple{Any, Any}","page":"REFERENCE","title":"UCIWWEIHR.NegativeBinomial2","text":"Create a re-parametrized negative binomial distribution in terms of mean and overdispersion.\n\nArguments\n\nμ: Mean of the distribution.\nϕ: Overdispersion parameter.\n\nReturns\n\nA Distributions.NegativeBinomial distribution object.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.calculate_quantiles-NTuple{4, Any}","page":"REFERENCE","title":"UCIWWEIHR.calculate_quantiles","text":"calculate_quantiles(df, chain, var_prefix, quantiles)\n\nCalculate quantiles for a given chain and variable prefix. Quantiles can be any user desired quantile.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.create_uciwweihr_model_params-Tuple{}","page":"REFERENCE","title":"UCIWWEIHR.create_uciwweihr_model_params","text":"create_uciwweihr_model_params(; kwargs...)\n\nCreates a uciwweihr_sim_params struct with the option to either use a predetermined Rt and w or generate them as random walks.\n\nArguments\n\nkwargs...: Named arguments corresponding to the fields in uciwweihr_sim_params.\n\nReturns\n\nparams::uciwweihr_sim_params: A struct with simulation parameters.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.create_uciwweihr_sim_params-Tuple{}","page":"REFERENCE","title":"UCIWWEIHR.create_uciwweihr_sim_params","text":"createuciwweihrsim_params(; kwargs...)\n\nCreates a uciwweihr_sim_params struct with the option to either use a predetermined Rt and w or generate them as random walks.\n\nArguments\n\nkwargs...: Named arguments corresponding to the fields in uciwweihr_sim_params.\n\nReturns\n\nparams::uciwweihr_sim_params: A struct with simulation parameters.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.eihr_ode!-NTuple{4, Any}","page":"REFERENCE","title":"UCIWWEIHR.eihr_ode!","text":"eihr_ode!(du, u, p, t)\n\nCalculate the ordinary differential equations (ODEs) for the EIHR model.\n\nParameters:\n\ndu: Array{Float64,1} - The derivative of the state variables.\nu: Array{Float64,1} - The current state variables.\np: Tuple{Float64,Float64,Float64,Float64,Float64} - The model parameters (alpha, gamma, nu, w, epsilon).\nt: Float64 - The current time.\n\nReturns:\n\ndu: Array{Float64,1} - The derivative of the state variables.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.generate_colors-Tuple{Any}","page":"REFERENCE","title":"UCIWWEIHR.generate_colors","text":"generate_ribbon_colors(number_of_colors)\n\nGenerates a vector with colors for ribbons in plots.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.generate_logit_normal_random_walk-Tuple{Int64, Float64, Float64}","page":"REFERENCE","title":"UCIWWEIHR.generate_logit_normal_random_walk","text":"generate_logit_normal_random_walk(time_points::Int64, sigma::Float64, init_val::Float64)\n\nGenerates a logit-normal random walk time series.\n\nArguments\n\ntime_points::Int64: Number of time points.\nsigma::Float64: Standard deviation of the random walk in logit space.\ninit_val::Float64: Initial value of the random walk on the probability scale.\n\nReturns\n\nwalk::Vector{Float64}: Generated random walk on the probability scale.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.generate_random_walk-Tuple{Int64, Float64, Float64}","page":"REFERENCE","title":"UCIWWEIHR.generate_random_walk","text":"generate_random_walk(time_points::Int64, sigma::Float64, init_val::Float64)\n\nGenerates a random walk time series.\n\nArguments\n\ntime_points::Int64: Number of time points.\nsigma::Float64: Standard deviation of the random walk.\ninit_val::Float64: Initial value of the random walk.\n\nReturns\n\nwalk::Vector{Float64}: Generated random walk.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.generate_simulation_data_agent","page":"REFERENCE","title":"UCIWWEIHR.generate_simulation_data_agent","text":"Generating Simulation Data for Agent Based Model\n\nTo 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\n\nFunction Signature\n\nArguments\n\nseed::Int64: Seed for random number generation. Default value is 1.\npop_size::Int64: Size of the population. Default value is 1000.\nI_init::Int64: Initial number of infected individuals. Default value is 200.\nH_init::Int64: Initial number of hospitalized individuals. Default value is 20.\nbeta::Float64: Transmission rate. Default value is 0.001.\ngamma::Float64: Rate of exposed individuals becoming infectious. Default value is 1/4.\nnu::Float64: Rate of infected individuals recovering or getting hospitalized. Default value is 1/7.\nepsilon::Float64: Rate of hospitalized individuals recovering. Default value is 1/5.\nw_init::Float64: Probability of an infected individual becoming hospitalized. Default value is 0.35.\n\nReturns\n\ndf::DataFrame: A DataFrame containing the simulation data with columns Time, S, E, I, H, and R.\n\n\n\n\n\n","category":"function"},{"location":"reference/#UCIWWEIHR.generate_simulation_data_uciwweihr-Tuple{uciwweihr_sim_params}","page":"REFERENCE","title":"UCIWWEIHR.generate_simulation_data_uciwweihr","text":"generate_simulation_data(params::UCIWWEIHRParams)\n\nGenerates simulation data for the UCIWWEIHR ODE compartmental model.\n\nArguments\n\nparams::uciwweihr_sim_params: Struct containing parameters for the simulation.\n\nReturns\n\ndf::DataFrame: A DataFrame containing the simulation data with columns obstimes, log_ww_conc, hosp, rt, and wt.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.mcmcdiags_vis-Tuple{}","page":"REFERENCE","title":"UCIWWEIHR.mcmcdiags_vis","text":"mcmcdiags_vis(...)\n\nDefault 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.\n\nArguments\n\ngq_samples: Generated quantities samples from the posterior/prior distribution, index 2 in uciwweihrgqpp output.\ndesired_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\"]].\nactual_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.\nsave_plots::Bool=false: A boolean to indicate if user wants to save the plots as pngs into a plots folder.\nplot_name_to_save: A string to indicate the name of the plot to save. Default is \"mcmcdiagnosisplots\".\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.non_time_varying_param_vis-Tuple{}","page":"REFERENCE","title":"UCIWWEIHR.non_time_varying_param_vis","text":"non_time_varying_param_vis(...)\n\nUsed in the uciwweihr_visualizer to create visuals for non-time varying parameters.\n\nArguments\n\ngq_samples: Generated quantities samples from the posterior/prior distribution, index 2 in uciwweihrgqpp output.\ndesired_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\"]\nbayes_dist_type: A string to indicate if user is using Posterior or Prior distribution. Default is \"Posterior\".\nactual_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.\nsave_plots::Bool=false: A boolean to indicate if user wants to save the plots as pngs into a plots folder.\nplot_name_to_save: A string to indicate the name of the plot to save. Default is \"mcmcnontimevaryingparameterplots\".\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.power-Tuple{Any, Any}","page":"REFERENCE","title":"UCIWWEIHR.power","text":"power(a,b)\n\nRaise `a` to the `b` power\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.predictive_param_vis-Tuple{}","page":"REFERENCE","title":"UCIWWEIHR.predictive_param_vis","text":"predictive_param_vis(...)\n\nUsed in the uciwweihr_visualizer to create visuals for wastewater data and hospitalization data.\n\nArguments\n\npp_samples: A DataFrame of posterior or prior predictive samples.\ndata_wastewater: An array of actual wastewater values if user has access to them assumed, using time scale of observed time points. Default is nothing.\ndata_hosp: An array of actual hospitalization values if user has access to them assumed, , using time scale of observed time points. Default is nothing.\nforecast_weeks: An integer of the number of weeks forecasted. Default is 0.\nvars_to_pred: A list of variables to predict. Default is [\"datawastewater\", \"datahosp\"].\nquantiles: A list of quantiles to calculate for ploting uncertainty. Default is [0.5, 0.8, 0.95].\nbayes_dist_type: A string to indicate if user is using Posterior or Prior distribution. Default is \"Posterior\".\nsave_plots::Bool=false: A boolean to indicate if user wants to save the plots as pngs into a plots folder.\nplot_name_to_save: A string to indicate the name of the plot to save. Default is \"mcmcpredparameter_plots\".\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.repeat_last_n_elements-Union{Tuple{T}, Tuple{Vector{T}, Int64, Int64}} where T","page":"REFERENCE","title":"UCIWWEIHR.repeat_last_n_elements","text":"repeat_last_n_elements(x::Vector{T}, n::Int, w::Int) where T\n\nModifies a given array so that the last n elements are repeated w times.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.save_plots_to_docs-Tuple{Any, Any}","page":"REFERENCE","title":"UCIWWEIHR.save_plots_to_docs","text":"save_plots_to_docs(plot, filename; format = \"png\")\n\nSaves plots to docs/plots directory.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.startswith_any-Tuple{Any, Any}","page":"REFERENCE","title":"UCIWWEIHR.startswith_any","text":"startswith_any(name, patterns)\n\nChecks if the name of time varying paramter starts with any of the patterns.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.time_varying_param_vis-Tuple{}","page":"REFERENCE","title":"UCIWWEIHR.time_varying_param_vis","text":"time_varying_param_vis(...)\n\nUsed in the uciwweihr_visualizer to create visuals for time varying parameters.\n\nArguments\n\ngq_samples: Generated quantities samples from the posterior/prior distribution, index 2 in uciwweihrgqpp output.\nactual_rt_vals: An array of actual Rt values if user has access to them assumed to be on a daily scale. This typically will come from some simulation. Default is nothing.\nactual_w_t: An array of actual w_t values if user has access to them assumed to be on a daily scale. This typically will come from some simulation. Default is nothing.\ntime_varying_params: A list of time varying parameters to visualize. Default is [\"rtvals\", \"wt\"].\nquantiles: A list of quantiles to calculate for ploting uncertainty. Default is [0.5, 0.8, 0.95].\nsave_plots::Bool=false: A boolean to indicate if user wants to save the plots as pngs into a plots folder.\nplot_name_to_save: A string to indicate the name of the plot to save. Default is \"mcmctimevaryingparameterplots\".\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.uciwweihr_fit-Tuple{Any, Any}","page":"REFERENCE","title":"UCIWWEIHR.uciwweihr_fit","text":"uciwweihr_fit(...)\n\nThis 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.\n\nArguments\n\ndata_hosp: An array of hospital data.\ndata_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.\nobstimes: An array of timepoints for observed hosp/wastewater.\npriors_only::Bool=false: A boolean to indicate if only priors are to be sampled.\nn_samples::Int64=500: Number of samples to be drawn.\nn_chains::Int64=1: Number of chains to be run.\nseed::Int64=2024: Seed for the random number generator.\nparams::uciwweihr_model_params: A struct containing parameters for the model.\n\nReturns\n\nSamples from the posterior or prior distribution.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.uciwweihr_model-Tuple{Any, Any}","page":"REFERENCE","title":"UCIWWEIHR.uciwweihr_model","text":"uciwweihr_model(...)\n\nThis 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.\n\nArguments\n\ndata_hosp: An array of hospital data.\ndata_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.\nobstimes: An array of timepoints for observed hosp/wastewater.\nparam_change_times: An array of timepoints where the parameters change.\nparams::uciwweihr_model_params: A struct containing parameters for the model.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.uciwweihr_visualizer-Tuple{}","page":"REFERENCE","title":"UCIWWEIHR.uciwweihr_visualizer","text":"uciwweihr_visualizer(...)\n\nDefault 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.\n\nArguments\n\npp_sampeles: Posterior predictive samples from the posterior/prior distribution, index 1 in uciwweihrgqpp output.\ngq_samples: Generated quantities samples from the posterior/prior distribution, index 2 in uciwweihrgqpp output.\ndata_hosp: An array of hospital data.\ndata_wastewater: An array of pathogen genome concentration in localized wastewater data.\nactual_rt_vals: An array of actual Rt values if user has access to them assumed to be on a daily scale. This typically will come from some simulation. Default is nothing.\nactual_w_t: An array of actual w_t values if user has access to them assumed to be on a daily scale. This typically will come from some simulation. Default is nothing.\nactual_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.\nforecast_weeks: Number of weeks to forecasted. Default is 0.\ndesired_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\"]].\ntime_varying_params: A list of time varying parameters to visualize. Default is [\"rtvals\", \"wt\"].\nvar_to_pred: A list of variables to predict. Default is [\"datawastewater\", \"datahosp\"].\nquantiles: A list of quantiles to calculate for ploting uncertainty. Default is [0.5, 0.8, 0.95].\nbayes_dist_type: A string to indicate if user is using Posterior or Prior distribution (\"Posterior\" / \"Prior\").\nmcmcdaigs::Bool=true: A boolean to indicate if user wants to visualize mcmc diagnosis plots and Effective Sample Size(ESS).\ntime_varying_plots::Bool=true: A boolean to indicate if user wants to visualize time varying parameters. \nnon_time_varying_plots::Bool=true: A boolean to indicate if user wants to visualize non-time varying parameters.\npred_param_plots::Bool=true: A boolean to indicate if user wants to visualize posterior (or prior) predictive parameter results.\nsave_plots::Bool=false: A boolean to indicate if user wants to save the plots as pngs into a plots folder.\nplot_name_to_save_mcmcdiag: A string to indicate the name of the plot to save for MCMC diagnostics. Default is \"mcmcdiagnosisplots\".\nplot_name_to_save_time_varying: A string to indicate the name of the plot to save for time varying parameters. Default is \"mcmctimevaryingparameterplots\".\nplot_name_to_save_non_time_varying: A string to indicate the name of the plot to save for non-time varying parameters. Default is \"mcmcnontimevaryingparameterplots\".\nplot_name_to_save_pred_param: A string to indicate the name of the plot to save for posterior (or prior) predictive parameter results. Default is \"mcmcpredparameter_plots\".\n\n\n\n\n\n","category":"method"},{"location":"tutorials/uciwweihr_simulation_data/#uciwweihr_simulation_data","page":"UCIWWEIHR SIMULATION DATA","title":"Generating simulated data with UCIWWEIHR ODE compartmental based model.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"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 :","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#1.-Functionality.","page":"UCIWWEIHR SIMULATION DATA","title":"1. Functionality.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"using UCIWWEIHR\nusing Plots\n# Running simulation function with defaults\nparams = create_uciwweihr_sim_params()\ndf = generate_simulation_data_uciwweihr(params)\nfirst(df, 5)","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#1.2-Visualizing-UCIWWEIHR-model-results.","page":"UCIWWEIHR SIMULATION DATA","title":"1.2 Visualizing UCIWWEIHR model results.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"Here we can make simple plots to visualize the data generated using the Plots package.","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#1.2.1.-Concentration-of-pathogen-genome-in-wastewater(WW).","page":"UCIWWEIHR SIMULATION DATA","title":"1.2.1. Concentration of pathogen genome in wastewater(WW).","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.log_ww_conc,\n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Conc. of Pathogen Genome in WW\", \n title=\"Plot of Conc. of Pathogen Genome in WW Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#1.2.2.-Hospitalizations.","page":"UCIWWEIHR SIMULATION DATA","title":"1.2.2. Hospitalizations.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.hosp, \n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Hosp\", \n title=\"Plot of Hosp Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#1.2.3.-Reproductive-number.","page":"UCIWWEIHR SIMULATION DATA","title":"1.2.3. Reproductive number.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.rt, \n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Rt\", \n title=\"Plot of Rt Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#1.2.4.-Hospitalization-rate.","page":"UCIWWEIHR SIMULATION DATA","title":"1.2.4. Hospitalization rate.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.wt, \n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Rt\", \n title=\"Plot of Hospitalization Rate Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#2.-Alternate-Functionality.","page":"UCIWWEIHR SIMULATION DATA","title":"2. Alternate Functionality.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"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.","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"using UCIWWEIHR\nusing Plots\n# Running simulation function with prespecified Rt and hospitalization probability\nrt_custom = vcat(\n range(1, stop=1.8, length=7*4),\n fill(1.8, 7*2),\n range(1.8, stop=1, length=7*8),\n range(0.98, stop=0.8, length=7*2),\n range(0.8, stop=1.1, length=7*6),\n range(1.1, stop=0.97, length=7*3)\n)\nw_custom = vcat(\n range(0.3, stop=0.38, length=7*5),\n fill(0.38, 7*2),\n range(0.38, stop=0.25, length=7*8),\n range(0.25, stop=0.28, length=7*2),\n range(0.28, stop=0.34, length=7*6),\n range(0.34, stop=0.28, length=7*2)\n)\nparams = create_uciwweihr_sim_params(\n time_points = length(rt_custom),\n Rt = rt_custom, \n w = w_custom\n)\ndf = generate_simulation_data_uciwweihr(params)\nfirst(df, 5)","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#2.2-Visualizing-UCIWWEIHR-model-results.","page":"UCIWWEIHR SIMULATION DATA","title":"2.2 Visualizing UCIWWEIHR model results.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"We can visualize these results using the Plots package.","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#2.2.1.-Concentration-of-pathogen-genome-in-wastewater(WW).","page":"UCIWWEIHR SIMULATION DATA","title":"2.2.1. Concentration of pathogen genome in wastewater(WW).","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.log_ww_conc,\n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Conc. of Pathogen Genome in WW\", \n title=\"Plot of Conc. of Pathogen Genome in WW Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#2.2.2.-Hospitalizations.","page":"UCIWWEIHR SIMULATION DATA","title":"2.2.2. Hospitalizations.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.hosp, \n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Hosp\", \n title=\"Plot of Hosp Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#2.2.3.-Reproductive-number.","page":"UCIWWEIHR SIMULATION DATA","title":"2.2.3. Reproductive number.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.rt, \n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Rt\", \n title=\"Plot of Rt Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#2.2.4.-Hospitalization-rate.","page":"UCIWWEIHR SIMULATION DATA","title":"2.2.4. Hospitalization rate.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.wt, \n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Rt\", \n title=\"Plot of Hospitalization Rate Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#[Tutorial-Contents](@ref-tutorial_home)","page":"UCIWWEIHR SIMULATION DATA","title":"Tutorial Contents","text":"","category":"section"},{"location":"#UCIWWEIHR.jl","page":"HOME","title":"UCIWWEIHR.jl","text":"","category":"section"},{"location":"","page":"HOME","title":"HOME","text":"Welcome to the UCIWWEIHR.jl package documentation! CURRENTLY UNDER DEVELOPMENT!!!","category":"page"},{"location":"","page":"HOME","title":"HOME","text":"By : Christian O. Bernal Zelaya & Volodymyr M. Minin.","category":"page"},{"location":"#Introduction","page":"HOME","title":"Introduction","text":"","category":"section"},{"location":"","page":"HOME","title":"HOME","text":"UCIWWEIHR.jl is a Julia package for forecasting and nowcasting COVID-19 hospitalizations using pathogen genome concentrations. UCIWWEIHR.jl Package License","category":"page"},{"location":"#Features","page":"HOME","title":"Features","text":"","category":"section"},{"location":"","page":"HOME","title":"HOME","text":"Comprehensive library of Bayesian models\nSimulation of infectious disease \nModel calibration\nSensitivity analysis and uncertainty quantification?\nVisualization of results and MCMC evaluations(live?)","category":"page"},{"location":"#Installation","page":"HOME","title":"Installation","text":"","category":"section"},{"location":"","page":"HOME","title":"HOME","text":"To install UCIWWEIHR.jl, you can use the Julia package manager. Open the Julia REPL and run the following command:","category":"page"},{"location":"","page":"HOME","title":"HOME","text":"using Pkg\nPkg.add(\"git@github.com:cbernalz/UCIWWEIHR.jl.git\")","category":"page"}] +[{"location":"tutorial_index/#tutorial_home","page":"TUTORIAL CONTENTS","title":"Tutorial Contents","text":"","category":"section"},{"location":"tutorial_index/","page":"TUTORIAL CONTENTS","title":"TUTORIAL CONTENTS","text":"Future Description.","category":"page"},{"location":"tutorial_index/#Contents","page":"TUTORIAL CONTENTS","title":"Contents","text":"","category":"section"},{"location":"tutorial_index/","page":"TUTORIAL CONTENTS","title":"TUTORIAL CONTENTS","text":"Getting Started\nGenerating simulated data with UCIWWEIHR ODE compartmental based model.\nGenerating simulated data with an agent based model.\nGenerating posterior distribution samples with UCIWWEIHR ODE compartmental based model without forecasting.\nGenerating posterior distribution samples with UCIWWEIHR ODE compartmental based model with forecasting.","category":"page"},{"location":"license/#license","page":"LICENSE","title":"UCIWWEIHR.jl Package License","text":"","category":"section"},{"location":"license/","page":"LICENSE","title":"LICENSE","text":"The UCIWWEIHR.jl package is licensed under the MIT License.","category":"page"},{"location":"license/#MIT-License","page":"LICENSE","title":"MIT License","text":"","category":"section"},{"location":"license/","page":"LICENSE","title":"LICENSE","text":"MIT License","category":"page"},{"location":"license/","page":"LICENSE","title":"LICENSE","text":"Copyright (c) 2024 Christian O. Bernal Zelaya","category":"page"},{"location":"license/","page":"LICENSE","title":"LICENSE","text":"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:","category":"page"},{"location":"license/","page":"LICENSE","title":"LICENSE","text":"The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.","category":"page"},{"location":"license/","page":"LICENSE","title":"LICENSE","text":"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.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"using Plots, StatsPlots; gr()\nPlots.reset_defaults()\n","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#uciwwiehr_model_fitting_with_forecast","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"Generating Posterior Distribution Samples with UCIWWEIHR ODE Compartmental Based Model with Forecasting.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"Here we extend the previous tutorial to include forecasting capabilities. We start with generating out data using generate_simulation_data_uciwweihr's alternate parameterization where we do not prespecify the effective reproduction number and hospitalization probability but instead preform a log-normal random walk and a logit-normal random walk respectively. We then sample from the posterior distribution using the uciwweihr_fit.jl function. We then generate desired quantities and forecast for a given time period with the posterior predictive distribution, using uciwweihr_gq_pp.jl.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#1.-Data-Generation.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"1. Data Generation.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"Here we generate two datasets, one with 150 time points and one with 178 time points. We will use the 150 time point dataset for fitting and the 178 time point dataset for forecast evaluation.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"using UCIWWEIHR\n# Running simulation function with presets\nparams = create_uciwweihr_sim_params(\n time_points = 150\n)\ndf = generate_simulation_data_uciwweihr(params)\n\nparams_ext = create_uciwweihr_sim_params(\n time_points = 178\n)\ndf_ext = generate_simulation_data_uciwweihr(params_ext)\nfirst(df, 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"first(df_ext, 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#2.-Sampling-from-the-Posterior-Distribution-and-Posterior-Predictive-Distribution.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"2. Sampling from the Posterior Distribution and Posterior Predictive Distribution.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"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.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"data_hosp = df.hosp\ndata_wastewater = df.log_ww_conc\nobstimes = df.obstimes\nparam_change_times = 1:7:length(obstimes) # Change every week\npriors_only = false\nn_samples = 200\nforecast = true\nforecast_weeks = 4\n\nmodel_params = create_uciwweihr_model_params()\nsamples = uciwweihr_fit(\n data_hosp,\n data_wastewater;\n obstimes,\n param_change_times,\n priors_only,\n n_samples,\n params = model_params\n)\nmodel_output = uciwweihr_gq_pp(\n samples,\n data_hosp,\n data_wastewater;\n obstimes = obstimes,\n param_change_times = param_change_times,\n params = model_params,\n forecast = forecast,\n forecast_weeks = forecast_weeks\n)\n\nfirst(model_output[1][:,1:5], 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"first(model_output[2][:,1:5], 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"first(model_output[3][:,1:5], 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#3.-MCMC-Diagnostic-Plots/Results-Along-with-Posterior-Predictive-Distribution.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"3. MCMC Diagnostic Plots/Results Along with Posterior Predictive Distribution.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"We can again look at model diagnostics, posterior distribution of time or non-time varying parameters, and the posterior predictive distribution extended for forecasting. We can also add certain parameters to ensure priors will be plotted alongside their corresponding posteriors.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"uciwweihr_visualizer(\n data_hosp, \n data_wastewater,\n forecast_weeks,\n obstimes,\n param_change_times,\n 2024,\n forecast,\n model_params;\n pp_samples = model_output[1],\n gq_samples = model_output[2],\n obs_data_hosp = df_ext.hosp,\n obs_data_wastewater = df_ext.log_ww_conc, \n actual_rt_vals = df_ext.rt, \n actual_w_t = df_ext.wt, \n actual_non_time_varying_vals = params,\n bayes_dist_type = \"Posterior\",\n save_plots = true,\n plot_name_to_save_mcmcdiag = \"mcmc_diagnosis_plots1\",\n plot_name_to_save_time_varying = \"mcmc_time_varying_parameter_plots1\",\n plot_name_to_save_non_time_varying = \"mcmc_nontime_varying_parameter_plots1\",\n plot_name_to_save_pred_param = \"mcmc_pred_parameter_plots1\"\n)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#3.1.-MCMC-Diagnostic-Plots.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"3.1. MCMC Diagnostic Plots.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"(Image: Plot 1)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#3.2.-Time-Varying-Parameter-Results-Plot.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"3.2. Time Varying Parameter Results Plot.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"(Image: Plot 2)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#3.3.-Non-Time-Varying-Parameter-Results-Plot.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"3.3. Non-Time Varying Parameter Results Plot.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"(Image: Plot 3)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#3.4.-Posterior-Predictive-Distribution-Plot.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"3.4. Posterior Predictive Distribution Plot.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"(Image: Plot 4)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#[Tutorial-Contents](@ref-tutorial_home)","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"Tutorial Contents","text":"","category":"section"},{"location":"tutorials/agent_based_simulation_data/#agent_based_simulation_data","page":"AGENT-BASED SIMULATION DATA","title":"Generating simulated data with an agent based model.","text":"","category":"section"},{"location":"tutorials/agent_based_simulation_data/","page":"AGENT-BASED SIMULATION DATA","title":"AGENT-BASED SIMULATION DATA","text":"This package provides a way to also simulate data using the agent based model in the future paper. The function called generate_simulation_data_agent.jl can be used to generate synthetic data for a given population size and features. Here we provide a demonstration using the default settings of generate_simulation_data_agent.jl :","category":"page"},{"location":"tutorials/agent_based_simulation_data/#1.-Functionality.","page":"AGENT-BASED SIMULATION DATA","title":"1. Functionality.","text":"","category":"section"},{"location":"tutorials/agent_based_simulation_data/","page":"AGENT-BASED SIMULATION DATA","title":"AGENT-BASED SIMULATION DATA","text":"using UCIWWEIHR\nusing Plots\n# Running simulation function with defaults\ndf = generate_simulation_data_agent()\nfirst(df, 5)","category":"page"},{"location":"tutorials/agent_based_simulation_data/#2.-Visualizing-SEIHR-compartments.","page":"AGENT-BASED SIMULATION DATA","title":"2. Visualizing SEIHR compartments.","text":"","category":"section"},{"location":"tutorials/agent_based_simulation_data/","page":"AGENT-BASED SIMULATION DATA","title":"AGENT-BASED SIMULATION DATA","text":"We can also use the Plots package to visualize the data generated.","category":"page"},{"location":"tutorials/agent_based_simulation_data/","page":"AGENT-BASED SIMULATION DATA","title":"AGENT-BASED SIMULATION DATA","text":"plot(df.Time, df.S, label = \"Suseptible\", \n xlabel = \"Time\", \n ylabel = \"Number of Individuals\", \n title = \"Agent Based Model Simulation Results\")\nplot!(df.Time, df.E, label = \"Exposed\")\nplot!(df.Time, df.I, label = \"Infected\")\nplot!(df.Time, df.H, label = \"Hospitalized\")\nplot!(df.Time, df.R, label = \"Recovered\")","category":"page"},{"location":"tutorials/agent_based_simulation_data/#[Tutorial-Contents](@ref-tutorial_home)","page":"AGENT-BASED SIMULATION DATA","title":"Tutorial Contents","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"using Plots, StatsPlots; gr()\nPlots.reset_defaults()\n","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#uciwwiehr_model_fitting_no_forecast","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"Generating Posterior Distribution Samples with UCIWWEIHR ODE Compartmental Based Model without Forecasting.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"This package has a way to sample from a posterior or prior that is defined in the future paper using the uciwweihr_fit.jl and uciwweihr_model.jl. We can then generate desired quantities and forecast for a given time period with the posterior predictive distribution, using uciwweihr_gq_pp.jl. We first generate data using the generate_simulation_data_uciwweihr function which is a non-mispecified version of the model, we will also be using prespecified effective reporduction curves and prespecified hospitalization probability curves.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#1.-Data-Generation.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"1. Data Generation.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"using UCIWWEIHR\n# Running simulation function with presets\nrt_custom = vcat(\n range(1, stop=1.8, length=7*4),\n fill(1.8, 7*2),\n range(1.8, stop=1, length=7*8),\n range(0.98, stop=0.8, length=7*2),\n range(0.8, stop=1.1, length=7*6),\n range(1.1, stop=0.97, length=7*3)\n)\nw_custom = vcat(\n range(0.3, stop=0.38, length=7*5),\n fill(0.38, 7*2),\n range(0.38, stop=0.25, length=7*8),\n range(0.25, stop=0.28, length=7*2),\n range(0.28, stop=0.34, length=7*6),\n range(0.34, stop=0.28, length=7*2)\n)\nparams = create_uciwweihr_sim_params(\n time_points = length(rt_custom),\n Rt = rt_custom, \n w = w_custom\n)\ndf = generate_simulation_data_uciwweihr(params)\nfirst(df, 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#2.-Sampling-from-the-Posterior-Distribution-and-Posterior-Predictive-Distribution.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"2. Sampling from the Posterior Distribution and Posterior Predictive Distribution.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"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.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"data_hosp = df.hosp\ndata_wastewater = df.log_ww_conc\nobstimes = df.obstimes\nparam_change_times = 1:7:length(obstimes) # Change every week\npriors_only = false\nn_samples = 200\nforecast = false\nforecast_weeks = 0\n\nmodel_params = create_uciwweihr_model_params()\nsamples = uciwweihr_fit(\n data_hosp,\n data_wastewater;\n obstimes,\n param_change_times,\n priors_only,\n n_samples,\n params = model_params\n)\nmodel_output = uciwweihr_gq_pp(\n samples,\n data_hosp,\n data_wastewater;\n obstimes = obstimes,\n param_change_times = param_change_times,\n params = model_params\n)\n\nfirst(model_output[1][:,1:5], 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"first(model_output[2][:,1:5], 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"first(model_output[3][:,1:5], 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#3.-MCMC-Diagnostic-Plots/Results-Along-with-Posterior-Predictive-Distribution.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"3. MCMC Diagnostic Plots/Results Along with Posterior Predictive Distribution.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"We also provide a very basic way to visualize some MCMC diagnostics along with effective sample sizes of desired generated quantities(does not include functionality for time-varying quantities). Along with this, we can also visualize the posterior predictive distribution with actual observed values, which can be used to examine forecasts generated by the model. We can also add certain parameters to ensure priors will be plotted alongside their corresponding posteriors.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"uciwweihr_visualizer(\n data_hosp, \n data_wastewater,\n forecast_weeks,\n obstimes,\n param_change_times,\n 2024,\n forecast,\n model_params;\n pp_samples = model_output[1],\n gq_samples = model_output[2],\n obs_data_hosp = data_hosp,\n obs_data_wastewater = data_wastewater, \n actual_rt_vals = df.rt, \n actual_w_t = df.wt, \n actual_non_time_varying_vals = params,\n bayes_dist_type = \"Posterior\",\n save_plots = true\n)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#3.1.-MCMC-Diagnostic-Plots.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"3.1. MCMC Diagnostic Plots.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"(Image: Plot 1)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#3.2.-Time-Varying-Parameter-Results-Plot.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"3.2. Time Varying Parameter Results Plot.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"(Image: Plot 2)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#3.3.-Non-Time-Varying-Parameter-Results-Plot.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"3.3. Non-Time Varying Parameter Results Plot.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"(Image: Plot 3)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#3.4.-Posterior-Predictive-Distribution-Plot.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"3.4. Posterior Predictive Distribution Plot.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"(Image: Plot 4)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#[Tutorial-Contents](@ref-tutorial_home)","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"Tutorial Contents","text":"","category":"section"},{"location":"tutorials/getting_started/#getting_started","page":"GETTING STARTED","title":"Getting Started","text":"","category":"section"},{"location":"tutorials/getting_started/","page":"GETTING STARTED","title":"GETTING STARTED","text":"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.","category":"page"},{"location":"tutorials/getting_started/#1.-Installation.","page":"GETTING STARTED","title":"1. Installation.","text":"","category":"section"},{"location":"tutorials/getting_started/","page":"GETTING STARTED","title":"GETTING STARTED","text":"To install the UCIWWEIHR.jl package, open the Julia REPL and run the following command:","category":"page"},{"location":"tutorials/getting_started/","page":"GETTING STARTED","title":"GETTING STARTED","text":"using Pkg\nPkg.add(\"git@github.com:cbernalz/UCIWWEIHR.jl.git\")","category":"page"},{"location":"tutorials/getting_started/#[Tutorial-Contents](@ref-tutorial_home)","page":"GETTING STARTED","title":"Tutorial Contents","text":"","category":"section"},{"location":"reference/#reference","page":"REFERENCE","title":"Reference","text":"","category":"section"},{"location":"reference/#Contents","page":"REFERENCE","title":"Contents","text":"","category":"section"},{"location":"reference/","page":"REFERENCE","title":"REFERENCE","text":"Pages = [\"reference.md\"]","category":"page"},{"location":"reference/#Index","page":"REFERENCE","title":"Index","text":"","category":"section"},{"location":"reference/","page":"REFERENCE","title":"REFERENCE","text":"Pages = [\"reference.md\"]","category":"page"},{"location":"reference/","page":"REFERENCE","title":"REFERENCE","text":"Modules = [UCIWWEIHR]","category":"page"},{"location":"reference/#UCIWWEIHR.uciwweihr_model_params","page":"REFERENCE","title":"UCIWWEIHR.uciwweihr_model_params","text":"uciwweihr_model_params\n\nStruct for holding parameters used in the UCIWWEIHR ODE compartmental model. Use create_uciwweihr_model_params to create an instance of this struct.\n\nFields\n\nE_init_sd::Float64=50.0: Standard deviation for the initial number of exposed individuals.\nE_init_mean::Int64=200: Mean for the initial number of exposed individuals.\nI_init_sd::Float64=20.0: Standard deviation for the initial number of infected individuals.\nI_init_mean::Int64=100: Mean for the initial number of infected individuals.\nH_init_sd::Float64=5.0: Standard deviation for the initial number of hospitalized individuals.\nH_init_mean::Int64=20: Mean for the initial number of hospitalized individuals.\ngamma_sd::Float64=0.02: Standard deviation for the rate of incubation.\nlog_gamma_mean::Float64=log(1/4): Mean for the rate of incubation on log scale.\nnu_sd::Float64=0.02: Standard deviation for the rate of leaving the infected compartment.\nlog_nu_mean::Float64=log(1/7): Mean for the rate of leaving the infected compartment on the log scale.\nepsilon_sd::Float64=0.02: Standard deviation for the rate of hospitalization recovery.\nlog_epsilon_mean::Float64=log(1/5): Mean for the rate of hospitalization recovery on the log scale.\nrho_gene_sd::Float64=0.02: Standard deviation for the rho prior.\nlog_rho_gene_mean::Float64=log(0.011): Mean for the row prior on log scale.\ntau_sd::Float64=0.02: Standard deviation for the scale/variation of the log scale data.\nlog_tau_mean::Float64=log(0.1): Mean for the scale/variation of the log scale data on log scale itself.\ndf_shape::Float64=2.0: Shape parameter for the gamma distribution.\ndf_scale::Float64=10.0: Scale parameter for the gamma distribution.\nsigma_hosp_sd::Float64=50.0: Standard deviation for the negative binomial distribution for hospital data.\nsigma_hosp_mean::Float64=500.0: Mean for the negative binomial distribution for hospital data.\nRt_init_sd::Float64=0.3: Standard deviation for the initial value of the time-varying reproduction number.\nRt_init_mean::Float64=0.2: Mean for the initial value of the time-varying reproduction number.\nsigma_Rt_sd::Float64=0.2: Standard deviation for normal prior of log time-varying reproduction number standard deviation.\nsigma_Rt_mean::Float64=-3.0: Mean for normal prior of log time-varying reproduction number standard deviation.\nw_init_sd::Float64=0.1: Standard deviation for the initial value of the time-varying hospitalization rate.\nw_init_mean::Float64=log(0.35): Mean for the initial value of the time-varying hospitalization rate.\nsigma_w_sd::Float64=0.2: Standard deviation for normal prior of log time-varying hospitalization rate standard deviation.\nsigma_w_mean::Float64=-3.5: Mean for normal prior of time-varying hospitalization rate standard deviation.\n\n\n\n\n\n","category":"type"},{"location":"reference/#UCIWWEIHR.uciwweihr_sim_params","page":"REFERENCE","title":"UCIWWEIHR.uciwweihr_sim_params","text":"uciwweihr_sim_params\n\nStruct for holding parameters used in the UCIWWEIHR ODE compartmental model simulation. Use create_uciwweihr_sim_params to create an instance of this struct.\n\nFields\n\ntime_points::Int64: Number of time points for the simulation.\nseed::Int64: Seed for random number generation.\nE_init::Int64: Initial number of exposed individuals.\nI_init::Int64: Initial number of infected individuals.\nH_init::Int64: Initial number of hospitalized individuals.\ngamma::Float64: Rate of incubation.\nnu::Float64: Rate of leaving the infected compartment.\nepsilon::Float64: Rate of hospitalization recovery.\nrho_gene::Float64: Contribution of infected individual's pathogen genome into wastewater.\ntau::Float64: Scale/variation of the log concentration of pathogen genome in wastewater.\ndf::Float64: Degrees of freedom for generalized t-distribution for log concentration of pathogen genome in wastewater.\nsigma_hosp::Float64: Standard deviation for the negative binomial distribution for hospital data.\nRt::Union{Float64, Vector{Float64}}: Initial value or time series of the time-varying reproduction number.\nsigma_Rt::Float64: Standard deviation for random walk of time-varying reproduction number.\nw::Union{Float64, Vector{Float64}}: Initial value or time series of the time-varying hospitalization rate.\nsigma_w::Float64: Standard deviation for random walk of time-varying hospitalization rate.\nrt_init::Float64: Initial value of the time-varying reproduction number, NOT USER SPECIFIED create_uciwweihr_params TAKES CARE OF THIS.\nw_init::Float64: Initial value of the time-varying hospitalization rate, NOT USER SPECIFIED create_uciwweihr_params TAKES CARE OF THIS.\n\n\n\n\n\n","category":"type"},{"location":"reference/#UCIWWEIHR.ChainsCustomIndex-Tuple{MCMCChains.Chains, BitMatrix}","page":"REFERENCE","title":"UCIWWEIHR.ChainsCustomIndex","text":"ChainsCustomIndex(c::Chains, indices_to_keep::BitMatrix)\n\nReduce Chains object to only wanted indices. \n\nFunction created by Damon Bayer. \n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.NegativeBinomial2-Tuple{Any, Any}","page":"REFERENCE","title":"UCIWWEIHR.NegativeBinomial2","text":"Create a re-parametrized negative binomial distribution in terms of mean and overdispersion.\n\nArguments\n\nμ: Mean of the distribution.\nϕ: Overdispersion parameter.\n\nReturns\n\nA Distributions.NegativeBinomial distribution object.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.calculate_quantiles-NTuple{4, Any}","page":"REFERENCE","title":"UCIWWEIHR.calculate_quantiles","text":"calculate_quantiles(df, chain, var_prefix, quantiles)\n\nCalculate quantiles for a given chain and variable prefix. Quantiles can be any user desired quantile.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.create_uciwweihr_model_params-Tuple{}","page":"REFERENCE","title":"UCIWWEIHR.create_uciwweihr_model_params","text":"create_uciwweihr_model_params(; kwargs...)\n\nCreates a uciwweihr_sim_params struct with the option to either use a predetermined Rt and w or generate them as random walks.\n\nArguments\n\nkwargs...: Named arguments corresponding to the fields in uciwweihr_sim_params.\n\nReturns\n\nparams::uciwweihr_sim_params: A struct with simulation parameters.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.create_uciwweihr_sim_params-Tuple{}","page":"REFERENCE","title":"UCIWWEIHR.create_uciwweihr_sim_params","text":"createuciwweihrsim_params(; kwargs...)\n\nCreates a uciwweihr_sim_params struct with the option to either use a predetermined Rt and w or generate them as random walks.\n\nArguments\n\nkwargs...: Named arguments corresponding to the fields in uciwweihr_sim_params.\n\nReturns\n\nparams::uciwweihr_sim_params: A struct with simulation parameters.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.eihr_ode!-NTuple{4, Any}","page":"REFERENCE","title":"UCIWWEIHR.eihr_ode!","text":"eihr_ode!(du, u, p, t)\n\nCalculate the ordinary differential equations (ODEs) for the EIHR model.\n\nParameters:\n\ndu: Array{Float64,1} - The derivative of the state variables.\nu: Array{Float64,1} - The current state variables.\np: Tuple{Float64,Float64,Float64,Float64,Float64} - The model parameters (alpha, gamma, nu, w, epsilon).\nt: Float64 - The current time.\n\nReturns:\n\ndu: Array{Float64,1} - The derivative of the state variables.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.generate_colors-Tuple{Any}","page":"REFERENCE","title":"UCIWWEIHR.generate_colors","text":"generate_ribbon_colors(number_of_colors)\n\nGenerates a vector with colors for ribbons in plots.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.generate_logit_normal_random_walk-Tuple{Int64, Float64, Float64, Any}","page":"REFERENCE","title":"UCIWWEIHR.generate_logit_normal_random_walk","text":"generate_logit_normal_random_walk(time_points::Int64, sigma::Float64, init_val::Float64)\n\nGenerates a logit-normal random walk time series.\n\nArguments\n\ntime_points::Int64: Number of time points.\nsigma::Float64: Standard deviation of the random walk in logit space.\ninit_val::Float64: Initial value of the random walk on the probability scale.\n\nReturns\n\nwalk::Vector{Float64}: Generated random walk on the probability scale.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.generate_random_walk-Tuple{Int64, Float64, Float64, Any}","page":"REFERENCE","title":"UCIWWEIHR.generate_random_walk","text":"generate_random_walk(time_points::Int64, sigma::Float64, init_val::Float64)\n\nGenerates a random walk time series.\n\nArguments\n\ntime_points::Int64: Number of time points.\nsigma::Float64: Standard deviation of the random walk.\ninit_val::Float64: Initial value of the random walk.\n\nReturns\n\nwalk::Vector{Float64}: Generated random walk.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.generate_simulation_data_agent","page":"REFERENCE","title":"UCIWWEIHR.generate_simulation_data_agent","text":"Generating Simulation Data for Agent Based Model\n\nTo 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\n\nFunction Signature\n\nArguments\n\nseed::Int64: Seed for random number generation. Default value is 1.\npop_size::Int64: Size of the population. Default value is 1000.\nI_init::Int64: Initial number of infected individuals. Default value is 200.\nH_init::Int64: Initial number of hospitalized individuals. Default value is 20.\nbeta::Float64: Transmission rate. Default value is 0.001.\ngamma::Float64: Rate of exposed individuals becoming infectious. Default value is 1/4.\nnu::Float64: Rate of infected individuals recovering or getting hospitalized. Default value is 1/7.\nepsilon::Float64: Rate of hospitalized individuals recovering. Default value is 1/5.\nw_init::Float64: Probability of an infected individual becoming hospitalized. Default value is 0.35.\n\nReturns\n\ndf::DataFrame: A DataFrame containing the simulation data with columns Time, S, E, I, H, and R.\n\n\n\n\n\n","category":"function"},{"location":"reference/#UCIWWEIHR.generate_simulation_data_uciwweihr-Tuple{uciwweihr_sim_params}","page":"REFERENCE","title":"UCIWWEIHR.generate_simulation_data_uciwweihr","text":"generate_simulation_data(params::UCIWWEIHRParams)\n\nGenerates simulation data for the UCIWWEIHR ODE compartmental model.\n\nArguments\n\nparams::uciwweihr_sim_params: Struct containing parameters for the simulation.\n\nReturns\n\ndf::DataFrame: A DataFrame containing the simulation data with columns obstimes, log_ww_conc, hosp, rt, and wt.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.mcmcdiags_vis-Tuple{}","page":"REFERENCE","title":"UCIWWEIHR.mcmcdiags_vis","text":"mcmcdiags_vis(...)\n\nDefault 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.\n\nArguments\n\ngq_samples: Generated quantities samples from the posterior/prior distribution, index 2 in uciwweihrgqpp output.\ndesired_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\"]].\nactual_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.\nsave_plots::Bool=false: A boolean to indicate if user wants to save the plots as pngs into a plots folder.\nplot_name_to_save: A string to indicate the name of the plot to save. Default is \"mcmcdiagnosisplots\".\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.non_time_varying_param_vis-Tuple{}","page":"REFERENCE","title":"UCIWWEIHR.non_time_varying_param_vis","text":"non_time_varying_param_vis(...)\n\nUsed in the uciwweihr_visualizer to create visuals for non-time varying parameters.\n\nArguments\n\ngq_samples: Generated quantities samples from the posterior/prior distribution, index 2 in uciwweihrgqpp output.\ndesired_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\"]\nbayes_dist_type: A string to indicate if user is using Posterior or Prior distribution. Default is \"Posterior\".\nactual_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.\nsave_plots::Bool=false: A boolean to indicate if user wants to save the plots as pngs into a plots folder.\nplot_name_to_save: A string to indicate the name of the plot to save. Default is \"mcmcnontimevaryingparameterplots\".\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.power-Tuple{Any, Any}","page":"REFERENCE","title":"UCIWWEIHR.power","text":"power(a,b)\n\nRaise `a` to the `b` power\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.predictive_param_vis-Tuple{}","page":"REFERENCE","title":"UCIWWEIHR.predictive_param_vis","text":"predictive_param_vis(...)\n\nUsed in the uciwweihr_visualizer to create visuals for wastewater data and hospitalization data.\n\nArguments\n\npp_samples: A DataFrame of posterior or prior predictive samples.\ndata_wastewater: An array of actual wastewater values if user has access to them assumed, using time scale of observed time points. Default is nothing.\ndata_hosp: An array of actual hospitalization values if user has access to them assumed, , using time scale of observed time points. Default is nothing.\nforecast_weeks: An integer of the number of weeks forecasted. Default is 0.\nvars_to_pred: A list of variables to predict. Default is [\"datawastewater\", \"datahosp\"].\nquantiles: A list of quantiles to calculate for ploting uncertainty. Default is [0.5, 0.8, 0.95].\nbayes_dist_type: A string to indicate if user is using Posterior or Prior distribution. Default is \"Posterior\".\nsave_plots::Bool=false: A boolean to indicate if user wants to save the plots as pngs into a plots folder.\nplot_name_to_save: A string to indicate the name of the plot to save. Default is \"mcmcpredparameter_plots\".\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.repeat_last_n_elements-Union{Tuple{T}, Tuple{Vector{T}, Int64, Int64}} where T","page":"REFERENCE","title":"UCIWWEIHR.repeat_last_n_elements","text":"repeat_last_n_elements(x::Vector{T}, n::Int, w::Int) where T\n\nModifies a given array so that the last n elements are repeated w times.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.save_plots_to_docs-Tuple{Any, Any}","page":"REFERENCE","title":"UCIWWEIHR.save_plots_to_docs","text":"save_plots_to_docs(plot, filename; format = \"png\")\n\nSaves plots to docs/plots directory.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.startswith_any-Tuple{Any, Any}","page":"REFERENCE","title":"UCIWWEIHR.startswith_any","text":"startswith_any(name, patterns)\n\nChecks if the name of time varying paramter starts with any of the patterns.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.time_varying_param_vis-Tuple{uciwweihr_model_params, Vararg{Any, 7}}","page":"REFERENCE","title":"UCIWWEIHR.time_varying_param_vis","text":"time_varying_param_vis(...)\n\nUsed in the uciwweihr_visualizer to create visuals for time varying parameters.\n\nArguments\n\nbuild_params::uciwweihr_model_params: A struct of model parameters used to build gq_samples, used only if user desired priors next to posteriors.\ndata_hosp: Hospitalization data, used only if user desired priors next to posteriors.\ndata_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).\nobstimes: An array of time points for the data, used only if user desired priors next to posteriors.\nparam_change_times: An array of time points where the parameters change, used only if user desired priors next to posteriors.\nseed: An integer to set the seed for reproducibility, used only if user desired priors next to posteriors.\nforecast: A boolean to indicate if user wants to forecast, used only if user desired priors next to posteriors.\nforecast_weeks: An integer to indicate the number of weeks to forecast, used only if user desired priors next to posteriors.\ngq_samples: Generated quantities samples from the posterior/prior distribution, index 2 in uciwweihrgqpp output.\nactual_rt_vals: An array of actual Rt values if user has access to them assumed to be on a daily scale. This typically will come from some simulation. Default is nothing.\nactual_w_t: An array of actual w_t values if user has access to them assumed to be on a daily scale. This typically will come from some simulation. Default is nothing.\ntime_varying_params: A list of time varying parameters to visualize. Default is [\"rtvals\", \"wt\"].\nquantiles: A list of quantiles to calculate for ploting uncertainty. Default is [0.5, 0.8, 0.95].\nsave_plots::Bool=false: A boolean to indicate if user wants to save the plots as pngs into a plots folder.\nplot_name_to_save: A string to indicate the name of the plot to save. Default is \"mcmctimevaryingparameterplots\".\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.uciwweihr_fit-Tuple{Any, Any}","page":"REFERENCE","title":"UCIWWEIHR.uciwweihr_fit","text":"uciwweihr_fit(...)\n\nThis 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.\n\nArguments\n\ndata_hosp: An array of hospital data.\ndata_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.\nobstimes: An array of timepoints for observed hosp/wastewater.\npriors_only::Bool=false: A boolean to indicate if only priors are to be sampled.\nn_samples::Int64=500: Number of samples to be drawn.\nn_chains::Int64=1: Number of chains to be run.\nseed::Int64=2024: Seed for the random number generator.\nparams::uciwweihr_model_params: A struct containing parameters for the model.\n\nReturns\n\nSamples from the posterior or prior distribution.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.uciwweihr_model-Tuple{Any, Any}","page":"REFERENCE","title":"UCIWWEIHR.uciwweihr_model","text":"uciwweihr_model(...)\n\nThis 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.\n\nArguments\n\ndata_hosp: An array of hospital data.\ndata_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.\nobstimes: An array of timepoints for observed hosp/wastewater.\nparam_change_times: An array of timepoints where the parameters change.\nparams::uciwweihr_model_params: A struct containing parameters for the model.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.uciwweihr_visualizer-Tuple{Any, Any, Any, Any, Any, Any, Any, uciwweihr_model_params}","page":"REFERENCE","title":"UCIWWEIHR.uciwweihr_visualizer","text":"uciwweihr_visualizer(...)\n\nDefault 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.\n\nArguments\n\nbuild_params::uciwweihr_model_params: A uciwweihrmodelparams object, if user desires priors next to plot (do not specify if you do not want prior plots).\ndata_hosp: An array of hospital data used for model fitting, if user desires priors next to plot (do not specify if you do not want prior plots).\ndata_wastewater: An array of wastewater data used for model fitting, 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).\nobstimes: An array of timepoints for observed hosp/wastewater, if user desires priors next to plot (do not specify if you do not want prior plots).\nparam_change_times: An array of timepoints where the parameters change, if user desires priors next to plot (do not specify if you do not want prior plots).\nseed: Seed for the random number generator, if user desires priors next to plot (do not specify if you do not want prior plots).\nforecast: A boolean to indicate if forecasting is to be done, if user desires priors next to plot (do not specify if you do not want prior plots).\nforecast_weeks: Number of weeks to forecast, if user desires priors next to plot (do not specify if you do not want prior plots).\npp_sampeles: Posterior predictive samples from the posterior/prior distribution, index 1 in uciwweihrgqpp output.\ngq_samples: Generated quantities samples from the posterior/prior distribution, index 2 in uciwweihrgqpp output.\nobs_data_hosp: An array of hospital data, data used for model fitting or extened timeseries for evaluation of forecast.\nobs_data_wastewater: An array of wastewater data, data used for model fitting or extened timeseries for evaluation of forecast.\nactual_rt_vals: An array of actual Rt values if user has access to them assumed to be on a daily scale. This typically will come from some simulation. Default is nothing.\nactual_w_t: An array of actual w_t values if user has access to them assumed to be on a daily scale. This typically will come from some simulation. Default is nothing.\nactual_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.\ndesired_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\"]].\ntime_varying_params: A list of time varying parameters to visualize. Default is [\"rtvals\", \"wt\"].\nvar_to_pred: A list of variables to predict. Default is [\"datawastewater\", \"datahosp\"].\nquantiles: A list of quantiles to calculate for ploting uncertainty. Default is [0.5, 0.8, 0.95].\nbayes_dist_type: A string to indicate if user is using Posterior or Prior distribution (\"Posterior\" / \"Prior\").\nmcmcdaigs::Bool=true: A boolean to indicate if user wants to visualize mcmc diagnosis plots and Effective Sample Size(ESS).\ntime_varying_plots::Bool=true: A boolean to indicate if user wants to visualize time varying parameters. \nnon_time_varying_plots::Bool=true: A boolean to indicate if user wants to visualize non-time varying parameters.\npred_param_plots::Bool=true: A boolean to indicate if user wants to visualize posterior (or prior) predictive parameter results.\nsave_plots::Bool=false: A boolean to indicate if user wants to save the plots as pngs into a plots folder.\nplot_name_to_save_mcmcdiag: A string to indicate the name of the plot to save for MCMC diagnostics. Default is \"mcmcdiagnosisplots\".\nplot_name_to_save_time_varying: A string to indicate the name of the plot to save for time varying parameters. Default is \"mcmctimevaryingparameterplots\".\nplot_name_to_save_non_time_varying: A string to indicate the name of the plot to save for non-time varying parameters. Default is \"mcmcnontimevaryingparameterplots\".\nplot_name_to_save_pred_param: A string to indicate the name of the plot to save for posterior (or prior) predictive parameter results. Default is \"mcmcpredparameter_plots\".\n\n\n\n\n\n","category":"method"},{"location":"tutorials/uciwweihr_simulation_data/#uciwweihr_simulation_data","page":"UCIWWEIHR SIMULATION DATA","title":"Generating simulated data with UCIWWEIHR ODE compartmental based model.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"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 :","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#1.-Functionality.","page":"UCIWWEIHR SIMULATION DATA","title":"1. Functionality.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"using UCIWWEIHR\nusing Plots\n# Running simulation function with defaults\nparams = create_uciwweihr_sim_params()\ndf = generate_simulation_data_uciwweihr(params)\nfirst(df, 5)","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#1.2-Visualizing-UCIWWEIHR-model-results.","page":"UCIWWEIHR SIMULATION DATA","title":"1.2 Visualizing UCIWWEIHR model results.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"Here we can make simple plots to visualize the data generated using the Plots package.","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#1.2.1.-Concentration-of-pathogen-genome-in-wastewater(WW).","page":"UCIWWEIHR SIMULATION DATA","title":"1.2.1. Concentration of pathogen genome in wastewater(WW).","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.log_ww_conc,\n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Conc. of Pathogen Genome in WW\", \n title=\"Plot of Conc. of Pathogen Genome in WW Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#1.2.2.-Hospitalizations.","page":"UCIWWEIHR SIMULATION DATA","title":"1.2.2. Hospitalizations.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.hosp, \n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Hosp\", \n title=\"Plot of Hosp Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#1.2.3.-Reproductive-number.","page":"UCIWWEIHR SIMULATION DATA","title":"1.2.3. Reproductive number.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.rt, \n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Rt\", \n title=\"Plot of Rt Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#1.2.4.-Hospitalization-rate.","page":"UCIWWEIHR SIMULATION DATA","title":"1.2.4. Hospitalization rate.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.wt, \n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Rt\", \n title=\"Plot of Hospitalization Rate Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#2.-Alternate-Functionality.","page":"UCIWWEIHR SIMULATION DATA","title":"2. Alternate Functionality.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"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.","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"using UCIWWEIHR\nusing Plots\n# Running simulation function with prespecified Rt and hospitalization probability\nrt_custom = vcat(\n range(1, stop=1.8, length=7*4),\n fill(1.8, 7*2),\n range(1.8, stop=1, length=7*8),\n range(0.98, stop=0.8, length=7*2),\n range(0.8, stop=1.1, length=7*6),\n range(1.1, stop=0.97, length=7*3)\n)\nw_custom = vcat(\n range(0.3, stop=0.38, length=7*5),\n fill(0.38, 7*2),\n range(0.38, stop=0.25, length=7*8),\n range(0.25, stop=0.28, length=7*2),\n range(0.28, stop=0.34, length=7*6),\n range(0.34, stop=0.28, length=7*2)\n)\nparams = create_uciwweihr_sim_params(\n time_points = length(rt_custom),\n Rt = rt_custom, \n w = w_custom\n)\ndf = generate_simulation_data_uciwweihr(params)\nfirst(df, 5)","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#2.2-Visualizing-UCIWWEIHR-model-results.","page":"UCIWWEIHR SIMULATION DATA","title":"2.2 Visualizing UCIWWEIHR model results.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"We can visualize these results using the Plots package.","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#2.2.1.-Concentration-of-pathogen-genome-in-wastewater(WW).","page":"UCIWWEIHR SIMULATION DATA","title":"2.2.1. Concentration of pathogen genome in wastewater(WW).","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.log_ww_conc,\n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Conc. of Pathogen Genome in WW\", \n title=\"Plot of Conc. of Pathogen Genome in WW Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#2.2.2.-Hospitalizations.","page":"UCIWWEIHR SIMULATION DATA","title":"2.2.2. Hospitalizations.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.hosp, \n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Hosp\", \n title=\"Plot of Hosp Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#2.2.3.-Reproductive-number.","page":"UCIWWEIHR SIMULATION DATA","title":"2.2.3. Reproductive number.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.rt, \n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Rt\", \n title=\"Plot of Rt Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#2.2.4.-Hospitalization-rate.","page":"UCIWWEIHR SIMULATION DATA","title":"2.2.4. Hospitalization rate.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.wt, \n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Rt\", \n title=\"Plot of Hospitalization Rate Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#[Tutorial-Contents](@ref-tutorial_home)","page":"UCIWWEIHR SIMULATION DATA","title":"Tutorial Contents","text":"","category":"section"},{"location":"#UCIWWEIHR.jl","page":"HOME","title":"UCIWWEIHR.jl","text":"","category":"section"},{"location":"","page":"HOME","title":"HOME","text":"Welcome to the UCIWWEIHR.jl package documentation! CURRENTLY UNDER DEVELOPMENT!!!","category":"page"},{"location":"","page":"HOME","title":"HOME","text":"By : Christian O. Bernal Zelaya & Volodymyr M. Minin.","category":"page"},{"location":"#Introduction","page":"HOME","title":"Introduction","text":"","category":"section"},{"location":"","page":"HOME","title":"HOME","text":"UCIWWEIHR.jl is a Julia package for forecasting and nowcasting COVID-19 hospitalizations using pathogen genome concentrations. UCIWWEIHR.jl Package License","category":"page"},{"location":"#Features","page":"HOME","title":"Features","text":"","category":"section"},{"location":"","page":"HOME","title":"HOME","text":"Comprehensive library of Bayesian models\nSimulation of infectious disease \nModel calibration\nSensitivity analysis and uncertainty quantification?\nVisualization of results and MCMC evaluations(live?)","category":"page"},{"location":"#Installation","page":"HOME","title":"Installation","text":"","category":"section"},{"location":"","page":"HOME","title":"HOME","text":"To install UCIWWEIHR.jl, you can use the Julia package manager. Open the Julia REPL and run the following command:","category":"page"},{"location":"","page":"HOME","title":"HOME","text":"using Pkg\nPkg.add(\"git@github.com:cbernalz/UCIWWEIHR.jl.git\")","category":"page"}] } diff --git a/dev/tutorial_index/index.html b/dev/tutorial_index/index.html index 0a6bdf6..f5d1ae3 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/8e00334d.svg b/dev/tutorials/agent_based_simulation_data/090f41b2.svg similarity index 87% rename from dev/tutorials/agent_based_simulation_data/8e00334d.svg rename to dev/tutorials/agent_based_simulation_data/090f41b2.svg index e1aa24d..fee5257 100644 --- a/dev/tutorials/agent_based_simulation_data/8e00334d.svg +++ b/dev/tutorials/agent_based_simulation_data/090f41b2.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 1f42152..17ce377 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 a839d35..1aa1b7a 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("git@github.com:cbernalz/UCIWWEIHR.jl.git")

Tutorial Contents

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

Tutorial Contents

diff --git a/dev/tutorials/plots/mcmc_diagnosis_plots.png b/dev/tutorials/plots/mcmc_diagnosis_plots.png index fe350b7..189c287 100644 Binary files a/dev/tutorials/plots/mcmc_diagnosis_plots.png and b/dev/tutorials/plots/mcmc_diagnosis_plots.png differ diff --git a/dev/tutorials/plots/mcmc_diagnosis_plots1.png b/dev/tutorials/plots/mcmc_diagnosis_plots1.png index 43e79fa..b3b497c 100644 Binary files a/dev/tutorials/plots/mcmc_diagnosis_plots1.png and b/dev/tutorials/plots/mcmc_diagnosis_plots1.png differ diff --git a/dev/tutorials/plots/mcmc_nontime_varying_parameter_plots.png b/dev/tutorials/plots/mcmc_nontime_varying_parameter_plots.png index fd606db..69c61a8 100644 Binary files a/dev/tutorials/plots/mcmc_nontime_varying_parameter_plots.png and b/dev/tutorials/plots/mcmc_nontime_varying_parameter_plots.png differ diff --git a/dev/tutorials/plots/mcmc_nontime_varying_parameter_plots1.png b/dev/tutorials/plots/mcmc_nontime_varying_parameter_plots1.png index 372b038..9039c8e 100644 Binary files a/dev/tutorials/plots/mcmc_nontime_varying_parameter_plots1.png and b/dev/tutorials/plots/mcmc_nontime_varying_parameter_plots1.png differ diff --git a/dev/tutorials/plots/mcmc_pred_parameter_plots1.png b/dev/tutorials/plots/mcmc_pred_parameter_plots1.png index 8d357fb..8c7eaae 100644 Binary files a/dev/tutorials/plots/mcmc_pred_parameter_plots1.png and b/dev/tutorials/plots/mcmc_pred_parameter_plots1.png differ diff --git a/dev/tutorials/plots/mcmc_time_varying_parameter_plots.png b/dev/tutorials/plots/mcmc_time_varying_parameter_plots.png index c01d0c0..700ad6b 100644 Binary files a/dev/tutorials/plots/mcmc_time_varying_parameter_plots.png and b/dev/tutorials/plots/mcmc_time_varying_parameter_plots.png differ diff --git a/dev/tutorials/plots/mcmc_time_varying_parameter_plots1.png b/dev/tutorials/plots/mcmc_time_varying_parameter_plots1.png index d7d32de..aeb7c63 100644 Binary files a/dev/tutorials/plots/mcmc_time_varying_parameter_plots1.png and b/dev/tutorials/plots/mcmc_time_varying_parameter_plots1.png differ diff --git a/dev/tutorials/uciwweihr_simulation_data/06933b3d.svg b/dev/tutorials/uciwweihr_simulation_data/06933b3d.svg deleted file mode 100644 index 000275c..0000000 --- a/dev/tutorials/uciwweihr_simulation_data/06933b3d.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tutorials/uciwweihr_simulation_data/26e1137d.svg b/dev/tutorials/uciwweihr_simulation_data/27ad989f.svg similarity index 87% rename from dev/tutorials/uciwweihr_simulation_data/26e1137d.svg rename to dev/tutorials/uciwweihr_simulation_data/27ad989f.svg index b98355f..700cef9 100644 --- a/dev/tutorials/uciwweihr_simulation_data/26e1137d.svg +++ b/dev/tutorials/uciwweihr_simulation_data/27ad989f.svg @@ -1,39 +1,39 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/2eee73a6.svg b/dev/tutorials/uciwweihr_simulation_data/2eee73a6.svg deleted file mode 100644 index a4d7c8d..0000000 --- a/dev/tutorials/uciwweihr_simulation_data/2eee73a6.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tutorials/uciwweihr_simulation_data/55d670d9.svg b/dev/tutorials/uciwweihr_simulation_data/55d670d9.svg new file mode 100644 index 0000000..7213305 --- /dev/null +++ b/dev/tutorials/uciwweihr_simulation_data/55d670d9.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/686101c5.svg b/dev/tutorials/uciwweihr_simulation_data/686101c5.svg deleted file mode 100644 index e184137..0000000 --- a/dev/tutorials/uciwweihr_simulation_data/686101c5.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tutorials/uciwweihr_simulation_data/e75a1bad.svg b/dev/tutorials/uciwweihr_simulation_data/68c3ad6a.svg similarity index 86% rename from dev/tutorials/uciwweihr_simulation_data/e75a1bad.svg rename to dev/tutorials/uciwweihr_simulation_data/68c3ad6a.svg index 90e1011..20f0c45 100644 --- a/dev/tutorials/uciwweihr_simulation_data/e75a1bad.svg +++ b/dev/tutorials/uciwweihr_simulation_data/68c3ad6a.svg @@ -1,39 +1,39 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/9e5c4aba.svg b/dev/tutorials/uciwweihr_simulation_data/9b061312.svg similarity index 86% rename from dev/tutorials/uciwweihr_simulation_data/9e5c4aba.svg rename to dev/tutorials/uciwweihr_simulation_data/9b061312.svg index 9fe05b7..01f705a 100644 --- a/dev/tutorials/uciwweihr_simulation_data/9e5c4aba.svg +++ b/dev/tutorials/uciwweihr_simulation_data/9b061312.svg @@ -1,43 +1,43 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/9d2339f9.svg b/dev/tutorials/uciwweihr_simulation_data/9d2339f9.svg new file mode 100644 index 0000000..94b2e20 --- /dev/null +++ b/dev/tutorials/uciwweihr_simulation_data/9d2339f9.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/7459428b.svg b/dev/tutorials/uciwweihr_simulation_data/a40f909f.svg similarity index 85% rename from dev/tutorials/uciwweihr_simulation_data/7459428b.svg rename to dev/tutorials/uciwweihr_simulation_data/a40f909f.svg index ebe2504..c39f7e7 100644 --- a/dev/tutorials/uciwweihr_simulation_data/7459428b.svg +++ b/dev/tutorials/uciwweihr_simulation_data/a40f909f.svg @@ -1,39 +1,39 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/573e905b.svg b/dev/tutorials/uciwweihr_simulation_data/b17ffceb.svg similarity index 85% rename from dev/tutorials/uciwweihr_simulation_data/573e905b.svg rename to dev/tutorials/uciwweihr_simulation_data/b17ffceb.svg index fc74998..50aa1d8 100644 --- a/dev/tutorials/uciwweihr_simulation_data/573e905b.svg +++ b/dev/tutorials/uciwweihr_simulation_data/b17ffceb.svg @@ -1,41 +1,41 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/ca43072a.svg b/dev/tutorials/uciwweihr_simulation_data/ca43072a.svg new file mode 100644 index 0000000..6c52677 --- /dev/null +++ b/dev/tutorials/uciwweihr_simulation_data/ca43072a.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/index.html b/dev/tutorials/uciwweihr_simulation_data/index.html index 4838c8c..676f450 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.493572200.997770.341455
220.569888271.014680.34689
330.803061270.9891190.343463
440.635337251.069040.351097
550.67934381.109150.366607

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×5 DataFrame
Rowobstimeslog_ww_conchosprtwt
Int64Float64Int64Float64Float64
110.271654260.997770.349492
220.517304161.014680.353323
330.498552250.9891190.347515
440.762967311.069040.365335
550.810309371.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,
     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(
@@ -49,16 +49,16 @@
     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 87948b6..9278421 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.493572200.997770.341455
220.569888271.014680.34689
330.803061270.9891190.343463
440.635337251.069040.351097
550.67934381.109150.366607
first(df_ext, 5)
5×5 DataFrame
Rowobstimeslog_ww_conchosprtwt
Int64Float64Int64Float64Float64
110.323573190.997770.358155
220.451504261.014680.349014
330.586063210.9891190.351422
440.534381221.069040.358463
550.715517281.109150.352277

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.

data_hosp = df.hosp
+first(df, 5)
5×5 DataFrame
Rowobstimeslog_ww_conchosprtwt
Int64Float64Int64Float64Float64
110.271654260.997770.349492
220.517304161.014680.353323
330.498552250.9891190.347515
440.762967311.069040.365335
550.810309371.109150.373918
first(df_ext, 5)
5×5 DataFrame
Rowobstimeslog_ww_conchosprtwt
Int64Float64Int64Float64Float64
110.271654280.997770.349492
220.517304301.014680.353323
330.498552330.9891190.347515
440.762967241.069040.365335
550.810309231.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.

data_hosp = df.hosp
 data_wastewater = df.log_ww_conc
 obstimes = df.obstimes
 param_change_times = 1:7:length(obstimes) # Change every week
@@ -40,34 +40,49 @@
     forecast_weeks = forecast_weeks
 )
 
-first(model_output[1][:,1:5], 5)
5×5 DataFrame
RowiterationchainRt_params_non_centered[25]Rt_params_non_centered[26]Rt_params_non_centered[27]
Int64Int64Float64Float64Float64
1111.040431.20234-0.686312
2211.040431.20234-0.686312
3311.040431.20234-0.686312
4411.040431.20234-0.686312
5511.040431.20234-0.686312
first(model_output[2][:,1:5], 5)
5×5 DataFrame
RowiterationchainE_initI_initH_init
Int64Int64Float64Float64Float64
111199.045129.98317.1867
221177.116134.92914.8574
331188.745116.32919.6962
441139.991136.5816.7684
551140.006135.94417.0781
first(model_output[3][:,1:5], 5)
5×5 DataFrame
RowiterationchainE_init_non_centeredI_init_non_centeredH_init_non_centered
Int64Int64Float64Float64Float64
11011-0.01910181.49913-0.562664
21021-0.4576741.74647-1.02852
31031-0.2250940.816461-0.0607603
41041-1.200171.82902-0.646324
51051-1.199881.79721-0.584375

3. MCMC Diagnostic Plots/Results Along with Posterior Predictive Distribution.

We can again look at model diagnostics, posterior distribution of time or non-time varying parameters, and the posterior predictive distribution extended for forecasting.

uciwweihr_visualizer(
+first(model_output[1][:,1:5], 5)
5×5 DataFrame
RowiterationchainRt_params_non_centered[25]Rt_params_non_centered[26]Rt_params_non_centered[27]
Int64Int64Float64Float64Float64
1111.040431.20234-0.686312
2211.040431.20234-0.686312
3311.040431.20234-0.686312
4411.040431.20234-0.686312
5511.040431.20234-0.686312
first(model_output[2][:,1:5], 5)
5×5 DataFrame
RowiterationchainE_initI_initH_init
Int64Int64Float64Float64Float64
111206.978101.09622.2114
221267.54675.567718.2969
331216.55986.644523.1962
441199.416106.21818.2169
551234.87696.259223.5057
first(model_output[3][:,1:5], 5)
5×5 DataFrame
RowiterationchainE_init_non_centeredI_init_non_centeredH_init_non_centered
Int64Int64Float64Float64Float64
110110.1395610.05479470.442275
210211.35092-1.22162-0.340626
310310.331174-0.6677770.639234
41041-0.01168340.310917-0.356626
510510.697518-0.1870420.701147

3. MCMC Diagnostic Plots/Results Along with Posterior Predictive Distribution.

We can again look at model diagnostics, posterior distribution of time or non-time varying parameters, and the posterior predictive distribution extended for forecasting. We can also add certain parameters to ensure priors will be plotted alongside their corresponding posteriors.

uciwweihr_visualizer(
+    data_hosp,
+    data_wastewater,
+    forecast_weeks,
+    obstimes,
+    param_change_times,
+    2024,
+    forecast,
+    model_params;
     pp_samples = model_output[1],
     gq_samples = model_output[2],
-    data_hosp = df_ext.hosp,
-    data_wastewater = df_ext.log_ww_conc,
+    obs_data_hosp = df_ext.hosp,
+    obs_data_wastewater = df_ext.log_ww_conc,
     actual_rt_vals = df_ext.rt,
     actual_w_t = df_ext.wt,
     actual_non_time_varying_vals = params,
-    forecast_weeks = forecast_weeks,
     bayes_dist_type = "Posterior",
     save_plots = true,
     plot_name_to_save_mcmcdiag = "mcmc_diagnosis_plots1",
     plot_name_to_save_time_varying = "mcmc_time_varying_parameter_plots1",
     plot_name_to_save_non_time_varying = "mcmc_nontime_varying_parameter_plots1",
     plot_name_to_save_pred_param = "mcmc_pred_parameter_plots1"
-)
Effective Sample Size for E_init for Chain 1: 150.0
-Effective Sample Size for I_init for Chain 1: 206.0
-Effective Sample Size for H_init for Chain 1: 223.0
-Effective Sample Size for gamma for Chain 1: 171.0
-Effective Sample Size for nu for Chain 1: 169.0
-Effective Sample Size for epsilon for Chain 1: 180.0
-Effective Sample Size for rt_init for Chain 1: 220.0
-Effective Sample Size for w_init for Chain 1: 170.0
-Effective Sample Size for rho_gene for Chain 1: 155.0
-Effective Sample Size for tau for Chain 1: 178.0
-Effective Sample Size for df for Chain 1: 220.0
-Effective Sample Size for sigma_hosp for Chain 1: 159.0
+)
Effective Sample Size for E_init for Chain 1: 235.0
+Effective Sample Size for I_init for Chain 1: 265.0
+Effective Sample Size for H_init for Chain 1: 303.0
+Effective Sample Size for gamma for Chain 1: 166.0
+Effective Sample Size for nu for Chain 1: 174.0
+Effective Sample Size for epsilon for Chain 1: 218.0
+Effective Sample Size for rt_init for Chain 1: 223.0
+Effective Sample Size for w_init for Chain 1: 194.0
+Effective Sample Size for rho_gene for Chain 1: 199.0
+Effective Sample Size for tau for Chain 1: 220.0
+Effective Sample Size for df for Chain 1: 260.0
+Effective Sample Size for sigma_hosp for Chain 1: 190.0
 Plot saved to plots/mcmc_diagnosis_plots1.png
+Generating time varying parameter plots (with priors)...
+Using uciwweihr_model with wastewater!!!
+┌ Warning: Only a single thread available: MCMC chains are not sampled in parallel
+└ @ AbstractMCMC ~/.julia/packages/AbstractMCMC/YrmkI/src/sample.jl:310
+Sampling (1 threads)   0%|                              |  ETA: N/A
+Sampling (1 threads) 100%|██████████████████████████████| Time: 0:00:03
+Sampling (1 threads) 100%|██████████████████████████████| Time: 0:00:03
+Using uciwweihr_model with wastewater!!!
 Plot saved to plots/mcmc_time_varying_parameter_plots1.png
 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 d0267ea..25dd556 100644 --- a/dev/tutorials/uciwwiehr_model_fitting_no_forecast/index.html +++ b/dev/tutorials/uciwwiehr_model_fitting_no_forecast/index.html @@ -29,6 +29,8 @@ param_change_times = 1:7:length(obstimes) # Change every week priors_only = false n_samples = 200 +forecast = false +forecast_weeks = 0 model_params = create_uciwweihr_model_params() samples = uciwweihr_fit( @@ -49,11 +51,19 @@ params = model_params ) -first(model_output[1][:,1:5], 5)
5×5 DataFrame
Rowiterationchaindata_wastewater[1]data_hosp[1]data_wastewater[2]
Int64Int64Float64Float64Float64
1110.078108725.00.369319
2210.36777117.00.456394
3310.0967619.00.422507
4410.43558315.00.25292
5510.17463325.00.45186
first(model_output[2][:,1:5], 5)
5×5 DataFrame
RowiterationchainE_initI_initH_init
Int64Int64Float64Float64Float64
111223.70578.386219.1469
221227.97678.269716.3695
331225.03368.856118.7899
441204.83891.188221.1889
551210.72890.693918.7486
first(model_output[3][:,1:5], 5)
5×5 DataFrame
RowiterationchainE_init_non_centeredI_init_non_centeredH_init_non_centered
Int64Int64Float64Float64Float64
110110.474098-1.08069-0.170628
210210.559525-1.08651-0.726107
310310.500668-1.55719-0.242021
410410.0967546-0.4405880.237784
510510.21455-0.465304-0.250277

3. MCMC Diagnostic Plots/Results Along with Posterior Predictive Distribution.

We also provide a very basic way to visualize some MCMC diagnostics along with effective sample sizes of desired generated quantities(does not include functionality for time-varying quantities). Along with this, we can also visualize the posterior predictive distribution with actual observed values, which can be used to examine forecasts generated by the model.

uciwweihr_visualizer(
+first(model_output[1][:,1:5], 5)
5×5 DataFrame
Rowiterationchaindata_wastewater[1]data_hosp[1]data_wastewater[2]
Int64Int64Float64Float64Float64
1110.078108725.00.369319
2210.36777117.00.456394
3310.0967619.00.422507
4410.43558315.00.25292
5510.17463325.00.45186
first(model_output[2][:,1:5], 5)
5×5 DataFrame
RowiterationchainE_initI_initH_init
Int64Int64Float64Float64Float64
111223.70578.386219.1469
221227.97678.269716.3695
331225.03368.856118.7899
441204.83891.188221.1889
551210.72890.693918.7486
first(model_output[3][:,1:5], 5)
5×5 DataFrame
RowiterationchainE_init_non_centeredI_init_non_centeredH_init_non_centered
Int64Int64Float64Float64Float64
110110.474098-1.08069-0.170628
210210.559525-1.08651-0.726107
310310.500668-1.55719-0.242021
410410.0967546-0.4405880.237784
510510.21455-0.465304-0.250277

3. MCMC Diagnostic Plots/Results Along with Posterior Predictive Distribution.

We also provide a very basic way to visualize some MCMC diagnostics along with effective sample sizes of desired generated quantities(does not include functionality for time-varying quantities). Along with this, we can also visualize the posterior predictive distribution with actual observed values, which can be used to examine forecasts generated by the model. We can also add certain parameters to ensure priors will be plotted alongside their corresponding posteriors.

uciwweihr_visualizer(
+    data_hosp,
+    data_wastewater,
+    forecast_weeks,
+    obstimes,
+    param_change_times,
+    2024,
+    forecast,
+    model_params;
     pp_samples = model_output[1],
     gq_samples = model_output[2],
-    data_hosp = data_hosp,
-    data_wastewater = data_wastewater,
+    obs_data_hosp = data_hosp,
+    obs_data_wastewater = data_wastewater,
     actual_rt_vals = df.rt,
     actual_w_t = df.wt,
     actual_non_time_varying_vals = params,
@@ -72,6 +82,14 @@
 Effective Sample Size for df for Chain 1: 147.0
 Effective Sample Size for sigma_hosp for Chain 1: 32.0
 Plot saved to plots/mcmc_diagnosis_plots.png
+Generating time varying parameter plots (with priors)...
+Using uciwweihr_model with wastewater!!!
+┌ Warning: Only a single thread available: MCMC chains are not sampled in parallel
+└ @ AbstractMCMC ~/.julia/packages/AbstractMCMC/YrmkI/src/sample.jl:310
+Sampling (1 threads)   0%|                              |  ETA: N/A
+Sampling (1 threads) 100%|██████████████████████████████| Time: 0:00:00
+Sampling (1 threads) 100%|██████████████████████████████| Time: 0:00:00
+Using uciwweihr_model with wastewater!!!
 Plot saved to plots/mcmc_time_varying_parameter_plots.png
 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