diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 25d0c47..8f00adf 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2024-08-24T16:28:11","documenter_version":"1.5.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2024-08-24T17:15:46","documenter_version":"1.5.0"}} \ No newline at end of file diff --git a/dev/index.html b/dev/index.html index 5096fb3..181efbc 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
  • Parameter estimation and 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("UCIWWEIHR")
+Pkg.add("UCIWWEIHR") diff --git a/dev/license/index.html b/dev/license/index.html index aa20291..9c2e56d 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/news/index.html b/dev/news/index.html index b47ed23..929fbad 100644 --- a/dev/news/index.html +++ b/dev/news/index.html @@ -1,2 +1,2 @@ -NEWS · UCIWWEIHR.jl
+NEWS · UCIWWEIHR.jl
diff --git a/dev/package_development/index.html b/dev/package_development/index.html index 1dd5d23..137cf72 100644 --- a/dev/package_development/index.html +++ b/dev/package_development/index.html @@ -1,2 +1,2 @@ -PACKAGE DEVELOPMENT · UCIWWEIHR.jl

Package Development Updates

[Version X.X.X] - YYYY-MM-DD

Added

  • Feature 1: Description of the feature that was added.
  • Feature 2: Description of the feature that was added.

Changed

  • Change 1: Description of the change that was made.
  • Change 2: Description of the change that was made.

Deprecated

  • Deprecated feature 1: Description of the feature that was deprecated.
  • Deprecated feature 2: Description of the feature that was deprecated.

Removed

  • Removed feature 1: Description of the feature that was removed.
  • Removed feature 2: Description of the feature that was removed.

Fixed

  • Bug fix 1: Description of the bug that was fixed.
  • Bug fix 2: Description of the bug that was fixed.
+PACKAGE DEVELOPMENT · UCIWWEIHR.jl

Package Development Updates

[Version X.X.X] - YYYY-MM-DD

Added

  • Feature 1: Description of the feature that was added.
  • Feature 2: Description of the feature that was added.

Changed

  • Change 1: Description of the change that was made.
  • Change 2: Description of the change that was made.

Deprecated

  • Deprecated feature 1: Description of the feature that was deprecated.
  • Deprecated feature 2: Description of the feature that was deprecated.

Removed

  • Removed feature 1: Description of the feature that was removed.
  • Removed feature 2: Description of the feature that was removed.

Fixed

  • Bug fix 1: Description of the bug that was fixed.
  • Bug fix 2: Description of the bug that was fixed.
diff --git a/dev/reference/index.html b/dev/reference/index.html index b316489..6a6030f 100644 --- a/dev/reference/index.html +++ b/dev/reference/index.html @@ -1,4 +1,4 @@ -REFERENCE · UCIWWEIHR.jl

Reference

Contents

Index

UCIWWEIHR.uciwweihr_sim_paramsType
uciwweihr_sim_params

Struct for holding parameters used in the UCIWWEIHR ODE compartmental model simulation. Use create_uciwweihr_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_paramsMethod
create_uciwweihr_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.
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.
source
UCIWWEIHR.powerMethod
power(a,b)
+REFERENCE · UCIWWEIHR.jl

Reference

Contents

Index

UCIWWEIHR.uciwweihr_sim_paramsType
uciwweihr_sim_params

Struct for holding parameters used in the UCIWWEIHR ODE compartmental model simulation. Use create_uciwweihr_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_paramsMethod
create_uciwweihr_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.
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.
source
UCIWWEIHR.uciwweihr_fitFunction
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.
  • 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.
  • 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.
  • param_change_times::Array{Float64}: An array of timepoints where the parameters change.

Returns

  • Samples from the posterior or prior distribution.
source
UCIWWEIHR.uciwweihr_modelFunction
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.
  • obstimes: An array of timepoints for observed hosp/wastewater.
  • param_change_times: An array of timepoints where the parameters change.
  • 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_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.
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

  • 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_fitFunction
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.
  • 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.
  • 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.
  • param_change_times::Array{Float64}: An array of timepoints where the parameters change.

Returns

  • Samples from the posterior or prior distribution.
source
UCIWWEIHR.uciwweihr_modelFunction
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.
  • obstimes: An array of timepoints for observed hosp/wastewater.
  • param_change_times: An array of timepoints where the parameters change.
  • 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_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
diff --git a/dev/search_index.js b/dev/search_index.js index 97c14ca..0006227 100644 --- a/dev/search_index.js +++ b/dev/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"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_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, then 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\nsamples = uciwweihr_fit(\n data_hosp,\n data_wastewater,\n obstimes,\n param_change_times,\n priors_only,\n n_samples\n)\nmodel_output = uciwweihr_gq_pp(\n samples = samples,\n data_hosp = data_hosp,\n data_wastewater = data_wastewater,\n obstimes = obstimes,\n param_change_times = param_change_times,\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":"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":"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_params(\n time_points = 150\n)\ndf = generate_simulation_data_uciwweihr(params)\n\nparams_ext = create_uciwweihr_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, then 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 diference 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\nsamples = uciwweihr_fit(\n data_hosp,\n data_wastewater,\n obstimes,\n param_change_times,\n priors_only,\n n_samples\n)\nmodel_output = uciwweihr_gq_pp(\n samples = samples,\n data_hosp = data_hosp,\n data_wastewater = data_wastewater,\n obstimes = obstimes,\n param_change_times = param_change_times,\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)","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":"news/#package-development-news","page":"NEWS","title":"Package Development News","text":"","category":"section"},{"location":"news/#Latest-Updates","page":"NEWS","title":"Latest Updates","text":"","category":"section"},{"location":"news/#Upcoming-Features","page":"NEWS","title":"Upcoming Features","text":"","category":"section"},{"location":"news/#Bug-Fixes-in-Progress","page":"NEWS","title":"Bug Fixes in Progress","text":"","category":"section"},{"location":"news/#Release-Notes","page":"NEWS","title":"Release Notes","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_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_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_params-Tuple{}","page":"REFERENCE","title":"UCIWWEIHR.create_uciwweihr_params","text":"create_uciwweihr_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.\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.\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.\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.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.uciwweihr_fit","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.\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.\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.\nparam_change_times::Array{Float64}: An array of timepoints where the parameters change.\n\nReturns\n\nSamples from the posterior or prior distribution.\n\n\n\n\n\n","category":"function"},{"location":"reference/#UCIWWEIHR.uciwweihr_model","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.\nobstimes: An array of timepoints for observed hosp/wastewater.\nparam_change_times: An array of timepoints where the parameters change.\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":"function"},{"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.\n\n\n\n\n\n","category":"method"},{"location":"package_development/#package-development-updates","page":"PACKAGE DEVELOPMENT","title":"Package Development Updates","text":"","category":"section"},{"location":"package_development/#[Version-X.X.X]-YYYY-MM-DD","page":"PACKAGE DEVELOPMENT","title":"[Version X.X.X] - YYYY-MM-DD","text":"","category":"section"},{"location":"package_development/#Added","page":"PACKAGE DEVELOPMENT","title":"Added","text":"","category":"section"},{"location":"package_development/","page":"PACKAGE DEVELOPMENT","title":"PACKAGE DEVELOPMENT","text":"Feature 1: Description of the feature that was added.\nFeature 2: Description of the feature that was added.","category":"page"},{"location":"package_development/#Changed","page":"PACKAGE DEVELOPMENT","title":"Changed","text":"","category":"section"},{"location":"package_development/","page":"PACKAGE DEVELOPMENT","title":"PACKAGE DEVELOPMENT","text":"Change 1: Description of the change that was made.\nChange 2: Description of the change that was made.","category":"page"},{"location":"package_development/#Deprecated","page":"PACKAGE DEVELOPMENT","title":"Deprecated","text":"","category":"section"},{"location":"package_development/","page":"PACKAGE DEVELOPMENT","title":"PACKAGE DEVELOPMENT","text":"Deprecated feature 1: Description of the feature that was deprecated.\nDeprecated feature 2: Description of the feature that was deprecated.","category":"page"},{"location":"package_development/#Removed","page":"PACKAGE DEVELOPMENT","title":"Removed","text":"","category":"section"},{"location":"package_development/","page":"PACKAGE DEVELOPMENT","title":"PACKAGE DEVELOPMENT","text":"Removed feature 1: Description of the feature that was removed.\nRemoved feature 2: Description of the feature that was removed.","category":"page"},{"location":"package_development/#Fixed","page":"PACKAGE DEVELOPMENT","title":"Fixed","text":"","category":"section"},{"location":"package_development/","page":"PACKAGE DEVELOPMENT","title":"PACKAGE DEVELOPMENT","text":"Bug fix 1: Description of the bug that was fixed.\nBug fix 2: Description of the bug that was fixed.","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/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/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(\"UCIWWEIHR\")","category":"page"},{"location":"tutorials/getting_started/#[Tutorial-Contents](@ref-tutorial_home)","page":"GETTING STARTED","title":"Tutorial Contents","text":"","category":"section"},{"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_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_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 \nParameter estimation and model 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(\"UCIWWEIHR\")","category":"page"}] +[{"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_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, then 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 = 50\n\nsamples = uciwweihr_fit(\n data_hosp,\n data_wastewater,\n obstimes,\n param_change_times,\n priors_only,\n n_samples\n)\nmodel_output = uciwweihr_gq_pp(\n samples = samples,\n data_hosp = data_hosp,\n data_wastewater = data_wastewater,\n obstimes = obstimes,\n param_change_times = param_change_times,\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":"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":"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_params(\n time_points = 150\n)\ndf = generate_simulation_data_uciwweihr(params)\n\nparams_ext = create_uciwweihr_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, then 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 diference 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 = 50\nforecast = true\nforecast_weeks = 4\n\nsamples = uciwweihr_fit(\n data_hosp,\n data_wastewater,\n obstimes,\n param_change_times,\n priors_only,\n n_samples\n)\nmodel_output = uciwweihr_gq_pp(\n samples = samples,\n data_hosp = data_hosp,\n data_wastewater = data_wastewater,\n obstimes = obstimes,\n param_change_times = param_change_times,\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":"news/#package-development-news","page":"NEWS","title":"Package Development News","text":"","category":"section"},{"location":"news/#Latest-Updates","page":"NEWS","title":"Latest Updates","text":"","category":"section"},{"location":"news/#Upcoming-Features","page":"NEWS","title":"Upcoming Features","text":"","category":"section"},{"location":"news/#Bug-Fixes-in-Progress","page":"NEWS","title":"Bug Fixes in Progress","text":"","category":"section"},{"location":"news/#Release-Notes","page":"NEWS","title":"Release Notes","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_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_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_params-Tuple{}","page":"REFERENCE","title":"UCIWWEIHR.create_uciwweihr_params","text":"create_uciwweihr_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","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.\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.\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.\nparam_change_times::Array{Float64}: An array of timepoints where the parameters change.\n\nReturns\n\nSamples from the posterior or prior distribution.\n\n\n\n\n\n","category":"function"},{"location":"reference/#UCIWWEIHR.uciwweihr_model","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.\nobstimes: An array of timepoints for observed hosp/wastewater.\nparam_change_times: An array of timepoints where the parameters change.\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":"function"},{"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":"package_development/#package-development-updates","page":"PACKAGE DEVELOPMENT","title":"Package Development Updates","text":"","category":"section"},{"location":"package_development/#[Version-X.X.X]-YYYY-MM-DD","page":"PACKAGE DEVELOPMENT","title":"[Version X.X.X] - YYYY-MM-DD","text":"","category":"section"},{"location":"package_development/#Added","page":"PACKAGE DEVELOPMENT","title":"Added","text":"","category":"section"},{"location":"package_development/","page":"PACKAGE DEVELOPMENT","title":"PACKAGE DEVELOPMENT","text":"Feature 1: Description of the feature that was added.\nFeature 2: Description of the feature that was added.","category":"page"},{"location":"package_development/#Changed","page":"PACKAGE DEVELOPMENT","title":"Changed","text":"","category":"section"},{"location":"package_development/","page":"PACKAGE DEVELOPMENT","title":"PACKAGE DEVELOPMENT","text":"Change 1: Description of the change that was made.\nChange 2: Description of the change that was made.","category":"page"},{"location":"package_development/#Deprecated","page":"PACKAGE DEVELOPMENT","title":"Deprecated","text":"","category":"section"},{"location":"package_development/","page":"PACKAGE DEVELOPMENT","title":"PACKAGE DEVELOPMENT","text":"Deprecated feature 1: Description of the feature that was deprecated.\nDeprecated feature 2: Description of the feature that was deprecated.","category":"page"},{"location":"package_development/#Removed","page":"PACKAGE DEVELOPMENT","title":"Removed","text":"","category":"section"},{"location":"package_development/","page":"PACKAGE DEVELOPMENT","title":"PACKAGE DEVELOPMENT","text":"Removed feature 1: Description of the feature that was removed.\nRemoved feature 2: Description of the feature that was removed.","category":"page"},{"location":"package_development/#Fixed","page":"PACKAGE DEVELOPMENT","title":"Fixed","text":"","category":"section"},{"location":"package_development/","page":"PACKAGE DEVELOPMENT","title":"PACKAGE DEVELOPMENT","text":"Bug fix 1: Description of the bug that was fixed.\nBug fix 2: Description of the bug that was fixed.","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/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/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(\"UCIWWEIHR\")","category":"page"},{"location":"tutorials/getting_started/#[Tutorial-Contents](@ref-tutorial_home)","page":"GETTING STARTED","title":"Tutorial Contents","text":"","category":"section"},{"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_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_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 \nParameter estimation and model 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(\"UCIWWEIHR\")","category":"page"}] } diff --git a/dev/tutorial_index/index.html b/dev/tutorial_index/index.html index 385ee2f..d912a69 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/00082f99.svg b/dev/tutorials/agent_based_simulation_data/6a7d4b75.svg similarity index 87% rename from dev/tutorials/agent_based_simulation_data/00082f99.svg rename to dev/tutorials/agent_based_simulation_data/6a7d4b75.svg index b2eec2e..334464d 100644 --- a/dev/tutorials/agent_based_simulation_data/00082f99.svg +++ b/dev/tutorials/agent_based_simulation_data/6a7d4b75.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 792bf47..0373bfe 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 176972e..3cc3b8e 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("UCIWWEIHR")

Tutorial Contents

+Pkg.add("UCIWWEIHR")

Tutorial Contents

diff --git a/dev/tutorials/plots/mcmc_diagnosis_plots.png b/dev/tutorials/plots/mcmc_diagnosis_plots.png index af49a60..d242af5 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 new file mode 100644 index 0000000..9d640c7 Binary files /dev/null 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 8b9f2d5..d79bf01 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 new file mode 100644 index 0000000..838afb3 Binary files /dev/null and b/dev/tutorials/plots/mcmc_nontime_varying_parameter_plots1.png differ diff --git a/dev/tutorials/plots/mcmc_pred_parameter_plots.png b/dev/tutorials/plots/mcmc_pred_parameter_plots.png index 66289a6..2e82b18 100644 Binary files a/dev/tutorials/plots/mcmc_pred_parameter_plots.png and b/dev/tutorials/plots/mcmc_pred_parameter_plots.png differ diff --git a/dev/tutorials/plots/mcmc_pred_parameter_plots1.png b/dev/tutorials/plots/mcmc_pred_parameter_plots1.png new file mode 100644 index 0000000..1f97ebd Binary files /dev/null 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 d2459ff..232ac55 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 new file mode 100644 index 0000000..5687000 Binary files /dev/null and b/dev/tutorials/plots/mcmc_time_varying_parameter_plots1.png differ diff --git a/dev/tutorials/uciwweihr_simulation_data/d2774cc1.svg b/dev/tutorials/uciwweihr_simulation_data/22a9589e.svg similarity index 87% rename from dev/tutorials/uciwweihr_simulation_data/d2774cc1.svg rename to dev/tutorials/uciwweihr_simulation_data/22a9589e.svg index 55e3f2d..25823cb 100644 --- a/dev/tutorials/uciwweihr_simulation_data/d2774cc1.svg +++ b/dev/tutorials/uciwweihr_simulation_data/22a9589e.svg @@ -1,43 +1,43 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/39cc8790.svg b/dev/tutorials/uciwweihr_simulation_data/3f65ce9a.svg similarity index 87% rename from dev/tutorials/uciwweihr_simulation_data/39cc8790.svg rename to dev/tutorials/uciwweihr_simulation_data/3f65ce9a.svg index 55cac69..909691c 100644 --- a/dev/tutorials/uciwweihr_simulation_data/39cc8790.svg +++ b/dev/tutorials/uciwweihr_simulation_data/3f65ce9a.svg @@ -1,39 +1,39 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/ea063096.svg b/dev/tutorials/uciwweihr_simulation_data/59e390f8.svg similarity index 87% rename from dev/tutorials/uciwweihr_simulation_data/ea063096.svg rename to dev/tutorials/uciwweihr_simulation_data/59e390f8.svg index 6137f1d..df20b33 100644 --- a/dev/tutorials/uciwweihr_simulation_data/ea063096.svg +++ b/dev/tutorials/uciwweihr_simulation_data/59e390f8.svg @@ -1,39 +1,39 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/d24dc5a8.svg b/dev/tutorials/uciwweihr_simulation_data/a1d8f15a.svg similarity index 87% rename from dev/tutorials/uciwweihr_simulation_data/d24dc5a8.svg rename to dev/tutorials/uciwweihr_simulation_data/a1d8f15a.svg index 7073e48..1a27fc5 100644 --- a/dev/tutorials/uciwweihr_simulation_data/d24dc5a8.svg +++ b/dev/tutorials/uciwweihr_simulation_data/a1d8f15a.svg @@ -1,41 +1,41 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/a468b9e1.svg b/dev/tutorials/uciwweihr_simulation_data/c527b0fd.svg similarity index 86% rename from dev/tutorials/uciwweihr_simulation_data/a468b9e1.svg rename to dev/tutorials/uciwweihr_simulation_data/c527b0fd.svg index a4602bd..4c0d70e 100644 --- a/dev/tutorials/uciwweihr_simulation_data/a468b9e1.svg +++ b/dev/tutorials/uciwweihr_simulation_data/c527b0fd.svg @@ -1,39 +1,39 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/becf9e04.svg b/dev/tutorials/uciwweihr_simulation_data/c8b1893c.svg similarity index 85% rename from dev/tutorials/uciwweihr_simulation_data/becf9e04.svg rename to dev/tutorials/uciwweihr_simulation_data/c8b1893c.svg index f7517af..ce6d542 100644 --- a/dev/tutorials/uciwweihr_simulation_data/becf9e04.svg +++ b/dev/tutorials/uciwweihr_simulation_data/c8b1893c.svg @@ -1,41 +1,41 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/1388ed0a.svg b/dev/tutorials/uciwweihr_simulation_data/d0b4da4a.svg similarity index 86% rename from dev/tutorials/uciwweihr_simulation_data/1388ed0a.svg rename to dev/tutorials/uciwweihr_simulation_data/d0b4da4a.svg index 702a37f..4a0dc13 100644 --- a/dev/tutorials/uciwweihr_simulation_data/1388ed0a.svg +++ b/dev/tutorials/uciwweihr_simulation_data/d0b4da4a.svg @@ -1,41 +1,41 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/d131a777.svg b/dev/tutorials/uciwweihr_simulation_data/f7fc3bb5.svg similarity index 87% rename from dev/tutorials/uciwweihr_simulation_data/d131a777.svg rename to dev/tutorials/uciwweihr_simulation_data/f7fc3bb5.svg index dd9823a..df35929 100644 --- a/dev/tutorials/uciwweihr_simulation_data/d131a777.svg +++ b/dev/tutorials/uciwweihr_simulation_data/f7fc3bb5.svg @@ -1,41 +1,41 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/index.html b/dev/tutorials/uciwweihr_simulation_data/index.html index 25b10a8..5a961a1 100644 --- a/dev/tutorials/uciwweihr_simulation_data/index.html +++ b/dev/tutorials/uciwweihr_simulation_data/index.html @@ -8,19 +8,19 @@ 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 7cddf1e..a3f494c 100644 --- a/dev/tutorials/uciwwiehr_model_fitting_forecast/index.html +++ b/dev/tutorials/uciwwiehr_model_fitting_forecast/index.html @@ -15,7 +15,7 @@ obstimes = df.obstimes param_change_times = 1:7:length(obstimes) # Change every week priors_only = false -n_samples = 200 +n_samples = 50 forecast = true forecast_weeks = 4 @@ -37,7 +37,7 @@ 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
111211.728101.817.1358
221197.672118.04422.1384
331210.863119.89119.2197
441188.797130.83120.3463
551192.596109.30215.2542
first(model_output[3][:,1:5], 5)
5×5 DataFrame
RowiterationchainE_init_non_centeredI_init_non_centeredH_init_non_centered
Int64Int64Float64Float64Float64
110110.2345570.0899789-0.572843
21021-0.04655330.9021960.427675
310310.2172540.994555-0.156058
41041-0.2240691.541530.0692522
51051-0.1480850.465122-0.949166

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
111190.393112.14421.7208
221167.542133.98622.2228
331241.771104.08217.1341
441190.658138.44222.9441
551214.304112.79815.4107
first(model_output[3][:,1:5], 5)
5×5 DataFrame
RowiterationchainE_init_non_centeredI_init_non_centeredH_init_non_centered
Int64Int64Float64Float64Float64
1261-0.192140.6071940.344159
2271-0.6491511.69930.444562
32810.8354220.20409-0.573185
4291-0.1868421.922120.588823
53010.2860730.639916-0.91785

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(
     pp_samples = model_output[1],
     gq_samples = model_output[2],
     data_hosp = df_ext.hosp,
@@ -47,20 +47,24 @@
     actual_non_time_varying_vals = params,
     forecast_weeks = forecast_weeks,
     bayes_dist_type = "Posterior",
-    save_plots = true
-)
Effective Sample Size for E_init for Chain 1: 460.0
-Effective Sample Size for I_init for Chain 1: 460.0
-Effective Sample Size for H_init for Chain 1: 254.0
-Effective Sample Size for gamma for Chain 1: 183.0
-Effective Sample Size for nu for Chain 1: 154.0
-Effective Sample Size for epsilon for Chain 1: 223.0
-Effective Sample Size for rt_init for Chain 1: 181.0
-Effective Sample Size for w_init for Chain 1: 195.0
-Effective Sample Size for rho_gene for Chain 1: 113.0
-Effective Sample Size for tau for Chain 1: 184.0
-Effective Sample Size for df for Chain 1: 460.0
-Effective Sample Size for sigma_hosp for Chain 1: 124.0
-Plot saved to plots/mcmc_diagnosis_plots.png
-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

+ 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: 38.0
+Effective Sample Size for I_init for Chain 1: 43.0
+Effective Sample Size for H_init for Chain 1: 85.0
+Effective Sample Size for gamma for Chain 1: 52.0
+Effective Sample Size for nu for Chain 1: 39.0
+Effective Sample Size for epsilon for Chain 1: 26.0
+Effective Sample Size for rt_init for Chain 1: 34.0
+Effective Sample Size for w_init for Chain 1: 32.0
+Effective Sample Size for rho_gene for Chain 1: 17.0
+Effective Sample Size for tau for Chain 1: 38.0
+Effective Sample Size for df for Chain 1: 85.0
+Effective Sample Size for sigma_hosp for Chain 1: 31.0
+Plot saved to plots/mcmc_diagnosis_plots1.png
+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

diff --git a/dev/tutorials/uciwwiehr_model_fitting_no_forecast/index.html b/dev/tutorials/uciwwiehr_model_fitting_no_forecast/index.html index a6bd721..59acfc5 100644 --- a/dev/tutorials/uciwwiehr_model_fitting_no_forecast/index.html +++ b/dev/tutorials/uciwwiehr_model_fitting_no_forecast/index.html @@ -28,7 +28,7 @@ obstimes = df.obstimes param_change_times = 1:7:length(obstimes) # Change every week priors_only = false -n_samples = 200 +n_samples = 50 samples = uciwweihr_fit( data_hosp, @@ -46,7 +46,7 @@ param_change_times = param_change_times, ) -first(model_output[1][:,1:5], 5)
5×5 DataFrame
Rowiterationchaindata_wastewater[1]data_hosp[1]data_wastewater[2]
Int64Int64Float64Float64Float64
1110.26668423.00.566818
2210.20212223.00.487088
3310.3417714.00.319522
4410.23526123.00.599787
5510.1859424.00.44147
first(model_output[2][:,1:5], 5)
5×5 DataFrame
RowiterationchainE_initI_initH_init
Int64Int64Float64Float64Float64
111193.933104.4420.424
221200.746102.93717.9451
331201.908104.95414.323
441183.947100.84921.1074
551193.31493.570818.412
first(model_output[3][:,1:5], 5)
5×5 DataFrame
RowiterationchainE_init_non_centeredI_init_non_centeredH_init_non_centered
Int64Int64Float64Float64Float64
11011-0.1213380.2220030.0847913
210210.01491820.146836-0.410988
310310.03815280.247703-1.13541
41041-0.3210630.04246830.221474
51051-0.133724-0.321458-0.317591

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.19653118.00.585924
2210.4747918.00.257651
3310.087104618.00.430068
4410.19221823.00.460868
5510.33760730.00.760354
first(model_output[2][:,1:5], 5)
5×5 DataFrame
RowiterationchainE_initI_initH_init
Int64Int64Float64Float64Float64
111222.68681.944515.1571
221221.27982.180814.5166
331175.88475.692614.8741
441186.6479.355619.7861
551212.54113.34117.454
first(model_output[3][:,1:5], 5)
5×5 DataFrame
RowiterationchainE_init_non_centeredI_init_non_centeredH_init_non_centered
Int64Int64Float64Float64Float64
12610.453714-0.902777-0.968575
22710.425584-0.890962-1.09667
3281-0.48232-1.21537-1.02517
4291-0.267207-1.03222-0.0427832
53010.2508030.667046-0.509208

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(
     pp_samples = model_output[1],
     gq_samples = model_output[2],
     data_hosp = data_hosp,
@@ -56,19 +56,19 @@
     actual_non_time_varying_vals = params,
     bayes_dist_type = "Posterior",
     save_plots = true
-)
Effective Sample Size for E_init for Chain 1: 91.0
-Effective Sample Size for I_init for Chain 1: 98.0
-Effective Sample Size for H_init for Chain 1: 98.0
-Effective Sample Size for gamma for Chain 1: 73.0
-Effective Sample Size for nu for Chain 1: 38.0
-Effective Sample Size for epsilon for Chain 1: 55.0
-Effective Sample Size for rt_init for Chain 1: 40.0
-Effective Sample Size for w_init for Chain 1: 57.0
-Effective Sample Size for rho_gene for Chain 1: 27.0
-Effective Sample Size for tau for Chain 1: 49.0
-Effective Sample Size for df for Chain 1: 228.0
-Effective Sample Size for sigma_hosp for Chain 1: 61.0
+)
Effective Sample Size for E_init for Chain 1: 28.0
+Effective Sample Size for I_init for Chain 1: 19.0
+Effective Sample Size for H_init for Chain 1: 29.0
+Effective Sample Size for gamma for Chain 1: 9.0
+Effective Sample Size for nu for Chain 1: 2.0
+Effective Sample Size for epsilon for Chain 1: 4.0
+Effective Sample Size for rt_init for Chain 1: 18.0
+Effective Sample Size for w_init for Chain 1: 12.0
+Effective Sample Size for rho_gene for Chain 1: 12.0
+Effective Sample Size for tau for Chain 1: 3.0
+Effective Sample Size for df for Chain 1: 8.0
+Effective Sample Size for sigma_hosp for Chain 1: 7.0
 Plot saved to plots/mcmc_diagnosis_plots.png
 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