diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 65f7b67..8d460cb 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2024-10-17T21:48:53","documenter_version":"1.7.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2024-10-22T21:35:54","documenter_version":"1.7.0"}} \ No newline at end of file diff --git a/dev/index.html b/dev/index.html index 86d87cb..48899b6 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,3 +1,3 @@ HOME · UCIWWEIHR.jl

UCIWWEIHR.jl

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

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

Introduction

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

Features

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

Installation

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

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

UCIWWEIHR.jl Package License

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

MIT License

MIT License

Copyright (c) 2024 Christian O. Bernal Zelaya

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

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

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

+LICENSE · UCIWWEIHR.jl

UCIWWEIHR.jl Package License

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

MIT License

MIT License

Copyright (c) 2024 Christian O. Bernal Zelaya

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

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

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

diff --git a/dev/reference/index.html b/dev/reference/index.html index c6be72d..3156edb 100644 --- a/dev/reference/index.html +++ b/dev/reference/index.html @@ -1,4 +1,4 @@ -REFERENCE · UCIWWEIHR.jl

Reference

Contents

Index

UCIWWEIHR.uciwweihr_model_paramsType
uciwweihr_model_params

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

Fields

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

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

Fields

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

Reduce Chains object to only wanted indices.

Function created by Damon Bayer.

source
UCIWWEIHR.NegativeBinomial2Method

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

Arguments

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

Returns

A Distributions.NegativeBinomial distribution object.

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

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

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

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

Arguments

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

Returns

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

createuciwweihrsim_params(; kwargs...)

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

Arguments

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

Returns

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

eihr_ode!(du, u, p, t)

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

Parameters:

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

Returns:

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

Generates a logit-normal random walk time series.

Arguments

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

Returns

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

Generates a random walk time series.

Arguments

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

Returns

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

Generating Simulation Data for Agent Based Model

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

Function Signature

Arguments

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

Returns

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

Generates simulation data for the UCIWWEIHR ODE compartmental model.

Arguments

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

Returns

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

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

Arguments

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

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

Arguments

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

Reference

Contents

Index

UCIWWEIHR.uciwweihr_model_paramsType
uciwweihr_model_params

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

Fields

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

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

Fields

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

Reduce Chains object to only wanted indices.

Function created by Damon Bayer.

source
UCIWWEIHR.NegativeBinomial2Method

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

Arguments

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

Returns

A Distributions.NegativeBinomial distribution object.

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

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

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

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

Arguments

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

Returns

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

createuciwweihrsim_params(; kwargs...)

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

Arguments

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

Returns

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

eihr_ode!(du, u, p, t)

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

Parameters:

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

Returns:

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

Generates a logit-normal random walk time series.

Arguments

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

Returns

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

Generates a random walk time series.

Arguments

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

Returns

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

Generating Simulation Data for Agent Based Model

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

Function Signature

Arguments

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

Returns

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

Generates simulation data for the UCIWWEIHR ODE compartmental model.

Arguments

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

Returns

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

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

Arguments

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

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

Arguments

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

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

Arguments

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

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

Arguments

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

Returns

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

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

Arguments

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

Returns

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

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

Arguments

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

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

Arguments

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

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

Arguments

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

Returns

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

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

Arguments

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

Returns

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

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

Arguments

  • data_hosp: An array of hospital data.
  • data_wastewater: An array of pathogen genome concentration in localized wastewater data. If this is not avaliable, the model used will be one that only uses hospital data.
  • obstimes_hosp: An array of timepoints for observed hospital data.
  • obstimes_wastewater: An array of timepoints for observed wastewater data.
  • param_change_times: An array of timepoints where the parameters change.
  • params::uciwweihr_model_params: A struct containing parameters for the model.
source
diff --git a/dev/search_index.js b/dev/search_index.js index b8bf24f..2d889b6 100644 --- a/dev/search_index.js +++ b/dev/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"tutorial_index/#tutorial_home","page":"TUTORIAL CONTENTS","title":"Tutorial Contents","text":"","category":"section"},{"location":"tutorial_index/","page":"TUTORIAL CONTENTS","title":"TUTORIAL CONTENTS","text":"Future Description.","category":"page"},{"location":"tutorial_index/#Contents","page":"TUTORIAL CONTENTS","title":"Contents","text":"","category":"section"},{"location":"tutorial_index/","page":"TUTORIAL CONTENTS","title":"TUTORIAL CONTENTS","text":"Getting Started\nGenerating simulated data with UCIWWEIHR ODE compartmental based model.\nGenerating simulated data with an agent based model.\nGenerating posterior distribution samples with UCIWWEIHR ODE compartmental based model without forecasting.\nGenerating posterior distribution samples with UCIWWEIHR ODE compartmental based model with forecasting.\nGenerating repeated forecasts using the UCIWWEIHR model.","category":"page"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/","page":"UCIWWEIHR REPEATED FORECASTING","title":"UCIWWEIHR REPEATED FORECASTING","text":"using Plots, StatsPlots; gr()\nPlots.reset_defaults()\n","category":"page"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/#uciwwiehr_model_repeated_forecasts","page":"UCIWWEIHR REPEATED FORECASTING","title":"Generating Repeated Forecasts Using the UCIWWEIHR model.","text":"","category":"section"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/","page":"UCIWWEIHR REPEATED FORECASTING","title":"UCIWWEIHR REPEATED FORECASTING","text":"Here we show how we can construct repeated forecasts using the UCIWWEIHR model. We start with generating out data using generate_simulation_data_uciwweihr's alternate parameterization where we do prespecify the effective reproduction number and hospitalization probability. ","category":"page"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/#1.-Data-Generation.","page":"UCIWWEIHR REPEATED FORECASTING","title":"1. Data Generation.","text":"","category":"section"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/","page":"UCIWWEIHR REPEATED FORECASTING","title":"UCIWWEIHR REPEATED FORECASTING","text":"Here we simulate a dataset, one with 175 time points. ","category":"page"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/","page":"UCIWWEIHR REPEATED FORECASTING","title":"UCIWWEIHR REPEATED FORECASTING","text":"using UCIWWEIHR\n# Running simulation function with presets\nrt_custom = vcat(\n range(1, stop=1.8, length=7*4),\n fill(1.8, 7*2),\n range(1.8, stop=1, length=7*8),\n range(0.98, stop=0.8, length=7*2),\n range(0.8, stop=1.1, length=7*6),\n range(1.1, stop=0.97, length=7*3)\n)\nw_custom = vcat(\n range(0.3, stop=0.38, length=7*5),\n fill(0.38, 7*2),\n range(0.38, stop=0.25, length=7*8),\n range(0.25, stop=0.28, length=7*2),\n range(0.28, stop=0.34, length=7*6),\n range(0.34, stop=0.28, length=7*2)\n)\nparams = create_uciwweihr_sim_params(\n time_points = length(rt_custom),\n Rt = rt_custom, \n w = w_custom\n)\ndf = generate_simulation_data_uciwweihr(params)\nfirst(df, 5)","category":"page"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/#2.-Constructing-Repeat-Forecasts.","page":"UCIWWEIHR REPEATED FORECASTING","title":"2. Constructing Repeat Forecasts.","text":"","category":"section"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/","page":"UCIWWEIHR REPEATED FORECASTING","title":"UCIWWEIHR REPEATED FORECASTING","text":"We use the repeated_forecast function to generate forecasts for a given number of weeks, for a given number of time points. Along with this we need to specify presets. Output of this function is an array with the first index controlling which result we are looking at. The next contains a uciwweihr_gq_pp output.","category":"page"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/","page":"UCIWWEIHR REPEATED FORECASTING","title":"UCIWWEIHR REPEATED FORECASTING","text":"data_hosp = df.hosp\ndata_wastewater = df.log_ww_conc\nobstimes_hosp = df.obstimes\nobstimes_wastewater = df.obstimes\nmax_obstime = max(length(obstimes_hosp), length(obstimes_wastewater))\nparam_change_times = 1:7:max_obstime # Change every week\npriors_only = false\nn_samples = 200\nn_forecast_weeks = 2\nforecast_points = [\n param_change_times[end-5],\n param_change_times[end-4],\n param_change_times[end-3],\n param_change_times[end-2]\n]\n\nmodel_params = create_uciwweihr_model_params()\n\nrep_results = repeated_forecast(\n data_hosp,\n data_wastewater,\n obstimes_hosp,\n obstimes_wastewater;\n n_samples = n_samples,\n params = model_params,\n n_forecast_weeks = 2,\n forecast_points = forecast_points\n)\n\nfirst(rep_results, 2)","category":"page"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/#3.-Visualizing-Results-Of-Repeated-Forecasts.","page":"UCIWWEIHR REPEATED FORECASTING","title":"3. Visualizing Results Of Repeated Forecasts.","text":"","category":"section"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/","page":"UCIWWEIHR REPEATED FORECASTING","title":"UCIWWEIHR REPEATED FORECASTING","text":"We can take a look at these forecasts using the uciwweihr_visualizer function. We can also add certain parameters to ensure we only see the plots we want.","category":"page"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/","page":"UCIWWEIHR REPEATED FORECASTING","title":"UCIWWEIHR REPEATED FORECASTING","text":"for res_index in 1:length(forecast_points)\n uciwweihr_visualizer(\n data_hosp, \n data_wastewater,\n n_forecast_weeks,\n obstimes_hosp,\n obstimes_wastewater,\n param_change_times,\n 2024,\n true,\n model_params;\n pp_samples = rep_results[res_index][2][1],\n gq_samples = rep_results[res_index][2][2],\n obs_data_hosp = data_hosp,\n obs_data_wastewater = data_wastewater, \n actual_rt_vals = df.rt, \n actual_w_t = df.wt, \n actual_non_time_varying_vals = params,\n bayes_dist_type = \"Posterior\",\n mcmcdaigs = false,\n time_varying_plots = false,\n non_time_varying_plots = false,\n pred_param_plots = true,\n save_plots = true,\n plot_name_to_save_pred_param = \"mcmc_pred_parameter_plots_rep_res\"*string(res_index)\n )\nend","category":"page"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/#3.1.-Forecast-Point-1.","page":"UCIWWEIHR REPEATED FORECASTING","title":"3.1. Forecast Point 1.","text":"","category":"section"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/","page":"UCIWWEIHR REPEATED FORECASTING","title":"UCIWWEIHR REPEATED FORECASTING","text":"(Image: Plot 1)","category":"page"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/#3.2.-Forecast-Point-2.","page":"UCIWWEIHR REPEATED FORECASTING","title":"3.2. Forecast Point 2.","text":"","category":"section"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/","page":"UCIWWEIHR REPEATED FORECASTING","title":"UCIWWEIHR REPEATED FORECASTING","text":"(Image: Plot 2)","category":"page"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/#3.3.-Forecast-Point-3.","page":"UCIWWEIHR REPEATED FORECASTING","title":"3.3. Forecast Point 3.","text":"","category":"section"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/","page":"UCIWWEIHR REPEATED FORECASTING","title":"UCIWWEIHR REPEATED FORECASTING","text":"(Image: Plot 3)","category":"page"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/#3.4.-Forecast-Point-4.","page":"UCIWWEIHR REPEATED FORECASTING","title":"3.4. Forecast Point 4.","text":"","category":"section"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/","page":"UCIWWEIHR REPEATED FORECASTING","title":"UCIWWEIHR REPEATED FORECASTING","text":"(Image: Plot 4)","category":"page"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/#[Tutorial-Contents](@ref-tutorial_home)","page":"UCIWWEIHR REPEATED FORECASTING","title":"Tutorial Contents","text":"","category":"section"},{"location":"license/#license","page":"LICENSE","title":"UCIWWEIHR.jl Package License","text":"","category":"section"},{"location":"license/","page":"LICENSE","title":"LICENSE","text":"The UCIWWEIHR.jl package is licensed under the MIT License.","category":"page"},{"location":"license/#MIT-License","page":"LICENSE","title":"MIT License","text":"","category":"section"},{"location":"license/","page":"LICENSE","title":"LICENSE","text":"MIT License","category":"page"},{"location":"license/","page":"LICENSE","title":"LICENSE","text":"Copyright (c) 2024 Christian O. Bernal Zelaya","category":"page"},{"location":"license/","page":"LICENSE","title":"LICENSE","text":"Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:","category":"page"},{"location":"license/","page":"LICENSE","title":"LICENSE","text":"The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.","category":"page"},{"location":"license/","page":"LICENSE","title":"LICENSE","text":"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"using Plots, StatsPlots; gr()\nPlots.reset_defaults()\n","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#uciwwiehr_model_fitting_with_forecast","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"Generating Posterior Distribution Samples with UCIWWEIHR ODE Compartmental Based Model with Forecasting.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"Here we extend the previous tutorial to include forecasting capabilities. We start with generating out data using generate_simulation_data_uciwweihr's alternate parameterization where we do not prespecify the effective reproduction number and hospitalization probability but instead preform a log-normal random walk and a logit-normal random walk respectively. We then sample from the posterior distribution using the uciwweihr_fit.jl function. We then generate desired quantities and forecast for a given time period with the posterior predictive distribution, using uciwweihr_gq_pp.jl.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#1.-Data-Generation.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"1. Data Generation.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"Here we generate two datasets, one with 150 time points and one with 178 time points. We will use the 150 time point dataset for fitting and the 178 time point dataset for forecast evaluation.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"using UCIWWEIHR\n# Running simulation function with presets\nparams = create_uciwweihr_sim_params(\n time_points = 150\n)\ndf = generate_simulation_data_uciwweihr(params)\n\nparams_ext = create_uciwweihr_sim_params(\n time_points = 178\n)\ndf_ext = generate_simulation_data_uciwweihr(params_ext)\nfirst(df, 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"first(df_ext, 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#2.-Sampling-from-the-Posterior-Distribution-and-Posterior-Predictive-Distribution.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"2. Sampling from the Posterior Distribution and Posterior Predictive Distribution.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"Here we sample from the posterior distribution using the uciwweihr_fit.jl function. First, we setup some presets, where we need to use create_uciwweihr_model_params() to get default parameters for the model. Then we have an array where index 1 contains the posterior/prior predictive samples, index 2 contains the posterior/prior generated quantities samples, and index 3 contains the original sampled parameters for the model. The difference here is that we set forecast = true and forecast_weeks = 4 to forecast 4 weeks into the future. One other thing to note, is that we allow misalignment of hospital and wastewater data's observed times. For this tutorial, we use the same observed points.","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_hosp = df.obstimes\nobstimes_wastewater = df.obstimes\nmax_obstime = max(length(obstimes_hosp), length(obstimes_wastewater))\nparam_change_times = 1:7:max_obstime # Change every week\npriors_only = false\nn_samples = 200\nforecast = true\nforecast_weeks = 4\n\nmodel_params = create_uciwweihr_model_params()\nsamples = uciwweihr_fit(\n data_hosp,\n data_wastewater,\n obstimes_hosp,\n obstimes_wastewater;\n param_change_times,\n priors_only,\n n_samples,\n params = model_params\n)\nmodel_output = uciwweihr_gq_pp(\n samples,\n data_hosp,\n data_wastewater,\n obstimes_hosp,\n obstimes_wastewater;\n param_change_times = param_change_times,\n params = model_params,\n forecast = forecast,\n forecast_weeks = forecast_weeks\n)\n\nfirst(model_output[1][:,1:5], 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"first(model_output[2][:,1:5], 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"first(model_output[3][:,1:5], 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#3.-MCMC-Diagnostic-Plots/Results-Along-with-Posterior-Predictive-Distribution.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"3. MCMC Diagnostic Plots/Results Along with Posterior Predictive Distribution.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"We can again look at model diagnostics, posterior distribution of time or non-time varying parameters, and the posterior predictive distribution extended for forecasting. We can also add certain parameters to ensure priors will be plotted alongside their corresponding posteriors.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"uciwweihr_visualizer(\n data_hosp, \n data_wastewater,\n forecast_weeks,\n obstimes_hosp,\n obstimes_wastewater,\n param_change_times,\n 2024,\n forecast,\n model_params;\n pp_samples = model_output[1],\n gq_samples = model_output[2],\n obs_data_hosp = df_ext.hosp,\n obs_data_wastewater = df_ext.log_ww_conc, \n actual_rt_vals = df_ext.rt, \n actual_w_t = df_ext.wt, \n actual_non_time_varying_vals = params,\n bayes_dist_type = \"Posterior\",\n save_plots = true,\n plot_name_to_save_mcmcdiag = \"mcmc_diagnosis_plots1\",\n plot_name_to_save_time_varying = \"mcmc_time_varying_parameter_plots1\",\n plot_name_to_save_non_time_varying = \"mcmc_nontime_varying_parameter_plots1\",\n plot_name_to_save_pred_param = \"mcmc_pred_parameter_plots1\"\n)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#3.1.-MCMC-Diagnostic-Plots.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"3.1. MCMC Diagnostic Plots.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"(Image: Plot 1)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#3.2.-Time-Varying-Parameter-Results-Plot.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"3.2. Time Varying Parameter Results Plot.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"(Image: Plot 2)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#3.3.-Non-Time-Varying-Parameter-Results-Plot.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"3.3. Non-Time Varying Parameter Results Plot.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"(Image: Plot 3)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#3.4.-Posterior-Predictive-Distribution-Plot.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"3.4. Posterior Predictive Distribution Plot.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"(Image: Plot 4)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#[Tutorial-Contents](@ref-tutorial_home)","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"Tutorial Contents","text":"","category":"section"},{"location":"tutorials/agent_based_simulation_data/#agent_based_simulation_data","page":"AGENT-BASED SIMULATION DATA","title":"Generating simulated data with an agent based model.","text":"","category":"section"},{"location":"tutorials/agent_based_simulation_data/","page":"AGENT-BASED SIMULATION DATA","title":"AGENT-BASED SIMULATION DATA","text":"This package provides a way to also simulate data using the agent based model in the future paper. The function called generate_simulation_data_agent.jl can be used to generate synthetic data for a given population size and features. Here we provide a demonstration using the default settings of generate_simulation_data_agent.jl :","category":"page"},{"location":"tutorials/agent_based_simulation_data/#1.-Functionality.","page":"AGENT-BASED SIMULATION DATA","title":"1. Functionality.","text":"","category":"section"},{"location":"tutorials/agent_based_simulation_data/","page":"AGENT-BASED SIMULATION DATA","title":"AGENT-BASED SIMULATION DATA","text":"using UCIWWEIHR\nusing Plots\n# Running simulation function with defaults\ndf = generate_simulation_data_agent()\nfirst(df, 5)","category":"page"},{"location":"tutorials/agent_based_simulation_data/#2.-Visualizing-SEIHR-compartments.","page":"AGENT-BASED SIMULATION DATA","title":"2. Visualizing SEIHR compartments.","text":"","category":"section"},{"location":"tutorials/agent_based_simulation_data/","page":"AGENT-BASED SIMULATION DATA","title":"AGENT-BASED SIMULATION DATA","text":"We can also use the Plots package to visualize the data generated.","category":"page"},{"location":"tutorials/agent_based_simulation_data/","page":"AGENT-BASED SIMULATION DATA","title":"AGENT-BASED SIMULATION DATA","text":"plot(df.Time, df.S, label = \"Suseptible\", \n xlabel = \"Time\", \n ylabel = \"Number of Individuals\", \n title = \"Agent Based Model Simulation Results\")\nplot!(df.Time, df.E, label = \"Exposed\")\nplot!(df.Time, df.I, label = \"Infected\")\nplot!(df.Time, df.H, label = \"Hospitalized\")\nplot!(df.Time, df.R, label = \"Recovered\")","category":"page"},{"location":"tutorials/agent_based_simulation_data/#[Tutorial-Contents](@ref-tutorial_home)","page":"AGENT-BASED SIMULATION DATA","title":"Tutorial Contents","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"using Plots, StatsPlots; gr()\nPlots.reset_defaults()\n","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#uciwwiehr_model_fitting_no_forecast","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"Generating Posterior Distribution Samples with UCIWWEIHR ODE Compartmental Based Model without Forecasting.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"This package has a way to sample from a posterior or prior that is defined in the future paper using the uciwweihr_fit.jl and uciwweihr_model.jl. We can then generate desired quantities and forecast for a given time period with the posterior predictive distribution, using uciwweihr_gq_pp.jl. We first generate data using the generate_simulation_data_uciwweihr function which is a non-mispecified version of the model, we will also be using prespecified effective reporduction curves and prespecified hospitalization probability curves.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#1.-Data-Generation.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"1. Data Generation.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"using UCIWWEIHR\n# Running simulation function with presets\nrt_custom = vcat(\n range(1, stop=1.8, length=7*4),\n fill(1.8, 7*2),\n range(1.8, stop=1, length=7*8),\n range(0.98, stop=0.8, length=7*2),\n range(0.8, stop=1.1, length=7*6),\n range(1.1, stop=0.97, length=7*3)\n)\nw_custom = vcat(\n range(0.3, stop=0.38, length=7*5),\n fill(0.38, 7*2),\n range(0.38, stop=0.25, length=7*8),\n range(0.25, stop=0.28, length=7*2),\n range(0.28, stop=0.34, length=7*6),\n range(0.34, stop=0.28, length=7*2)\n)\nparams = create_uciwweihr_sim_params(\n time_points = length(rt_custom),\n Rt = rt_custom, \n w = w_custom\n)\ndf = generate_simulation_data_uciwweihr(params)\nfirst(df, 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#2.-Sampling-from-the-Posterior-Distribution-and-Posterior-Predictive-Distribution.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"2. Sampling from the Posterior Distribution and Posterior Predictive Distribution.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"Here we sample from the posterior distribution using the uciwweihr_fit.jl function. First, we setup some presets, where we need to use create_uciwweihr_model_params() to get default parameters for the model. Then we have an array where index 1 contains the posterior/prior predictive samples, index 2 contains the posterior/prior generated quantities samples, and index 3 contains the original sampled parameters for the model. Again, we can allow misalignment of hospital and wastewater data's observed times. For this tutorial, we use the same observed points.","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_hosp = df.obstimes\nobstimes_wastewater = df.obstimes\nmax_obstime = max(length(obstimes_hosp), length(obstimes_wastewater))\nparam_change_times = 1:7:max_obstime # Change every week\npriors_only = false\nn_samples = 200\nforecast = false\nforecast_weeks = 0\n\nmodel_params = create_uciwweihr_model_params()\nsamples = uciwweihr_fit(\n data_hosp,\n data_wastewater,\n obstimes_hosp,\n obstimes_wastewater;\n param_change_times,\n priors_only,\n n_samples,\n params = model_params\n)\nmodel_output = uciwweihr_gq_pp(\n samples,\n data_hosp,\n data_wastewater,\n obstimes_hosp,\n obstimes_wastewater;\n param_change_times = param_change_times,\n params = model_params\n)\n\nfirst(model_output[1][:,1:5], 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"first(model_output[2][:,1:5], 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"first(model_output[3][:,1:5], 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#3.-MCMC-Diagnostic-Plots/Results-Along-with-Posterior-Predictive-Distribution.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"3. MCMC Diagnostic Plots/Results Along with Posterior Predictive Distribution.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"We also provide a very basic way to visualize some MCMC diagnostics along with effective sample sizes of desired generated quantities(does not include functionality for time-varying quantities). Along with this, we can also visualize the posterior predictive distribution with actual observed values, which can be used to examine forecasts generated by the model. We can also add certain parameters to ensure priors will be plotted alongside their corresponding posteriors.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"uciwweihr_visualizer(\n data_hosp, \n data_wastewater,\n forecast_weeks,\n obstimes_hosp,\n obstimes_wastewater,\n param_change_times,\n 2024,\n forecast,\n model_params;\n pp_samples = model_output[1],\n gq_samples = model_output[2],\n obs_data_hosp = data_hosp,\n obs_data_wastewater = data_wastewater, \n actual_rt_vals = df.rt, \n actual_w_t = df.wt, \n actual_non_time_varying_vals = params,\n bayes_dist_type = \"Posterior\",\n save_plots = true\n)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#3.1.-MCMC-Diagnostic-Plots.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"3.1. MCMC Diagnostic Plots.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"(Image: Plot 1)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#3.2.-Time-Varying-Parameter-Results-Plot.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"3.2. Time Varying Parameter Results Plot.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"(Image: Plot 2)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#3.3.-Non-Time-Varying-Parameter-Results-Plot.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"3.3. Non-Time Varying Parameter Results Plot.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"(Image: Plot 3)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#3.4.-Posterior-Predictive-Distribution-Plot.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"3.4. Posterior Predictive Distribution Plot.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"(Image: Plot 4)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#[Tutorial-Contents](@ref-tutorial_home)","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"Tutorial Contents","text":"","category":"section"},{"location":"tutorials/getting_started/#getting_started","page":"GETTING STARTED","title":"Getting Started","text":"","category":"section"},{"location":"tutorials/getting_started/","page":"GETTING STARTED","title":"GETTING STARTED","text":"Welcome to the Tutorials page for the UCIWWEIHR.jl project. This section provides step-by-step guides and examples to help you get started with using the package and understanding its features.","category":"page"},{"location":"tutorials/getting_started/#1.-Installation.","page":"GETTING STARTED","title":"1. Installation.","text":"","category":"section"},{"location":"tutorials/getting_started/","page":"GETTING STARTED","title":"GETTING STARTED","text":"To install the UCIWWEIHR.jl package, open the Julia REPL and run the following command:","category":"page"},{"location":"tutorials/getting_started/","page":"GETTING STARTED","title":"GETTING STARTED","text":"using Pkg\nPkg.add(\"https://github.com/cbernalz/UCIWWEIHR.jl.git\")","category":"page"},{"location":"tutorials/getting_started/#[Tutorial-Contents](@ref-tutorial_home)","page":"GETTING STARTED","title":"Tutorial Contents","text":"","category":"section"},{"location":"reference/#reference","page":"REFERENCE","title":"Reference","text":"","category":"section"},{"location":"reference/#Contents","page":"REFERENCE","title":"Contents","text":"","category":"section"},{"location":"reference/","page":"REFERENCE","title":"REFERENCE","text":"Pages = [\"reference.md\"]","category":"page"},{"location":"reference/#Index","page":"REFERENCE","title":"Index","text":"","category":"section"},{"location":"reference/","page":"REFERENCE","title":"REFERENCE","text":"Pages = [\"reference.md\"]","category":"page"},{"location":"reference/","page":"REFERENCE","title":"REFERENCE","text":"Modules = [UCIWWEIHR]","category":"page"},{"location":"reference/#UCIWWEIHR.uciwweihr_model_params","page":"REFERENCE","title":"UCIWWEIHR.uciwweihr_model_params","text":"uciwweihr_model_params\n\nStruct for holding parameters used in the UCIWWEIHR ODE compartmental model. Use create_uciwweihr_model_params to create an instance of this struct.\n\nFields\n\nE_init_sd::Float64=50.0: Standard deviation for the initial number of exposed individuals.\nE_init_mean::Int64=200: Mean for the initial number of exposed individuals.\nI_init_sd::Float64=20.0: Standard deviation for the initial number of infected individuals.\nI_init_mean::Int64=100: Mean for the initial number of infected individuals.\nH_init_sd::Float64=5.0: Standard deviation for the initial number of hospitalized individuals.\nH_init_mean::Int64=20: Mean for the initial number of hospitalized individuals.\ngamma_sd::Float64=0.02: Standard deviation for the rate of incubation.\nlog_gamma_mean::Float64=log(1/4): Mean for the rate of incubation on log scale.\nnu_sd::Float64=0.02: Standard deviation for the rate of leaving the infected compartment.\nlog_nu_mean::Float64=log(1/7): Mean for the rate of leaving the infected compartment on the log scale.\nepsilon_sd::Float64=0.02: Standard deviation for the rate of hospitalization recovery.\nlog_epsilon_mean::Float64=log(1/5): Mean for the rate of hospitalization recovery on the log scale.\nrho_gene_sd::Float64=0.02: Standard deviation for the rho prior.\nlog_rho_gene_mean::Float64=log(0.011): Mean for the row prior on log scale.\ntau_sd::Float64=0.02: Standard deviation for the scale/variation of the log scale data.\nlog_tau_mean::Float64=log(0.1): Mean for the scale/variation of the log scale data on log scale itself.\ndf_shape::Float64=2.0: Shape parameter for the gamma distribution.\ndf_scale::Float64=10.0: Scale parameter for the gamma distribution.\nsigma_hosp_sd::Float64=50.0: Standard deviation for the negative binomial distribution for hospital data.\nsigma_hosp_mean::Float64=500.0: Mean for the negative binomial distribution for hospital data.\nRt_init_sd::Float64=0.3: Standard deviation for the initial value of the time-varying reproduction number.\nRt_init_mean::Float64=0.2: Mean for the initial value of the time-varying reproduction number.\nsigma_Rt_sd::Float64=0.2: Standard deviation for normal prior of log time-varying reproduction number standard deviation.\nsigma_Rt_mean::Float64=-3.0: Mean for normal prior of log time-varying reproduction number standard deviation.\nw_init_sd::Float64=0.1: Standard deviation for the initial value of the time-varying hospitalization rate.\nw_init_mean::Float64=log(0.35): Mean for the initial value of the time-varying hospitalization rate.\nsigma_w_sd::Float64=0.2: Standard deviation for normal prior of log time-varying hospitalization rate standard deviation.\nsigma_w_mean::Float64=-3.5: Mean for normal prior of time-varying hospitalization rate standard deviation.\n\n\n\n\n\n","category":"type"},{"location":"reference/#UCIWWEIHR.uciwweihr_sim_params","page":"REFERENCE","title":"UCIWWEIHR.uciwweihr_sim_params","text":"uciwweihr_sim_params\n\nStruct for holding parameters used in the UCIWWEIHR ODE compartmental model simulation. Use create_uciwweihr_sim_params to create an instance of this struct.\n\nFields\n\ntime_points::Int64: Number of time points for the simulation.\nseed::Int64: Seed for random number generation.\nE_init::Int64: Initial number of exposed individuals.\nI_init::Int64: Initial number of infected individuals.\nH_init::Int64: Initial number of hospitalized individuals.\ngamma::Float64: Rate of incubation.\nnu::Float64: Rate of leaving the infected compartment.\nepsilon::Float64: Rate of hospitalization recovery.\nrho_gene::Float64: Contribution of infected individual's pathogen genome into wastewater.\ntau::Float64: Scale/variation of the log concentration of pathogen genome in wastewater.\ndf::Float64: Degrees of freedom for generalized t-distribution for log concentration of pathogen genome in wastewater.\nsigma_hosp::Float64: Standard deviation for the negative binomial distribution for hospital data.\nRt::Union{Float64, Vector{Float64}}: Initial value or time series of the time-varying reproduction number.\nsigma_Rt::Float64: Standard deviation for random walk of time-varying reproduction number.\nw::Union{Float64, Vector{Float64}}: Initial value or time series of the time-varying hospitalization rate.\nsigma_w::Float64: Standard deviation for random walk of time-varying hospitalization rate.\nrt_init::Float64: Initial value of the time-varying reproduction number, NOT USER SPECIFIED create_uciwweihr_params TAKES CARE OF THIS.\nw_init::Float64: Initial value of the time-varying hospitalization rate, NOT USER SPECIFIED create_uciwweihr_params TAKES CARE OF THIS.\n\n\n\n\n\n","category":"type"},{"location":"reference/#UCIWWEIHR.ChainsCustomIndex-Tuple{MCMCChains.Chains, BitMatrix}","page":"REFERENCE","title":"UCIWWEIHR.ChainsCustomIndex","text":"ChainsCustomIndex(c::Chains, indices_to_keep::BitMatrix)\n\nReduce Chains object to only wanted indices. \n\nFunction created by Damon Bayer. \n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.NegativeBinomial2-Tuple{Any, Any}","page":"REFERENCE","title":"UCIWWEIHR.NegativeBinomial2","text":"Create a re-parametrized negative binomial distribution in terms of mean and overdispersion.\n\nArguments\n\nμ: Mean of the distribution.\nϕ: Overdispersion parameter.\n\nReturns\n\nA Distributions.NegativeBinomial distribution object.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.calculate_quantiles-NTuple{4, Any}","page":"REFERENCE","title":"UCIWWEIHR.calculate_quantiles","text":"calculate_quantiles(df, chain, var_prefix, quantiles)\n\nCalculate quantiles for a given chain and variable prefix. Quantiles can be any user desired quantile.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.create_uciwweihr_model_params-Tuple{}","page":"REFERENCE","title":"UCIWWEIHR.create_uciwweihr_model_params","text":"create_uciwweihr_model_params(; kwargs...)\n\nCreates a uciwweihr_sim_params struct with the option to either use a predetermined Rt and w or generate them as random walks.\n\nArguments\n\nkwargs...: Named arguments corresponding to the fields in uciwweihr_sim_params.\n\nReturns\n\nparams::uciwweihr_sim_params: A struct with simulation parameters.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.create_uciwweihr_sim_params-Tuple{}","page":"REFERENCE","title":"UCIWWEIHR.create_uciwweihr_sim_params","text":"createuciwweihrsim_params(; kwargs...)\n\nCreates a uciwweihr_sim_params struct with the option to either use a predetermined Rt and w or generate them as random walks.\n\nArguments\n\nkwargs...: Named arguments corresponding to the fields in uciwweihr_sim_params.\n\nReturns\n\nparams::uciwweihr_sim_params: A struct with simulation parameters.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.eihr_ode!-NTuple{4, Any}","page":"REFERENCE","title":"UCIWWEIHR.eihr_ode!","text":"eihr_ode!(du, u, p, t)\n\nCalculate the ordinary differential equations (ODEs) for the EIHR model.\n\nParameters:\n\ndu: Array{Float64,1} - The derivative of the state variables.\nu: Array{Float64,1} - The current state variables.\np: Tuple{Float64,Float64,Float64,Float64,Float64} - The model parameters (alpha, gamma, nu, w, epsilon).\nt: Float64 - The current time.\n\nReturns:\n\ndu: Array{Float64,1} - The derivative of the state variables.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.generate_colors-Tuple{Any}","page":"REFERENCE","title":"UCIWWEIHR.generate_colors","text":"generate_ribbon_colors(number_of_colors)\n\nGenerates a vector with colors for ribbons in plots.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.generate_logit_normal_random_walk-Tuple{Int64, Float64, Float64, Any}","page":"REFERENCE","title":"UCIWWEIHR.generate_logit_normal_random_walk","text":"generate_logit_normal_random_walk(time_points::Int64, sigma::Float64, init_val::Float64)\n\nGenerates a logit-normal random walk time series.\n\nArguments\n\ntime_points::Int64: Number of time points.\nsigma::Float64: Standard deviation of the random walk in logit space.\ninit_val::Float64: Initial value of the random walk on the probability scale.\n\nReturns\n\nwalk::Vector{Float64}: Generated random walk on the probability scale.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.generate_random_walk-Tuple{Int64, Float64, Float64, Any}","page":"REFERENCE","title":"UCIWWEIHR.generate_random_walk","text":"generate_random_walk(time_points::Int64, sigma::Float64, init_val::Float64)\n\nGenerates a random walk time series.\n\nArguments\n\ntime_points::Int64: Number of time points.\nsigma::Float64: Standard deviation of the random walk.\ninit_val::Float64: Initial value of the random walk.\n\nReturns\n\nwalk::Vector{Float64}: Generated random walk.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.generate_simulation_data_agent","page":"REFERENCE","title":"UCIWWEIHR.generate_simulation_data_agent","text":"Generating Simulation Data for Agent Based Model\n\nTo generate simulation data using the agent based model, you can use the generate_simulation_data_agent function defined in the UCIWWEIHR.jl package. This function allows you to customize various parameters for the simulation. NOT FINISHED, STILL NEEDS WW AND RT\n\nFunction Signature\n\nArguments\n\nseed::Int64: Seed for random number generation. Default value is 1.\npop_size::Int64: Size of the population. Default value is 1000.\nI_init::Int64: Initial number of infected individuals. Default value is 200.\nH_init::Int64: Initial number of hospitalized individuals. Default value is 20.\nbeta::Float64: Transmission rate. Default value is 0.001.\ngamma::Float64: Rate of exposed individuals becoming infectious. Default value is 1/4.\nnu::Float64: Rate of infected individuals recovering or getting hospitalized. Default value is 1/7.\nepsilon::Float64: Rate of hospitalized individuals recovering. Default value is 1/5.\nw_init::Float64: Probability of an infected individual becoming hospitalized. Default value is 0.35.\n\nReturns\n\ndf::DataFrame: A DataFrame containing the simulation data with columns Time, S, E, I, H, and R.\n\n\n\n\n\n","category":"function"},{"location":"reference/#UCIWWEIHR.generate_simulation_data_uciwweihr-Tuple{uciwweihr_sim_params}","page":"REFERENCE","title":"UCIWWEIHR.generate_simulation_data_uciwweihr","text":"generate_simulation_data(params::UCIWWEIHRParams)\n\nGenerates simulation data for the UCIWWEIHR ODE compartmental model.\n\nArguments\n\nparams::uciwweihr_sim_params: Struct containing parameters for the simulation.\n\nReturns\n\ndf::DataFrame: A DataFrame containing the simulation data with columns obstimes, log_ww_conc, hosp, rt, and wt.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.is_time_varying_above_n-Tuple{Symbol, Int64}","page":"REFERENCE","title":"UCIWWEIHR.is_time_varying_above_n","text":"is_time_varying_above_n(name, n)\n\nChecks if the time varying parameter is above a given time point.\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{uciwweihr_model_params, Vararg{Any, 6}}","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\nbuild_params::uciwweihr_model_params: A struct of model parameters used to build gq_samples, used only if user desired priors next to posteriors.\ndata_hosp: Hospitalization data, used only if user desired priors next to posteriors.\ndata_wastewater: Wastewater data, if model does not use this do not specify this, if user desires priors next to plot (do not specify if you do not want prior plots).\nobstimes_hosp: An array of time points for hospital data, used only if user desired priors next to posteriors.\nobstimes_wastewater: An array of time points for wastewater data, used only if user desired priors next to posteriors.\nparam_change_times: An array of time points where the parameters change, used only if user desired priors next to posteriors.\nseed: An integer to set the seed for reproducibility, used only if user desired priors next to posteriors.\nforecast: A boolean to indicate if user wants to forecast, used only if user desired priors next to posteriors.\nforecast_weeks: An integer to indicate the number of weeks to forecast, used only if user desired priors next to posteriors.\ngq_samples: Generated quantities samples from the posterior/prior distribution, index 2 in uciwweihrgqpp output.\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\"]\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.repeated_forecast-NTuple{4, Any}","page":"REFERENCE","title":"UCIWWEIHR.repeated_forecast","text":"repeated_forecast(...)\n\nThis is the function to make repreated forecast for a given forecast time span, n_forecast_weeks, and for given time points, forecast_points. Plots can be made for these forecasts. The output is an array of uciwweihr_gq_pp results for each forecast_points.\n\nArguments\n\ndata_hosp: The hospitalization data.\ndata_wastewater: The wastewater data.\nobstimes_hosp: The time points for the hospitalization data.\nobstimes_wastewater: The time points for the wastewater data.\nn_samples: The number of samples to draw from the posterior.\nparam_change_times: The time points where the parameters change.\nparams::uciwweihr_model_params: The model parameters.\nn_forecast_weeks: The number of weeks to forecast.\nforecast_points: The time points to forecast, thees points should be present in obstimes_hosp.\n\nReturns\n\nAn array of uciwweihr_gq_pp resuts and timeseries used for building for each forecast_points.\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.uciwweihr_fit-NTuple{4, Any}","page":"REFERENCE","title":"UCIWWEIHR.uciwweihr_fit","text":"uciwweihr_fit(...)\n\nThis is the sampler for the bayesian semi-parametric model for the wastewater EIHR compartmental model. The defaults for this fuction will follow those of the default simulation in generatesimulationdatawweihr.jl function.\n\nArguments\n\ndata_hosp: An array of hospital data.\ndata_wastewater: An array of pathogen genome concentration in localized wastewater data. If this is not avaliable, the model used will be one that only uses hospital data.\nobstimes: An array of timepoints for observed hosp/wastewater.\npriors_only::Bool=false: A boolean to indicate if only priors are to be sampled.\nn_samples::Int64=500: Number of samples to be drawn.\nn_chains::Int64=1: Number of chains to be run.\nseed::Int64=2024: Seed for the random number generator.\nparams::uciwweihr_model_params: A struct containing parameters for the model.\n\nReturns\n\nSamples from the posterior or prior distribution.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.uciwweihr_model-NTuple{4, Any}","page":"REFERENCE","title":"UCIWWEIHR.uciwweihr_model","text":"uciwweihr_model(...)\n\nThis is the bayesian semi-parametric model for the wastewater EIHR compartmental model. The defaults for this fuction will follow those of the default simulation in generatesimulationdatawweihr.jl function.\n\nArguments\n\ndata_hosp: An array of hospital data.\ndata_wastewater: An array of pathogen genome concentration in localized wastewater data. If this is not avaliable, the model used will be one that only uses hospital data.\nobstimes_hosp: An array of timepoints for observed hospital data.\nobstimes_wastewater: An array of timepoints for observed wastewater data.\nparam_change_times: An array of timepoints where the parameters change.\nparams::uciwweihr_model_params: A struct containing parameters for the model.\n\n\n\n\n\n","category":"method"},{"location":"tutorials/uciwweihr_simulation_data/#uciwweihr_simulation_data","page":"UCIWWEIHR SIMULATION DATA","title":"Generating simulated data with UCIWWEIHR ODE compartmental based model.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"This package provides a way to also simulate data using the UCIWWEIHR ODE compartmental based model specified in the future paper. The function called generate_simulation_data_uciwweihr.jl can be used to generate synthetic data for a given number of samples and features. Here we provide a demonstration using the default settings of generate_simulation_data_uciwweihr.jl :","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#1.-Functionality.","page":"UCIWWEIHR SIMULATION DATA","title":"1. Functionality.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"using UCIWWEIHR\nusing Plots\n# Running simulation function with defaults\nparams = create_uciwweihr_sim_params()\ndf = generate_simulation_data_uciwweihr(params)\nfirst(df, 5)","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#1.2-Visualizing-UCIWWEIHR-model-results.","page":"UCIWWEIHR SIMULATION DATA","title":"1.2 Visualizing UCIWWEIHR model results.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"Here we can make simple plots to visualize the data generated using the Plots package.","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#1.2.1.-Concentration-of-pathogen-genome-in-wastewater(WW).","page":"UCIWWEIHR SIMULATION DATA","title":"1.2.1. Concentration of pathogen genome in wastewater(WW).","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.log_ww_conc,\n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Conc. of Pathogen Genome in WW\", \n title=\"Plot of Conc. of Pathogen Genome in WW Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#1.2.2.-Hospitalizations.","page":"UCIWWEIHR SIMULATION DATA","title":"1.2.2. Hospitalizations.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.hosp, \n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Hosp\", \n title=\"Plot of Hosp Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#1.2.3.-Reproductive-number.","page":"UCIWWEIHR SIMULATION DATA","title":"1.2.3. Reproductive number.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.rt, \n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Rt\", \n title=\"Plot of Rt Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#1.2.4.-Hospitalization-rate.","page":"UCIWWEIHR SIMULATION DATA","title":"1.2.4. Hospitalization rate.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.wt, \n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Rt\", \n title=\"Plot of Hospitalization Rate Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#2.-Alternate-Functionality.","page":"UCIWWEIHR SIMULATION DATA","title":"2. Alternate Functionality.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"We can also use a prespecified effective repordcution number curve or a prespecified hospitaliation probability curve. Any combintation of presepcified or random walk curves can be used. Here we provide an example of using both a prespecified effective reproduction number curve and a prespecified hospitalization probability curve.","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"using UCIWWEIHR\nusing Plots\n# Running simulation function with prespecified Rt and hospitalization probability\nrt_custom = vcat(\n range(1, stop=1.8, length=7*4),\n fill(1.8, 7*2),\n range(1.8, stop=1, length=7*8),\n range(0.98, stop=0.8, length=7*2),\n range(0.8, stop=1.1, length=7*6),\n range(1.1, stop=0.97, length=7*3)\n)\nw_custom = vcat(\n range(0.3, stop=0.38, length=7*5),\n fill(0.38, 7*2),\n range(0.38, stop=0.25, length=7*8),\n range(0.25, stop=0.28, length=7*2),\n range(0.28, stop=0.34, length=7*6),\n range(0.34, stop=0.28, length=7*2)\n)\nparams = create_uciwweihr_sim_params(\n time_points = length(rt_custom),\n Rt = rt_custom, \n w = w_custom\n)\ndf = generate_simulation_data_uciwweihr(params)\nfirst(df, 5)","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#2.2-Visualizing-UCIWWEIHR-model-results.","page":"UCIWWEIHR SIMULATION DATA","title":"2.2 Visualizing UCIWWEIHR model results.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"We can visualize these results using the Plots package.","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#2.2.1.-Concentration-of-pathogen-genome-in-wastewater(WW).","page":"UCIWWEIHR SIMULATION DATA","title":"2.2.1. Concentration of pathogen genome in wastewater(WW).","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.log_ww_conc,\n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Conc. of Pathogen Genome in WW\", \n title=\"Plot of Conc. of Pathogen Genome in WW Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#2.2.2.-Hospitalizations.","page":"UCIWWEIHR SIMULATION DATA","title":"2.2.2. Hospitalizations.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.hosp, \n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Hosp\", \n title=\"Plot of Hosp Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#2.2.3.-Reproductive-number.","page":"UCIWWEIHR SIMULATION DATA","title":"2.2.3. Reproductive number.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.rt, \n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Rt\", \n title=\"Plot of Rt Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#2.2.4.-Hospitalization-rate.","page":"UCIWWEIHR SIMULATION DATA","title":"2.2.4. Hospitalization rate.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.wt, \n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Rt\", \n title=\"Plot of Hospitalization Rate Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#[Tutorial-Contents](@ref-tutorial_home)","page":"UCIWWEIHR SIMULATION DATA","title":"Tutorial Contents","text":"","category":"section"},{"location":"#UCIWWEIHR.jl","page":"HOME","title":"UCIWWEIHR.jl","text":"","category":"section"},{"location":"","page":"HOME","title":"HOME","text":"Welcome to the UCIWWEIHR.jl package documentation! CURRENTLY UNDER DEVELOPMENT!!!","category":"page"},{"location":"","page":"HOME","title":"HOME","text":"By : Christian O. Bernal Zelaya & Volodymyr M. Minin.","category":"page"},{"location":"#Introduction","page":"HOME","title":"Introduction","text":"","category":"section"},{"location":"","page":"HOME","title":"HOME","text":"UCIWWEIHR.jl is a Julia package for forecasting and nowcasting COVID-19 hospitalizations using pathogen genome concentrations. UCIWWEIHR.jl Package License","category":"page"},{"location":"#Features","page":"HOME","title":"Features","text":"","category":"section"},{"location":"","page":"HOME","title":"HOME","text":"Comprehensive library of Bayesian models\nSimulation of infectious disease \nModel calibration\nSensitivity analysis and uncertainty quantification?\nVisualization of results and MCMC evaluations(live?)","category":"page"},{"location":"#Installation","page":"HOME","title":"Installation","text":"","category":"section"},{"location":"","page":"HOME","title":"HOME","text":"To install UCIWWEIHR.jl, you can use the Julia package manager. Open the Julia REPL and run the following command:","category":"page"},{"location":"","page":"HOME","title":"HOME","text":"using Pkg\nPkg.add(\"https://github.com/cbernalz/UCIWWEIHR.jl.git\")","category":"page"}] +[{"location":"tutorial_index/#tutorial_home","page":"TUTORIAL CONTENTS","title":"Tutorial Contents","text":"","category":"section"},{"location":"tutorial_index/","page":"TUTORIAL CONTENTS","title":"TUTORIAL CONTENTS","text":"Future Description.","category":"page"},{"location":"tutorial_index/#Contents","page":"TUTORIAL CONTENTS","title":"Contents","text":"","category":"section"},{"location":"tutorial_index/","page":"TUTORIAL CONTENTS","title":"TUTORIAL CONTENTS","text":"Getting Started\nGenerating simulated data with UCIWWEIHR ODE compartmental based model.\nGenerating simulated data with an agent based model.\nGenerating posterior distribution samples with UCIWWEIHR ODE compartmental based model without forecasting.\nGenerating posterior distribution samples with UCIWWEIHR ODE compartmental based model with forecasting.\nGenerating repeated forecasts using the UCIWWEIHR model.","category":"page"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/","page":"UCIWWEIHR REPEATED FORECASTING","title":"UCIWWEIHR REPEATED FORECASTING","text":"using Plots, StatsPlots; gr()\nPlots.reset_defaults()\n","category":"page"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/#uciwwiehr_model_repeated_forecasts","page":"UCIWWEIHR REPEATED FORECASTING","title":"Generating Repeated Forecasts Using the UCIWWEIHR model.","text":"","category":"section"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/","page":"UCIWWEIHR REPEATED FORECASTING","title":"UCIWWEIHR REPEATED FORECASTING","text":"Here we show how we can construct repeated forecasts using the UCIWWEIHR model. We start with generating out data using generate_simulation_data_uciwweihr's alternate parameterization where we do prespecify the effective reproduction number and hospitalization probability. ","category":"page"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/#1.-Data-Generation.","page":"UCIWWEIHR REPEATED FORECASTING","title":"1. Data Generation.","text":"","category":"section"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/","page":"UCIWWEIHR REPEATED FORECASTING","title":"UCIWWEIHR REPEATED FORECASTING","text":"Here we simulate a dataset, one with 175 time points. ","category":"page"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/","page":"UCIWWEIHR REPEATED FORECASTING","title":"UCIWWEIHR REPEATED FORECASTING","text":"using UCIWWEIHR\n# Running simulation function with presets\nrt_custom = vcat(\n range(1, stop=1.8, length=7*4),\n fill(1.8, 7*2),\n range(1.8, stop=1, length=7*8),\n range(0.98, stop=0.8, length=7*2),\n range(0.8, stop=1.1, length=7*6),\n range(1.1, stop=0.97, length=7*3)\n)\nw_custom = vcat(\n range(0.3, stop=0.38, length=7*5),\n fill(0.38, 7*2),\n range(0.38, stop=0.25, length=7*8),\n range(0.25, stop=0.28, length=7*2),\n range(0.28, stop=0.34, length=7*6),\n range(0.34, stop=0.28, length=7*2)\n)\nparams = create_uciwweihr_sim_params(\n time_points = length(rt_custom),\n Rt = rt_custom, \n w = w_custom\n)\ndf = generate_simulation_data_uciwweihr(params)\nfirst(df, 5)","category":"page"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/#2.-Constructing-Repeat-Forecasts.","page":"UCIWWEIHR REPEATED FORECASTING","title":"2. Constructing Repeat Forecasts.","text":"","category":"section"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/","page":"UCIWWEIHR REPEATED FORECASTING","title":"UCIWWEIHR REPEATED FORECASTING","text":"We use the repeated_forecast function to generate forecasts for a given number of weeks, for a given number of time points. Along with this we need to specify presets. Output of this function is an array with the first index controlling which result we are looking at. The next contains a uciwweihr_gq_pp output.","category":"page"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/","page":"UCIWWEIHR REPEATED FORECASTING","title":"UCIWWEIHR REPEATED FORECASTING","text":"data_hosp = df.hosp\ndata_wastewater = df.log_ww_conc\nobstimes_hosp = df.obstimes\nobstimes_wastewater = df.obstimes\nmax_obstime = max(length(obstimes_hosp), length(obstimes_wastewater))\nparam_change_times = 1:7:max_obstime # Change every week\npriors_only = false\nn_samples = 200\nn_forecast_weeks = 2\nforecast_points = [\n param_change_times[end-5],\n param_change_times[end-4],\n param_change_times[end-3],\n param_change_times[end-2]\n]\n\nmodel_params = create_uciwweihr_model_params()\n\nrep_results = repeated_forecast(\n data_hosp,\n data_wastewater,\n obstimes_hosp,\n obstimes_wastewater;\n n_samples = n_samples,\n params = model_params,\n n_forecast_weeks = 2,\n forecast_points = forecast_points\n)\n\nfirst(rep_results, 2)","category":"page"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/#3.-Visualizing-Results-Of-Repeated-Forecasts.","page":"UCIWWEIHR REPEATED FORECASTING","title":"3. Visualizing Results Of Repeated Forecasts.","text":"","category":"section"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/","page":"UCIWWEIHR REPEATED FORECASTING","title":"UCIWWEIHR REPEATED FORECASTING","text":"We can take a look at these forecasts using the uciwweihr_visualizer function. We can also add certain parameters to ensure we only see the plots we want.","category":"page"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/","page":"UCIWWEIHR REPEATED FORECASTING","title":"UCIWWEIHR REPEATED FORECASTING","text":"for res_index in 1:length(forecast_points)\n uciwweihr_visualizer(\n data_hosp, \n data_wastewater,\n n_forecast_weeks,\n obstimes_hosp,\n obstimes_wastewater,\n param_change_times,\n 2024,\n true,\n model_params;\n pp_samples = rep_results[res_index][2][1],\n gq_samples = rep_results[res_index][2][2],\n obs_data_hosp = data_hosp,\n obs_data_wastewater = data_wastewater, \n actual_rt_vals = df.rt, \n actual_w_t = df.wt, \n actual_non_time_varying_vals = params,\n bayes_dist_type = \"Posterior\",\n mcmcdaigs = false,\n time_varying_plots = false,\n non_time_varying_plots = false,\n pred_param_plots = true,\n save_plots = true,\n plot_name_to_save_pred_param = \"mcmc_pred_parameter_plots_rep_res\"*string(res_index)\n )\nend","category":"page"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/#3.1.-Forecast-Point-1.","page":"UCIWWEIHR REPEATED FORECASTING","title":"3.1. Forecast Point 1.","text":"","category":"section"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/","page":"UCIWWEIHR REPEATED FORECASTING","title":"UCIWWEIHR REPEATED FORECASTING","text":"(Image: Plot 1)","category":"page"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/#3.2.-Forecast-Point-2.","page":"UCIWWEIHR REPEATED FORECASTING","title":"3.2. Forecast Point 2.","text":"","category":"section"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/","page":"UCIWWEIHR REPEATED FORECASTING","title":"UCIWWEIHR REPEATED FORECASTING","text":"(Image: Plot 2)","category":"page"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/#3.3.-Forecast-Point-3.","page":"UCIWWEIHR REPEATED FORECASTING","title":"3.3. Forecast Point 3.","text":"","category":"section"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/","page":"UCIWWEIHR REPEATED FORECASTING","title":"UCIWWEIHR REPEATED FORECASTING","text":"(Image: Plot 3)","category":"page"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/#3.4.-Forecast-Point-4.","page":"UCIWWEIHR REPEATED FORECASTING","title":"3.4. Forecast Point 4.","text":"","category":"section"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/","page":"UCIWWEIHR REPEATED FORECASTING","title":"UCIWWEIHR REPEATED FORECASTING","text":"(Image: Plot 4)","category":"page"},{"location":"tutorials/uciwweihr_model_repeated_forecasts/#[Tutorial-Contents](@ref-tutorial_home)","page":"UCIWWEIHR REPEATED FORECASTING","title":"Tutorial Contents","text":"","category":"section"},{"location":"license/#license","page":"LICENSE","title":"UCIWWEIHR.jl Package License","text":"","category":"section"},{"location":"license/","page":"LICENSE","title":"LICENSE","text":"The UCIWWEIHR.jl package is licensed under the MIT License.","category":"page"},{"location":"license/#MIT-License","page":"LICENSE","title":"MIT License","text":"","category":"section"},{"location":"license/","page":"LICENSE","title":"LICENSE","text":"MIT License","category":"page"},{"location":"license/","page":"LICENSE","title":"LICENSE","text":"Copyright (c) 2024 Christian O. Bernal Zelaya","category":"page"},{"location":"license/","page":"LICENSE","title":"LICENSE","text":"Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:","category":"page"},{"location":"license/","page":"LICENSE","title":"LICENSE","text":"The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.","category":"page"},{"location":"license/","page":"LICENSE","title":"LICENSE","text":"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"using Plots, StatsPlots; gr()\nPlots.reset_defaults()\n","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#uciwwiehr_model_fitting_with_forecast","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"Generating Posterior Distribution Samples with UCIWWEIHR ODE Compartmental Based Model with Forecasting.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"Here we extend the previous tutorial to include forecasting capabilities. We start with generating out data using generate_simulation_data_uciwweihr's alternate parameterization where we do not prespecify the effective reproduction number and hospitalization probability but instead preform a log-normal random walk and a logit-normal random walk respectively. We then sample from the posterior distribution using the uciwweihr_fit.jl function. We then generate desired quantities and forecast for a given time period with the posterior predictive distribution, using uciwweihr_gq_pp.jl.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#1.-Data-Generation.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"1. Data Generation.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"Here we generate two datasets, one with 150 time points and one with 178 time points. We will use the 150 time point dataset for fitting and the 178 time point dataset for forecast evaluation.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"using UCIWWEIHR\n# Running simulation function with presets\nparams = create_uciwweihr_sim_params(\n time_points = 150\n)\ndf = generate_simulation_data_uciwweihr(params)\n\nparams_ext = create_uciwweihr_sim_params(\n time_points = 178\n)\ndf_ext = generate_simulation_data_uciwweihr(params_ext)\nfirst(df, 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"first(df_ext, 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#2.-Sampling-from-the-Posterior-Distribution-and-Posterior-Predictive-Distribution.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"2. Sampling from the Posterior Distribution and Posterior Predictive Distribution.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"Here we sample from the posterior distribution using the uciwweihr_fit.jl function. First, we setup some presets, where we need to use create_uciwweihr_model_params() to get default parameters for the model. Then we have an array where index 1 contains the posterior/prior predictive samples, index 2 contains the posterior/prior generated quantities samples, and index 3 contains the original sampled parameters for the model. The difference here is that we set forecast = true and forecast_weeks = 4 to forecast 4 weeks into the future. One other thing to note, is that we allow misalignment of hospital and wastewater data's observed times. For this tutorial, we use the same observed points.","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_hosp = df.obstimes\nobstimes_wastewater = df.obstimes\nmax_obstime = max(length(obstimes_hosp), length(obstimes_wastewater))\nparam_change_times = 1:7:max_obstime # Change every week\npriors_only = false\nn_samples = 200\nforecast = true\nforecast_weeks = 4\n\nmodel_params = create_uciwweihr_model_params()\nsamples = uciwweihr_fit(\n data_hosp,\n data_wastewater,\n obstimes_hosp,\n obstimes_wastewater;\n param_change_times,\n priors_only,\n n_samples,\n params = model_params\n)\nmodel_output = uciwweihr_gq_pp(\n samples,\n data_hosp,\n data_wastewater,\n obstimes_hosp,\n obstimes_wastewater;\n param_change_times = param_change_times,\n params = model_params,\n forecast = forecast,\n forecast_weeks = forecast_weeks\n)\n\nfirst(model_output[1][:,1:5], 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"first(model_output[2][:,1:5], 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"first(model_output[3][:,1:5], 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#3.-MCMC-Diagnostic-Plots/Results-Along-with-Posterior-Predictive-Distribution.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"3. MCMC Diagnostic Plots/Results Along with Posterior Predictive Distribution.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"We can again look at model diagnostics, posterior distribution of time or non-time varying parameters, and the posterior predictive distribution extended for forecasting. We can also add certain parameters to ensure priors will be plotted alongside their corresponding posteriors.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"uciwweihr_visualizer(\n data_hosp, \n data_wastewater,\n forecast_weeks,\n obstimes_hosp,\n obstimes_wastewater,\n param_change_times,\n 2024,\n forecast,\n model_params;\n pp_samples = model_output[1],\n gq_samples = model_output[2],\n obs_data_hosp = df_ext.hosp,\n obs_data_wastewater = df_ext.log_ww_conc, \n actual_rt_vals = df_ext.rt, \n actual_w_t = df_ext.wt, \n actual_non_time_varying_vals = params,\n bayes_dist_type = \"Posterior\",\n save_plots = true,\n plot_name_to_save_mcmcdiag = \"mcmc_diagnosis_plots1\",\n plot_name_to_save_time_varying = \"mcmc_time_varying_parameter_plots1\",\n plot_name_to_save_non_time_varying = \"mcmc_nontime_varying_parameter_plots1\",\n plot_name_to_save_pred_param = \"mcmc_pred_parameter_plots1\"\n)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#3.1.-MCMC-Diagnostic-Plots.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"3.1. MCMC Diagnostic Plots.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"(Image: Plot 1)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#3.2.-Time-Varying-Parameter-Results-Plot.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"3.2. Time Varying Parameter Results Plot.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"(Image: Plot 2)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#3.3.-Non-Time-Varying-Parameter-Results-Plot.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"3.3. Non-Time Varying Parameter Results Plot.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"(Image: Plot 3)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#3.4.-Posterior-Predictive-Distribution-Plot.","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"3.4. Posterior Predictive Distribution Plot.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"UCIWWEIHR FITTING MODEL W/ FORECASTING","text":"(Image: Plot 4)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_forecast/#[Tutorial-Contents](@ref-tutorial_home)","page":"UCIWWEIHR FITTING MODEL W/ FORECASTING","title":"Tutorial Contents","text":"","category":"section"},{"location":"tutorials/agent_based_simulation_data/#agent_based_simulation_data","page":"AGENT-BASED SIMULATION DATA","title":"Generating simulated data with an agent based model.","text":"","category":"section"},{"location":"tutorials/agent_based_simulation_data/","page":"AGENT-BASED SIMULATION DATA","title":"AGENT-BASED SIMULATION DATA","text":"This package provides a way to also simulate data using the agent based model in the future paper. The function called generate_simulation_data_agent.jl can be used to generate synthetic data for a given population size and features. Here we provide a demonstration using the default settings of generate_simulation_data_agent.jl :","category":"page"},{"location":"tutorials/agent_based_simulation_data/#1.-Functionality.","page":"AGENT-BASED SIMULATION DATA","title":"1. Functionality.","text":"","category":"section"},{"location":"tutorials/agent_based_simulation_data/","page":"AGENT-BASED SIMULATION DATA","title":"AGENT-BASED SIMULATION DATA","text":"using UCIWWEIHR\nusing Plots\n# Running simulation function with defaults\ndf = generate_simulation_data_agent()\nfirst(df, 5)","category":"page"},{"location":"tutorials/agent_based_simulation_data/#2.-Visualizing-SEIHR-compartments.","page":"AGENT-BASED SIMULATION DATA","title":"2. Visualizing SEIHR compartments.","text":"","category":"section"},{"location":"tutorials/agent_based_simulation_data/","page":"AGENT-BASED SIMULATION DATA","title":"AGENT-BASED SIMULATION DATA","text":"We can also use the Plots package to visualize the data generated.","category":"page"},{"location":"tutorials/agent_based_simulation_data/","page":"AGENT-BASED SIMULATION DATA","title":"AGENT-BASED SIMULATION DATA","text":"plot(df.Time, df.S, label = \"Suseptible\", \n xlabel = \"Time\", \n ylabel = \"Number of Individuals\", \n title = \"Agent Based Model Simulation Results\")\nplot!(df.Time, df.E, label = \"Exposed\")\nplot!(df.Time, df.I, label = \"Infected\")\nplot!(df.Time, df.H, label = \"Hospitalized\")\nplot!(df.Time, df.R, label = \"Recovered\")","category":"page"},{"location":"tutorials/agent_based_simulation_data/#[Tutorial-Contents](@ref-tutorial_home)","page":"AGENT-BASED SIMULATION DATA","title":"Tutorial Contents","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"using Plots, StatsPlots; gr()\nPlots.reset_defaults()\n","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#uciwwiehr_model_fitting_no_forecast","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"Generating Posterior Distribution Samples with UCIWWEIHR ODE Compartmental Based Model without Forecasting.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"This package has a way to sample from a posterior or prior that is defined in the future paper using the uciwweihr_fit.jl and uciwweihr_model.jl. We can then generate desired quantities and forecast for a given time period with the posterior predictive distribution, using uciwweihr_gq_pp.jl. We first generate data using the generate_simulation_data_uciwweihr function which is a non-mispecified version of the model, we will also be using prespecified effective reporduction curves and prespecified hospitalization probability curves.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#1.-Data-Generation.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"1. Data Generation.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"using UCIWWEIHR\n# Running simulation function with presets\nrt_custom = vcat(\n range(1, stop=1.8, length=7*4),\n fill(1.8, 7*2),\n range(1.8, stop=1, length=7*8),\n range(0.98, stop=0.8, length=7*2),\n range(0.8, stop=1.1, length=7*6),\n range(1.1, stop=0.97, length=7*3)\n)\nw_custom = vcat(\n range(0.3, stop=0.38, length=7*5),\n fill(0.38, 7*2),\n range(0.38, stop=0.25, length=7*8),\n range(0.25, stop=0.28, length=7*2),\n range(0.28, stop=0.34, length=7*6),\n range(0.34, stop=0.28, length=7*2)\n)\nparams = create_uciwweihr_sim_params(\n time_points = length(rt_custom),\n Rt = rt_custom, \n w = w_custom\n)\ndf = generate_simulation_data_uciwweihr(params)\nfirst(df, 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#2.-Sampling-from-the-Posterior-Distribution-and-Posterior-Predictive-Distribution.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"2. Sampling from the Posterior Distribution and Posterior Predictive Distribution.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"Here we sample from the posterior distribution using the uciwweihr_fit.jl function. First, we setup some presets, where we need to use create_uciwweihr_model_params() to get default parameters for the model. Then we have an array where index 1 contains the posterior/prior predictive samples, index 2 contains the posterior/prior generated quantities samples, and index 3 contains the original sampled parameters for the model. Again, we can allow misalignment of hospital and wastewater data's observed times. For this tutorial, we use the same observed points.","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_hosp = df.obstimes\nobstimes_wastewater = df.obstimes\nmax_obstime = max(length(obstimes_hosp), length(obstimes_wastewater))\nparam_change_times = 1:7:max_obstime # Change every week\npriors_only = false\nn_samples = 200\nforecast = false\nforecast_weeks = 0\n\nmodel_params = create_uciwweihr_model_params()\nsamples = uciwweihr_fit(\n data_hosp,\n data_wastewater,\n obstimes_hosp,\n obstimes_wastewater;\n param_change_times,\n priors_only,\n n_samples,\n params = model_params\n)\nmodel_output = uciwweihr_gq_pp(\n samples,\n data_hosp,\n data_wastewater,\n obstimes_hosp,\n obstimes_wastewater;\n param_change_times = param_change_times,\n params = model_params\n)\n\nfirst(model_output[1][:,1:5], 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"first(model_output[2][:,1:5], 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"first(model_output[3][:,1:5], 5)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#3.-MCMC-Diagnostic-Plots/Results-Along-with-Posterior-Predictive-Distribution.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"3. MCMC Diagnostic Plots/Results Along with Posterior Predictive Distribution.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"We also provide a very basic way to visualize some MCMC diagnostics along with effective sample sizes of desired generated quantities(does not include functionality for time-varying quantities). Along with this, we can also visualize the posterior predictive distribution with actual observed values, which can be used to examine forecasts generated by the model. We can also add certain parameters to ensure priors will be plotted alongside their corresponding posteriors.","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"uciwweihr_visualizer(\n data_hosp, \n data_wastewater,\n forecast_weeks,\n obstimes_hosp,\n obstimes_wastewater,\n param_change_times,\n 2024,\n forecast,\n model_params;\n pp_samples = model_output[1],\n gq_samples = model_output[2],\n obs_data_hosp = data_hosp,\n obs_data_wastewater = data_wastewater, \n actual_rt_vals = df.rt, \n actual_w_t = df.wt, \n actual_non_time_varying_vals = params,\n bayes_dist_type = \"Posterior\",\n save_plots = true\n)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#3.1.-MCMC-Diagnostic-Plots.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"3.1. MCMC Diagnostic Plots.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"(Image: Plot 1)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#3.2.-Time-Varying-Parameter-Results-Plot.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"3.2. Time Varying Parameter Results Plot.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"(Image: Plot 2)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#3.3.-Non-Time-Varying-Parameter-Results-Plot.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"3.3. Non-Time Varying Parameter Results Plot.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"(Image: Plot 3)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#3.4.-Posterior-Predictive-Distribution-Plot.","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"3.4. Posterior Predictive Distribution Plot.","text":"","category":"section"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","text":"(Image: Plot 4)","category":"page"},{"location":"tutorials/uciwwiehr_model_fitting_no_forecast/#[Tutorial-Contents](@ref-tutorial_home)","page":"UCIWWEIHR FITTING MODEL W/OUT FORECASTING","title":"Tutorial Contents","text":"","category":"section"},{"location":"tutorials/getting_started/#getting_started","page":"GETTING STARTED","title":"Getting Started","text":"","category":"section"},{"location":"tutorials/getting_started/","page":"GETTING STARTED","title":"GETTING STARTED","text":"Welcome to the Tutorials page for the UCIWWEIHR.jl project. This section provides step-by-step guides and examples to help you get started with using the package and understanding its features.","category":"page"},{"location":"tutorials/getting_started/#1.-Installation.","page":"GETTING STARTED","title":"1. Installation.","text":"","category":"section"},{"location":"tutorials/getting_started/","page":"GETTING STARTED","title":"GETTING STARTED","text":"To install the UCIWWEIHR.jl package, open the Julia REPL and run the following command:","category":"page"},{"location":"tutorials/getting_started/","page":"GETTING STARTED","title":"GETTING STARTED","text":"using Pkg\nPkg.add(\"https://github.com/cbernalz/UCIWWEIHR.jl.git\")","category":"page"},{"location":"tutorials/getting_started/#[Tutorial-Contents](@ref-tutorial_home)","page":"GETTING STARTED","title":"Tutorial Contents","text":"","category":"section"},{"location":"reference/#reference","page":"REFERENCE","title":"Reference","text":"","category":"section"},{"location":"reference/#Contents","page":"REFERENCE","title":"Contents","text":"","category":"section"},{"location":"reference/","page":"REFERENCE","title":"REFERENCE","text":"Pages = [\"reference.md\"]","category":"page"},{"location":"reference/#Index","page":"REFERENCE","title":"Index","text":"","category":"section"},{"location":"reference/","page":"REFERENCE","title":"REFERENCE","text":"Pages = [\"reference.md\"]","category":"page"},{"location":"reference/","page":"REFERENCE","title":"REFERENCE","text":"Modules = [UCIWWEIHR]","category":"page"},{"location":"reference/#UCIWWEIHR.uciwweihr_model_params","page":"REFERENCE","title":"UCIWWEIHR.uciwweihr_model_params","text":"uciwweihr_model_params\n\nStruct for holding parameters used in the UCIWWEIHR ODE compartmental model. Use create_uciwweihr_model_params to create an instance of this struct.\n\nFields\n\nE_init_sd::Float64=50.0: Standard deviation for the initial number of exposed individuals.\nE_init_mean::Int64=200: Mean for the initial number of exposed individuals.\nI_init_sd::Float64=20.0: Standard deviation for the initial number of infected individuals.\nI_init_mean::Int64=100: Mean for the initial number of infected individuals.\nH_init_sd::Float64=5.0: Standard deviation for the initial number of hospitalized individuals.\nH_init_mean::Int64=20: Mean for the initial number of hospitalized individuals.\ngamma_sd::Float64=0.02: Standard deviation for the rate of incubation.\nlog_gamma_mean::Float64=log(1/4): Mean for the rate of incubation on log scale.\nnu_sd::Float64=0.02: Standard deviation for the rate of leaving the infected compartment.\nlog_nu_mean::Float64=log(1/7): Mean for the rate of leaving the infected compartment on the log scale.\nepsilon_sd::Float64=0.02: Standard deviation for the rate of hospitalization recovery.\nlog_epsilon_mean::Float64=log(1/5): Mean for the rate of hospitalization recovery on the log scale.\nrho_gene_sd::Float64=0.02: Standard deviation for the rho prior.\nlog_rho_gene_mean::Float64=log(0.011): Mean for the row prior on log scale.\nsigma_wastewater::Float64=log(0.1): Standard deviation for the negative binomial distribution for wastewater data. Not infered.\nsigma_hosp::Float64=500.0: Standard deviation for the negative binomial distribution for hospital data. Not infered.\nRt_init_sd::Float64=0.3: Standard deviation for the initial value of the time-varying reproduction number.\nRt_init_mean::Float64=0.2: Mean for the initial value of the time-varying reproduction number.\nsigma_Rt_sd::Float64=0.2: Standard deviation for normal prior of log time-varying reproduction number standard deviation.\nsigma_Rt_mean::Float64=-3.0: Mean for normal prior of log time-varying reproduction number standard deviation.\nw_init_sd::Float64=0.1: Standard deviation for the initial value of the time-varying hospitalization rate.\nw_init_mean::Float64=log(0.35): Mean for the initial value of the time-varying hospitalization rate.\nsigma_w_sd::Float64=0.2: Standard deviation for normal prior of log time-varying hospitalization rate standard deviation.\nsigma_w_mean::Float64=-3.5: Mean for normal prior of time-varying hospitalization rate standard deviation.\n\n\n\n\n\n","category":"type"},{"location":"reference/#UCIWWEIHR.uciwweihr_sim_params","page":"REFERENCE","title":"UCIWWEIHR.uciwweihr_sim_params","text":"uciwweihr_sim_params\n\nStruct for holding parameters used in the UCIWWEIHR ODE compartmental model simulation. Use create_uciwweihr_sim_params to create an instance of this struct.\n\nFields\n\ntime_points::Int64: Number of time points for the simulation.\nseed::Int64: Seed for random number generation.\nE_init::Int64: Initial number of exposed individuals.\nI_init::Int64: Initial number of infected individuals.\nH_init::Int64: Initial number of hospitalized individuals.\ngamma::Float64: Rate of incubation.\nnu::Float64: Rate of leaving the infected compartment.\nepsilon::Float64: Rate of hospitalization recovery.\nrho_gene::Float64: Contribution of infected individual's pathogen genome into wastewater.\ntau::Float64: Scale/variation of the log concentration of pathogen genome in wastewater.\ndf::Float64: Degrees of freedom for generalized t-distribution for log concentration of pathogen genome in wastewater.\nsigma_hosp::Float64: Standard deviation for the negative binomial distribution for hospital data.\nRt::Union{Float64, Vector{Float64}}: Initial value or time series of the time-varying reproduction number.\nsigma_Rt::Float64: Standard deviation for random walk of time-varying reproduction number.\nw::Union{Float64, Vector{Float64}}: Initial value or time series of the time-varying hospitalization rate.\nsigma_w::Float64: Standard deviation for random walk of time-varying hospitalization rate.\nrt_init::Float64: Initial value of the time-varying reproduction number, NOT USER SPECIFIED create_uciwweihr_params TAKES CARE OF THIS.\nw_init::Float64: Initial value of the time-varying hospitalization rate, NOT USER SPECIFIED create_uciwweihr_params TAKES CARE OF THIS.\n\n\n\n\n\n","category":"type"},{"location":"reference/#UCIWWEIHR.ChainsCustomIndex-Tuple{MCMCChains.Chains, BitMatrix}","page":"REFERENCE","title":"UCIWWEIHR.ChainsCustomIndex","text":"ChainsCustomIndex(c::Chains, indices_to_keep::BitMatrix)\n\nReduce Chains object to only wanted indices. \n\nFunction created by Damon Bayer. \n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.NegativeBinomial2-Tuple{Any, Any}","page":"REFERENCE","title":"UCIWWEIHR.NegativeBinomial2","text":"Create a re-parametrized negative binomial distribution in terms of mean and overdispersion.\n\nArguments\n\nμ: Mean of the distribution.\nϕ: Overdispersion parameter.\n\nReturns\n\nA Distributions.NegativeBinomial distribution object.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.calculate_quantiles-NTuple{4, Any}","page":"REFERENCE","title":"UCIWWEIHR.calculate_quantiles","text":"calculate_quantiles(df, chain, var_prefix, quantiles)\n\nCalculate quantiles for a given chain and variable prefix. Quantiles can be any user desired quantile.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.create_uciwweihr_model_params-Tuple{}","page":"REFERENCE","title":"UCIWWEIHR.create_uciwweihr_model_params","text":"create_uciwweihr_model_params(; kwargs...)\n\nCreates a uciwweihr_sim_params struct with the option to either use a predetermined Rt and w or generate them as random walks.\n\nArguments\n\nkwargs...: Named arguments corresponding to the fields in uciwweihr_sim_params.\n\nReturns\n\nparams::uciwweihr_sim_params: A struct with simulation parameters.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.create_uciwweihr_sim_params-Tuple{}","page":"REFERENCE","title":"UCIWWEIHR.create_uciwweihr_sim_params","text":"createuciwweihrsim_params(; kwargs...)\n\nCreates a uciwweihr_sim_params struct with the option to either use a predetermined Rt and w or generate them as random walks.\n\nArguments\n\nkwargs...: Named arguments corresponding to the fields in uciwweihr_sim_params.\n\nReturns\n\nparams::uciwweihr_sim_params: A struct with simulation parameters.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.eihr_ode!-NTuple{4, Any}","page":"REFERENCE","title":"UCIWWEIHR.eihr_ode!","text":"eihr_ode!(du, u, p, t)\n\nCalculate the ordinary differential equations (ODEs) for the EIHR model.\n\nParameters:\n\ndu: Array{Float64,1} - The derivative of the state variables.\nu: Array{Float64,1} - The current state variables.\np: Tuple{Float64,Float64,Float64,Float64,Float64} - The model parameters (alpha, gamma, nu, w, epsilon).\nt: Float64 - The current time.\n\nReturns:\n\ndu: Array{Float64,1} - The derivative of the state variables.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.generate_colors-Tuple{Any}","page":"REFERENCE","title":"UCIWWEIHR.generate_colors","text":"generate_ribbon_colors(number_of_colors)\n\nGenerates a vector with colors for ribbons in plots.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.generate_logit_normal_random_walk-Tuple{Int64, Float64, Float64, Any}","page":"REFERENCE","title":"UCIWWEIHR.generate_logit_normal_random_walk","text":"generate_logit_normal_random_walk(time_points::Int64, sigma::Float64, init_val::Float64)\n\nGenerates a logit-normal random walk time series.\n\nArguments\n\ntime_points::Int64: Number of time points.\nsigma::Float64: Standard deviation of the random walk in logit space.\ninit_val::Float64: Initial value of the random walk on the probability scale.\n\nReturns\n\nwalk::Vector{Float64}: Generated random walk on the probability scale.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.generate_random_walk-Tuple{Int64, Float64, Float64, Any}","page":"REFERENCE","title":"UCIWWEIHR.generate_random_walk","text":"generate_random_walk(time_points::Int64, sigma::Float64, init_val::Float64)\n\nGenerates a random walk time series.\n\nArguments\n\ntime_points::Int64: Number of time points.\nsigma::Float64: Standard deviation of the random walk.\ninit_val::Float64: Initial value of the random walk.\n\nReturns\n\nwalk::Vector{Float64}: Generated random walk.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.generate_simulation_data_agent","page":"REFERENCE","title":"UCIWWEIHR.generate_simulation_data_agent","text":"Generating Simulation Data for Agent Based Model\n\nTo generate simulation data using the agent based model, you can use the generate_simulation_data_agent function defined in the UCIWWEIHR.jl package. This function allows you to customize various parameters for the simulation. NOT FINISHED, STILL NEEDS WW AND RT\n\nFunction Signature\n\nArguments\n\nseed::Int64: Seed for random number generation. Default value is 1.\npop_size::Int64: Size of the population. Default value is 1000.\nI_init::Int64: Initial number of infected individuals. Default value is 200.\nH_init::Int64: Initial number of hospitalized individuals. Default value is 20.\nbeta::Float64: Transmission rate. Default value is 0.001.\ngamma::Float64: Rate of exposed individuals becoming infectious. Default value is 1/4.\nnu::Float64: Rate of infected individuals recovering or getting hospitalized. Default value is 1/7.\nepsilon::Float64: Rate of hospitalized individuals recovering. Default value is 1/5.\nw_init::Float64: Probability of an infected individual becoming hospitalized. Default value is 0.35.\n\nReturns\n\ndf::DataFrame: A DataFrame containing the simulation data with columns Time, S, E, I, H, and R.\n\n\n\n\n\n","category":"function"},{"location":"reference/#UCIWWEIHR.generate_simulation_data_uciwweihr-Tuple{uciwweihr_sim_params}","page":"REFERENCE","title":"UCIWWEIHR.generate_simulation_data_uciwweihr","text":"generate_simulation_data(params::UCIWWEIHRParams)\n\nGenerates simulation data for the UCIWWEIHR ODE compartmental model.\n\nArguments\n\nparams::uciwweihr_sim_params: Struct containing parameters for the simulation.\n\nReturns\n\ndf::DataFrame: A DataFrame containing the simulation data with columns obstimes, log_ww_conc, hosp, rt, and wt.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.is_time_varying_above_n-Tuple{Symbol, Int64}","page":"REFERENCE","title":"UCIWWEIHR.is_time_varying_above_n","text":"is_time_varying_above_n(name, n)\n\nChecks if the time varying parameter is above a given time point.\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{uciwweihr_model_params, Vararg{Any, 6}}","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\nbuild_params::uciwweihr_model_params: A struct of model parameters used to build gq_samples, used only if user desired priors next to posteriors.\ndata_hosp: Hospitalization data, used only if user desired priors next to posteriors.\ndata_wastewater: Wastewater data, if model does not use this do not specify this, if user desires priors next to plot (do not specify if you do not want prior plots).\nobstimes_hosp: An array of time points for hospital data, used only if user desired priors next to posteriors.\nobstimes_wastewater: An array of time points for wastewater data, used only if user desired priors next to posteriors.\nparam_change_times: An array of time points where the parameters change, used only if user desired priors next to posteriors.\nseed: An integer to set the seed for reproducibility, used only if user desired priors next to posteriors.\nforecast: A boolean to indicate if user wants to forecast, used only if user desired priors next to posteriors.\nforecast_weeks: An integer to indicate the number of weeks to forecast, used only if user desired priors next to posteriors.\ngq_samples: Generated quantities samples from the posterior/prior distribution, index 2 in uciwweihrgqpp output.\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\"]\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.repeated_forecast-NTuple{4, Any}","page":"REFERENCE","title":"UCIWWEIHR.repeated_forecast","text":"repeated_forecast(...)\n\nThis is the function to make repreated forecast for a given forecast time span, n_forecast_weeks, and for given time points, forecast_points. Plots can be made for these forecasts. The output is an array of uciwweihr_gq_pp results for each forecast_points.\n\nArguments\n\ndata_hosp: The hospitalization data.\ndata_wastewater: The wastewater data.\nobstimes_hosp: The time points for the hospitalization data.\nobstimes_wastewater: The time points for the wastewater data.\nn_samples: The number of samples to draw from the posterior.\nparam_change_times: The time points where the parameters change.\nparams::uciwweihr_model_params: The model parameters.\nn_forecast_weeks: The number of weeks to forecast.\nforecast_points: The time points to forecast, thees points should be present in obstimes_hosp.\n\nReturns\n\nAn array of uciwweihr_gq_pp resuts and timeseries used for building for each forecast_points.\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.uciwweihr_fit-NTuple{4, Any}","page":"REFERENCE","title":"UCIWWEIHR.uciwweihr_fit","text":"uciwweihr_fit(...)\n\nThis is the sampler for the bayesian semi-parametric model for the wastewater EIHR compartmental model. The defaults for this fuction will follow those of the default simulation in generatesimulationdatawweihr.jl function.\n\nArguments\n\ndata_hosp: An array of hospital data.\ndata_wastewater: An array of pathogen genome concentration in localized wastewater data. If this is not avaliable, the model used will be one that only uses hospital data.\nobstimes: An array of timepoints for observed hosp/wastewater.\npriors_only::Bool=false: A boolean to indicate if only priors are to be sampled.\nn_samples::Int64=500: Number of samples to be drawn.\nn_chains::Int64=1: Number of chains to be run.\nseed::Int64=2024: Seed for the random number generator.\nparams::uciwweihr_model_params: A struct containing parameters for the model.\n\nReturns\n\nSamples from the posterior or prior distribution.\n\n\n\n\n\n","category":"method"},{"location":"reference/#UCIWWEIHR.uciwweihr_model-NTuple{4, Any}","page":"REFERENCE","title":"UCIWWEIHR.uciwweihr_model","text":"uciwweihr_model(...)\n\nThis is the bayesian semi-parametric model for the wastewater EIHR compartmental model. The defaults for this fuction will follow those of the default simulation in generatesimulationdatawweihr.jl function.\n\nArguments\n\ndata_hosp: An array of hospital data.\ndata_wastewater: An array of pathogen genome concentration in localized wastewater data. If this is not avaliable, the model used will be one that only uses hospital data.\nobstimes_hosp: An array of timepoints for observed hospital data.\nobstimes_wastewater: An array of timepoints for observed wastewater data.\nparam_change_times: An array of timepoints where the parameters change.\nparams::uciwweihr_model_params: A struct containing parameters for the model.\n\n\n\n\n\n","category":"method"},{"location":"tutorials/uciwweihr_simulation_data/#uciwweihr_simulation_data","page":"UCIWWEIHR SIMULATION DATA","title":"Generating simulated data with UCIWWEIHR ODE compartmental based model.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"This package provides a way to also simulate data using the UCIWWEIHR ODE compartmental based model specified in the future paper. The function called generate_simulation_data_uciwweihr.jl can be used to generate synthetic data for a given number of samples and features. Here we provide a demonstration using the default settings of generate_simulation_data_uciwweihr.jl :","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#1.-Functionality.","page":"UCIWWEIHR SIMULATION DATA","title":"1. Functionality.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"using UCIWWEIHR\nusing Plots\n# Running simulation function with defaults\nparams = create_uciwweihr_sim_params()\ndf = generate_simulation_data_uciwweihr(params)\nfirst(df, 5)","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#1.2-Visualizing-UCIWWEIHR-model-results.","page":"UCIWWEIHR SIMULATION DATA","title":"1.2 Visualizing UCIWWEIHR model results.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"Here we can make simple plots to visualize the data generated using the Plots package.","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#1.2.1.-Concentration-of-pathogen-genome-in-wastewater(WW).","page":"UCIWWEIHR SIMULATION DATA","title":"1.2.1. Concentration of pathogen genome in wastewater(WW).","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.log_ww_conc,\n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Conc. of Pathogen Genome in WW\", \n title=\"Plot of Conc. of Pathogen Genome in WW Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#1.2.2.-Hospitalizations.","page":"UCIWWEIHR SIMULATION DATA","title":"1.2.2. Hospitalizations.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.hosp, \n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Hosp\", \n title=\"Plot of Hosp Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#1.2.3.-Reproductive-number.","page":"UCIWWEIHR SIMULATION DATA","title":"1.2.3. Reproductive number.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.rt, \n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Rt\", \n title=\"Plot of Rt Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#1.2.4.-Hospitalization-rate.","page":"UCIWWEIHR SIMULATION DATA","title":"1.2.4. Hospitalization rate.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.wt, \n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Rt\", \n title=\"Plot of Hospitalization Rate Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#2.-Alternate-Functionality.","page":"UCIWWEIHR SIMULATION DATA","title":"2. Alternate Functionality.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"We can also use a prespecified effective repordcution number curve or a prespecified hospitaliation probability curve. Any combintation of presepcified or random walk curves can be used. Here we provide an example of using both a prespecified effective reproduction number curve and a prespecified hospitalization probability curve.","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"using UCIWWEIHR\nusing Plots\n# Running simulation function with prespecified Rt and hospitalization probability\nrt_custom = vcat(\n range(1, stop=1.8, length=7*4),\n fill(1.8, 7*2),\n range(1.8, stop=1, length=7*8),\n range(0.98, stop=0.8, length=7*2),\n range(0.8, stop=1.1, length=7*6),\n range(1.1, stop=0.97, length=7*3)\n)\nw_custom = vcat(\n range(0.3, stop=0.38, length=7*5),\n fill(0.38, 7*2),\n range(0.38, stop=0.25, length=7*8),\n range(0.25, stop=0.28, length=7*2),\n range(0.28, stop=0.34, length=7*6),\n range(0.34, stop=0.28, length=7*2)\n)\nparams = create_uciwweihr_sim_params(\n time_points = length(rt_custom),\n Rt = rt_custom, \n w = w_custom\n)\ndf = generate_simulation_data_uciwweihr(params)\nfirst(df, 5)","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#2.2-Visualizing-UCIWWEIHR-model-results.","page":"UCIWWEIHR SIMULATION DATA","title":"2.2 Visualizing UCIWWEIHR model results.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"We can visualize these results using the Plots package.","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#2.2.1.-Concentration-of-pathogen-genome-in-wastewater(WW).","page":"UCIWWEIHR SIMULATION DATA","title":"2.2.1. Concentration of pathogen genome in wastewater(WW).","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.log_ww_conc,\n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Conc. of Pathogen Genome in WW\", \n title=\"Plot of Conc. of Pathogen Genome in WW Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#2.2.2.-Hospitalizations.","page":"UCIWWEIHR SIMULATION DATA","title":"2.2.2. Hospitalizations.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.hosp, \n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Hosp\", \n title=\"Plot of Hosp Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#2.2.3.-Reproductive-number.","page":"UCIWWEIHR SIMULATION DATA","title":"2.2.3. Reproductive number.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.rt, \n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Rt\", \n title=\"Plot of Rt Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#2.2.4.-Hospitalization-rate.","page":"UCIWWEIHR SIMULATION DATA","title":"2.2.4. Hospitalization rate.","text":"","category":"section"},{"location":"tutorials/uciwweihr_simulation_data/","page":"UCIWWEIHR SIMULATION DATA","title":"UCIWWEIHR SIMULATION DATA","text":"plot(df.obstimes, df.wt, \n label=nothing,\n xlabel=\"Obstimes\", \n ylabel=\"Rt\", \n title=\"Plot of Hospitalization Rate Over Time\")","category":"page"},{"location":"tutorials/uciwweihr_simulation_data/#[Tutorial-Contents](@ref-tutorial_home)","page":"UCIWWEIHR SIMULATION DATA","title":"Tutorial Contents","text":"","category":"section"},{"location":"#UCIWWEIHR.jl","page":"HOME","title":"UCIWWEIHR.jl","text":"","category":"section"},{"location":"","page":"HOME","title":"HOME","text":"Welcome to the UCIWWEIHR.jl package documentation! CURRENTLY UNDER DEVELOPMENT!!!","category":"page"},{"location":"","page":"HOME","title":"HOME","text":"By : Christian O. Bernal Zelaya & Volodymyr M. Minin.","category":"page"},{"location":"#Introduction","page":"HOME","title":"Introduction","text":"","category":"section"},{"location":"","page":"HOME","title":"HOME","text":"UCIWWEIHR.jl is a Julia package for forecasting and nowcasting COVID-19 hospitalizations using pathogen genome concentrations. UCIWWEIHR.jl Package License","category":"page"},{"location":"#Features","page":"HOME","title":"Features","text":"","category":"section"},{"location":"","page":"HOME","title":"HOME","text":"Comprehensive library of Bayesian models\nSimulation of infectious disease \nModel calibration\nSensitivity analysis and uncertainty quantification?\nVisualization of results and MCMC evaluations(live?)","category":"page"},{"location":"#Installation","page":"HOME","title":"Installation","text":"","category":"section"},{"location":"","page":"HOME","title":"HOME","text":"To install UCIWWEIHR.jl, you can use the Julia package manager. Open the Julia REPL and run the following command:","category":"page"},{"location":"","page":"HOME","title":"HOME","text":"using Pkg\nPkg.add(\"https://github.com/cbernalz/UCIWWEIHR.jl.git\")","category":"page"}] } diff --git a/dev/tutorial_index/index.html b/dev/tutorial_index/index.html index 33ad9e2..d95d806 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/8f179c0b.svg b/dev/tutorials/agent_based_simulation_data/e827edc2.svg similarity index 87% rename from dev/tutorials/agent_based_simulation_data/8f179c0b.svg rename to dev/tutorials/agent_based_simulation_data/e827edc2.svg index 855b9d8..eeb65b1 100644 --- a/dev/tutorials/agent_based_simulation_data/8f179c0b.svg +++ b/dev/tutorials/agent_based_simulation_data/e827edc2.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 1fb725b..fe40c5a 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 d30d5c1..1fbcb0e 100644 --- a/dev/tutorials/getting_started/index.html +++ b/dev/tutorials/getting_started/index.html @@ -1,3 +1,3 @@ GETTING STARTED · UCIWWEIHR.jl

Getting Started

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

1. Installation.

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

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

Tutorial Contents

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

Tutorial Contents

diff --git a/dev/tutorials/plots/mcmc_diagnosis_plots.png b/dev/tutorials/plots/mcmc_diagnosis_plots.png index 0ad922c..f6630ac 100644 Binary files a/dev/tutorials/plots/mcmc_diagnosis_plots.png and b/dev/tutorials/plots/mcmc_diagnosis_plots.png differ diff --git a/dev/tutorials/plots/mcmc_diagnosis_plots1.png b/dev/tutorials/plots/mcmc_diagnosis_plots1.png index 4e3ea2d..367a252 100644 Binary files a/dev/tutorials/plots/mcmc_diagnosis_plots1.png and b/dev/tutorials/plots/mcmc_diagnosis_plots1.png differ diff --git a/dev/tutorials/plots/mcmc_nontime_varying_parameter_plots.png b/dev/tutorials/plots/mcmc_nontime_varying_parameter_plots.png index 7f55a0b..70f8fd5 100644 Binary files a/dev/tutorials/plots/mcmc_nontime_varying_parameter_plots.png and b/dev/tutorials/plots/mcmc_nontime_varying_parameter_plots.png differ diff --git a/dev/tutorials/plots/mcmc_nontime_varying_parameter_plots1.png b/dev/tutorials/plots/mcmc_nontime_varying_parameter_plots1.png index e1cdbbc..7b37dfa 100644 Binary files a/dev/tutorials/plots/mcmc_nontime_varying_parameter_plots1.png and b/dev/tutorials/plots/mcmc_nontime_varying_parameter_plots1.png differ diff --git a/dev/tutorials/plots/mcmc_pred_parameter_plots.png b/dev/tutorials/plots/mcmc_pred_parameter_plots.png index f6a86ad..af8b726 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 index 0400993..fdf292f 100644 Binary files a/dev/tutorials/plots/mcmc_pred_parameter_plots1.png and b/dev/tutorials/plots/mcmc_pred_parameter_plots1.png differ diff --git a/dev/tutorials/plots/mcmc_pred_parameter_plots_rep_res1.png b/dev/tutorials/plots/mcmc_pred_parameter_plots_rep_res1.png index 21585c6..5617cf1 100644 Binary files a/dev/tutorials/plots/mcmc_pred_parameter_plots_rep_res1.png and b/dev/tutorials/plots/mcmc_pred_parameter_plots_rep_res1.png differ diff --git a/dev/tutorials/plots/mcmc_pred_parameter_plots_rep_res2.png b/dev/tutorials/plots/mcmc_pred_parameter_plots_rep_res2.png index 4584b59..0bec02a 100644 Binary files a/dev/tutorials/plots/mcmc_pred_parameter_plots_rep_res2.png and b/dev/tutorials/plots/mcmc_pred_parameter_plots_rep_res2.png differ diff --git a/dev/tutorials/plots/mcmc_pred_parameter_plots_rep_res3.png b/dev/tutorials/plots/mcmc_pred_parameter_plots_rep_res3.png index eae4e69..5f60bac 100644 Binary files a/dev/tutorials/plots/mcmc_pred_parameter_plots_rep_res3.png and b/dev/tutorials/plots/mcmc_pred_parameter_plots_rep_res3.png differ diff --git a/dev/tutorials/plots/mcmc_pred_parameter_plots_rep_res4.png b/dev/tutorials/plots/mcmc_pred_parameter_plots_rep_res4.png index e3dea6e..b8c55d6 100644 Binary files a/dev/tutorials/plots/mcmc_pred_parameter_plots_rep_res4.png and b/dev/tutorials/plots/mcmc_pred_parameter_plots_rep_res4.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 7f877f9..6335b2f 100644 Binary files a/dev/tutorials/plots/mcmc_time_varying_parameter_plots.png and b/dev/tutorials/plots/mcmc_time_varying_parameter_plots.png differ diff --git a/dev/tutorials/plots/mcmc_time_varying_parameter_plots1.png b/dev/tutorials/plots/mcmc_time_varying_parameter_plots1.png index 9f1652e..8c6d499 100644 Binary files a/dev/tutorials/plots/mcmc_time_varying_parameter_plots1.png and b/dev/tutorials/plots/mcmc_time_varying_parameter_plots1.png differ diff --git a/dev/tutorials/uciwweihr_model_repeated_forecasts/index.html b/dev/tutorials/uciwweihr_model_repeated_forecasts/index.html index ce8bfdd..9cbb505 100644 --- a/dev/tutorials/uciwweihr_model_repeated_forecasts/index.html +++ b/dev/tutorials/uciwweihr_model_repeated_forecasts/index.html @@ -57,124 +57,124 @@ Row │ iteration chain Rt_params_non_centered[23] Rt_params_non_centered[24 ⋯ │ Int64 Int64 Float64 Float64 ⋯ ─────┼────────────────────────────────────────────────────────────────────────── - 1 │ 1 1 -1.20168 2.078 ⋯ - 2 │ 2 1 -1.20168 2.078 - 3 │ 3 1 -1.20168 2.078 - 4 │ 4 1 -1.20168 2.078 - 5 │ 5 1 -1.20168 2.078 ⋯ - 6 │ 6 1 -1.20168 2.078 - 7 │ 7 1 -1.20168 2.078 - 8 │ 8 1 -1.20168 2.078 + 1 │ 1 1 -0.041831 1.3231 ⋯ + 2 │ 2 1 -0.041831 1.3231 + 3 │ 3 1 -0.041831 1.3231 + 4 │ 4 1 -0.041831 1.3231 + 5 │ 5 1 -0.041831 1.3231 ⋯ + 6 │ 6 1 -0.041831 1.3231 + 7 │ 7 1 -0.041831 1.3231 + 8 │ 8 1 -0.041831 1.3231 ⋮ │ ⋮ ⋮ ⋮ ⋮ ⋱ - 194 │ 194 1 -1.20168 2.078 ⋯ - 195 │ 195 1 -1.20168 2.078 - 196 │ 196 1 -1.20168 2.078 - 197 │ 197 1 -1.20168 2.078 - 198 │ 198 1 -1.20168 2.078 ⋯ - 199 │ 199 1 -1.20168 2.078 - 200 │ 200 1 -1.20168 2.078 - 275 columns and 185 rows omitted, 200×355 DataFrame - Row │ iteration chain E_init I_init H_init alpha_t[1] alpha_t[2] a ⋯ - │ Int64 Int64 Float64 Float64 Float64 Float64 Float64 F ⋯ + 194 │ 194 1 -0.041831 1.3231 ⋯ + 195 │ 195 1 -0.041831 1.3231 + 196 │ 196 1 -0.041831 1.3231 + 197 │ 197 1 -0.041831 1.3231 + 198 │ 198 1 -0.041831 1.3231 ⋯ + 199 │ 199 1 -0.041831 1.3231 + 200 │ 200 1 -0.041831 1.3231 + 275 columns and 185 rows omitted, 200×352 DataFrame + Row │ iteration chain E_init I_init H_init alpha_t[1] alpha_t[2] ⋯ + │ Int64 Int64 Float64 Float64 Float64 Float64 Float64 ⋯ ─────┼────────────────────────────────────────────────────────────────────────── - 1 │ 1 1 169.465 95.3575 21.963 0.230009 0.227382 ⋯ - 2 │ 2 1 149.378 106.738 20.8758 0.241359 0.246613 - 3 │ 3 1 195.335 113.62 16.4748 0.156948 0.167438 - 4 │ 4 1 168.999 89.312 21.5984 0.231059 0.221553 - 5 │ 5 1 165.029 104.874 14.263 0.252154 0.250042 ⋯ - 6 │ 6 1 184.079 109.57 25.1833 0.165094 0.160726 - 7 │ 7 1 152.751 108.724 18.7822 0.186281 0.190371 - 8 │ 8 1 151.302 99.6661 19.8009 0.225218 0.238739 - ⋮ │ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋱ - 194 │ 194 1 231.389 65.9687 14.9549 0.155846 0.151153 ⋯ - 195 │ 195 1 253.612 68.7465 15.3167 0.161165 0.155845 - 196 │ 196 1 238.063 68.667 12.9899 0.169357 0.163278 - 197 │ 197 1 236.414 69.5342 13.633 0.167505 0.165084 - 198 │ 198 1 175.095 108.337 25.7404 0.192796 0.188676 ⋯ - 199 │ 199 1 223.807 92.2715 19.3544 0.134883 0.144279 - 200 │ 200 1 184.745 101.289 15.4049 0.15114 0.155964 - 348 columns and 185 rows omitted, 200×68 DataFrame + 1 │ 1 1 198.198 100.884 15.4308 0.112985 0.113609 ⋯ + 2 │ 2 1 185.535 96.1797 14.7671 0.121153 0.125493 + 3 │ 3 1 174.903 104.27 14.8886 0.129673 0.136627 + 4 │ 4 1 198.485 105.919 14.8098 0.118854 0.138218 + 5 │ 5 1 175.878 110.836 15.9382 0.103275 0.127201 ⋯ + 6 │ 6 1 202.349 114.424 15.9023 0.112224 0.174604 + 7 │ 7 1 183.334 110.45 15.4085 0.113232 0.169828 + 8 │ 8 1 222.856 91.3463 15.9191 0.125702 0.159786 + ⋮ │ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋱ + 194 │ 194 1 257.116 87.4943 9.86869 0.166077 0.131731 ⋯ + 195 │ 195 1 257.145 87.4793 9.86573 0.166079 0.131715 + 196 │ 196 1 257.135 87.4648 9.86589 0.166016 0.131639 + 197 │ 197 1 257.135 87.4648 9.86589 0.166016 0.131639 + 198 │ 198 1 256.939 87.6067 9.96119 0.167618 0.134579 ⋯ + 199 │ 199 1 246.499 86.4112 10.1079 0.16994 0.132896 + 200 │ 200 1 237.754 81.5766 13.3831 0.202127 0.161385 + 345 columns and 185 rows omitted, 200×65 DataFrame Row │ iteration chain E_init_non_centered I_init_non_centered H_init_non_ ⋯ │ Int64 Int64 Float64 Float64 Float64 ⋯ ─────┼────────────────────────────────────────────────────────────────────────── - 1 │ 101 1 -0.610693 -0.232124 0 ⋯ - 2 │ 102 1 -1.01244 0.3369 0 - 3 │ 103 1 -0.0933014 0.680987 -0 - 4 │ 104 1 -0.620011 -0.534398 0 - 5 │ 105 1 -0.699425 0.243715 -1 ⋯ - 6 │ 106 1 -0.318416 0.478499 1 - 7 │ 107 1 -0.944975 0.436188 -0 - 8 │ 108 1 -0.973968 -0.0166943 -0 + 1 │ 101 1 -0.036049 0.0442148 - ⋯ + 2 │ 102 1 -0.289293 -0.191017 - + 3 │ 103 1 -0.501942 0.213515 - + 4 │ 104 1 -0.0302918 0.295949 - + 5 │ 105 1 -0.48244 0.541785 - ⋯ + 6 │ 106 1 0.046977 0.721178 - + 7 │ 107 1 -0.333324 0.52252 - + 8 │ 108 1 0.457113 -0.432687 - ⋮ │ ⋮ ⋮ ⋮ ⋮ ⋮ ⋱ - 194 │ 294 1 0.627788 -1.70157 -1 ⋯ - 195 │ 295 1 1.07223 -1.56267 -0 - 196 │ 296 1 0.761269 -1.56665 -1 - 197 │ 297 1 0.728275 -1.52329 -1 - 198 │ 298 1 -0.498105 0.416861 1 ⋯ - 199 │ 299 1 0.476142 -0.386427 -0 - 200 │ 300 1 -0.305107 0.0644633 -0 - 64 columns and 185 rows omitted]] + 194 │ 294 1 1.14231 -0.625283 - ⋯ + 195 │ 295 1 1.14291 -0.626037 - + 196 │ 296 1 1.14269 -0.626758 - + 197 │ 297 1 1.14269 -0.626758 - + 198 │ 298 1 1.13878 -0.619663 - ⋯ + 199 │ 299 1 0.929978 -0.679439 - + 200 │ 300 1 0.755071 -0.921171 - + 61 columns and 185 rows omitted]] Vector[AbstractVector[[16, 27, 24, 23, 32, 23, 36, 26, 48, 39 … 1085, 1098, 1070, 1078, 1178, 953, 930, 1055, 1030, 980], [0.2716835956059569, 0.5174052288422613, 0.49894101469467933, 0.7647815324347761, 0.8142258870064067, 0.7077613914126195, 0.8128588736898072, 0.8367322730889285, 0.8560749310751792, 0.6766463204741437 … 4.058564761711565, 4.0017797643566135, 4.202732736555433, 3.9880441481014692, 4.0483358506660645, 4.039234892485207, 4.007779414594093, 3.9386981113856323, 3.9705884999161127, 3.7858012802598733], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10 … 132, 133, 134, 135, 136, 137, 138, 139, 140, 141], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10 … 132, 133, 134, 135, 136, 137, 138, 139, 140, 141], 1:1:21], DataFrames.DataFrame[200×292 DataFrame Row │ iteration chain Rt_params_non_centered[24] Rt_params_non_centered[25 ⋯ │ Int64 Int64 Float64 Float64 ⋯ ─────┼────────────────────────────────────────────────────────────────────────── - 1 │ 1 1 2.0783 1.0404 ⋯ - 2 │ 2 1 2.0783 1.0404 - 3 │ 3 1 2.0783 1.0404 - 4 │ 4 1 2.0783 1.0404 - 5 │ 5 1 2.0783 1.0404 ⋯ - 6 │ 6 1 2.0783 1.0404 - 7 │ 7 1 2.0783 1.0404 - 8 │ 8 1 2.0783 1.0404 + 1 │ 1 1 1.32313 -0.74005 ⋯ + 2 │ 2 1 1.32313 -0.74005 + 3 │ 3 1 1.32313 -0.74005 + 4 │ 4 1 1.32313 -0.74005 + 5 │ 5 1 1.32313 -0.74005 ⋯ + 6 │ 6 1 1.32313 -0.74005 + 7 │ 7 1 1.32313 -0.74005 + 8 │ 8 1 1.32313 -0.74005 ⋮ │ ⋮ ⋮ ⋮ ⋮ ⋱ - 194 │ 194 1 2.0783 1.0404 ⋯ - 195 │ 195 1 2.0783 1.0404 - 196 │ 196 1 2.0783 1.0404 - 197 │ 197 1 2.0783 1.0404 - 198 │ 198 1 2.0783 1.0404 ⋯ - 199 │ 199 1 2.0783 1.0404 - 200 │ 200 1 2.0783 1.0404 - 289 columns and 185 rows omitted, 200×372 DataFrame - Row │ iteration chain E_init I_init H_init alpha_t[1] alpha_t[2] ⋯ - │ Int64 Int64 Float64 Float64 Float64 Float64 Float64 ⋯ + 194 │ 194 1 1.32313 -0.74005 ⋯ + 195 │ 195 1 1.32313 -0.74005 + 196 │ 196 1 1.32313 -0.74005 + 197 │ 197 1 1.32313 -0.74005 + 198 │ 198 1 1.32313 -0.74005 ⋯ + 199 │ 199 1 1.32313 -0.74005 + 200 │ 200 1 1.32313 -0.74005 + 289 columns and 185 rows omitted, 200×369 DataFrame + Row │ iteration chain E_init I_init H_init alpha_t[1] alpha_t[2] a ⋯ + │ Int64 Int64 Float64 Float64 Float64 Float64 Float64 F ⋯ ─────┼────────────────────────────────────────────────────────────────────────── - 1 │ 1 1 256.831 75.5367 16.9062 0.163856 0.152263 ⋯ - 2 │ 2 1 160.711 101.259 21.6802 0.169934 0.182996 - 3 │ 3 1 264.149 82.9758 9.87589 0.112501 0.101634 - 4 │ 4 1 145.524 113.171 25.5939 0.211608 0.223696 - 5 │ 5 1 219.181 87.915 15.6152 0.151958 0.168163 ⋯ - 6 │ 6 1 211.493 87.161 22.2602 0.172782 0.15451 - 7 │ 7 1 168.238 121.02 17.7138 0.158157 0.158181 - 8 │ 8 1 217.29 96.1772 12.1103 0.169666 0.16237 - ⋮ │ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋱ - 194 │ 194 1 191.73 89.0402 16.3491 0.198559 0.229189 ⋯ - 195 │ 195 1 177.743 102.054 21.4377 0.179613 0.16283 - 196 │ 196 1 243.43 78.4583 20.3058 0.177649 0.194307 - 197 │ 197 1 176.464 90.1539 20.73 0.182162 0.130777 - 198 │ 198 1 242.334 81.0386 19.8854 0.202756 0.153096 ⋯ - 199 │ 199 1 161.291 140.897 15.5753 0.128871 0.143681 - 200 │ 200 1 194.918 78.5982 18.028 0.254432 0.219737 - 365 columns and 185 rows omitted, 200×70 DataFrame + 1 │ 1 1 185.466 93.4179 13.4696 0.288082 0.265974 ⋯ + 2 │ 2 1 160.551 93.952 17.2148 0.283735 0.289586 + 3 │ 3 1 137.107 98.3958 18.053 0.278471 0.333659 + 4 │ 4 1 128.918 103.15 18.6518 0.254044 0.302873 + 5 │ 5 1 144.884 104.883 18.4893 0.231445 0.255191 ⋯ + 6 │ 6 1 157.982 101.486 17.4236 0.21621 0.257733 + 7 │ 7 1 155.212 99.3892 17.7361 0.227866 0.263952 + 8 │ 8 1 158.584 95.7432 17.5043 0.243849 0.31437 + ⋮ │ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋱ + 194 │ 194 1 223.474 82.9762 17.9835 0.259084 0.127035 ⋯ + 195 │ 195 1 222.342 82.0706 17.8516 0.266064 0.12571 + 196 │ 196 1 222.16 82.2132 17.9225 0.266327 0.124988 + 197 │ 197 1 222.434 82.5502 17.9248 0.267778 0.125736 + 198 │ 198 1 222.779 81.5989 17.827 0.264731 0.124751 ⋯ + 199 │ 199 1 223.659 81.9988 17.6033 0.267315 0.128908 + 200 │ 200 1 247.08 77.5757 17.7427 0.250586 0.106419 + 362 columns and 185 rows omitted, 200×67 DataFrame Row │ iteration chain E_init_non_centered I_init_non_centered H_init_non_ ⋯ │ Int64 Int64 Float64 Float64 Float64 ⋯ ─────┼────────────────────────────────────────────────────────────────────────── - 1 │ 101 1 1.13661 -1.22317 -0 ⋯ - 2 │ 102 1 -0.78577 0.0629586 0 - 3 │ 103 1 1.28298 -0.85121 -2 - 4 │ 104 1 -1.08953 0.658552 1 - 5 │ 105 1 0.38362 -0.604251 -0 ⋯ - 6 │ 106 1 0.229853 -0.64195 0 - 7 │ 107 1 -0.635236 1.05098 -0 - 8 │ 108 1 0.345803 -0.191138 -1 + 1 │ 101 1 -0.290674 -0.329107 - ⋯ + 2 │ 102 1 -0.788971 -0.302402 - + 3 │ 103 1 -1.25786 -0.0802085 - + 4 │ 104 1 -1.42165 0.15751 - + 5 │ 105 1 -1.10231 0.24413 - ⋯ + 6 │ 106 1 -0.84035 0.0743238 - + 7 │ 107 1 -0.89576 -0.0305412 - + 8 │ 108 1 -0.828324 -0.212838 - ⋮ │ ⋮ ⋮ ⋮ ⋮ ⋮ ⋱ - 194 │ 294 1 -0.165405 -0.547988 -0 ⋯ - 195 │ 295 1 -0.445148 0.102678 0 - 196 │ 296 1 0.868608 -1.07708 0 - 197 │ 297 1 -0.470721 -0.492306 0 - 198 │ 298 1 0.846682 -0.948072 -0 ⋯ - 199 │ 299 1 -0.774181 2.04486 -0 - 200 │ 300 1 -0.101642 -1.07009 -0 - 66 columns and 185 rows omitted]]

3. Visualizing Results Of Repeated Forecasts.

We can take a look at these forecasts using the uciwweihr_visualizer function. We can also add certain parameters to ensure we only see the plots we want.

for res_index in 1:length(forecast_points)
+ 194 │       294      1            0.469486            -0.851191             - ⋯
+ 195 │       295      1            0.446846            -0.896471             -
+ 196 │       296      1            0.443193            -0.889338             -
+ 197 │       297      1            0.448686            -0.872492             -
+ 198 │       298      1            0.455574            -0.920054             - ⋯
+ 199 │       299      1            0.473188            -0.900061             -
+ 200 │       300      1            0.941592            -1.12122              -
+                                                 63 columns and 185 rows omitted]]

3. Visualizing Results Of Repeated Forecasts.

We can take a look at these forecasts using the uciwweihr_visualizer function. We can also add certain parameters to ensure we only see the plots we want.

for res_index in 1:length(forecast_points)
     uciwweihr_visualizer(
         data_hosp,
         data_wastewater,
@@ -215,4 +215,4 @@
 MCMC Diagnostics Plots are not requested.
 MCMC time varying parameter results are not requested.
 MCMC non-time varying parameter results are not requested.
-Plot saved to plots/mcmc_pred_parameter_plots_rep_res4.png

3.1. Forecast Point 1.

Plot 1

3.2. Forecast Point 2.

Plot 2

3.3. Forecast Point 3.

Plot 3

3.4. Forecast Point 4.

Plot 4

Tutorial Contents

+Plot saved to plots/mcmc_pred_parameter_plots_rep_res4.png

3.1. Forecast Point 1.

Plot 1

3.2. Forecast Point 2.

Plot 2

3.3. Forecast Point 3.

Plot 3

3.4. Forecast Point 4.

Plot 4

Tutorial Contents

diff --git a/dev/tutorials/uciwweihr_simulation_data/78a1658d.svg b/dev/tutorials/uciwweihr_simulation_data/1f63807b.svg similarity index 85% rename from dev/tutorials/uciwweihr_simulation_data/78a1658d.svg rename to dev/tutorials/uciwweihr_simulation_data/1f63807b.svg index 496190c..2bb3c24 100644 --- a/dev/tutorials/uciwweihr_simulation_data/78a1658d.svg +++ b/dev/tutorials/uciwweihr_simulation_data/1f63807b.svg @@ -1,41 +1,41 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/31c5fcda.svg b/dev/tutorials/uciwweihr_simulation_data/286f1eb4.svg similarity index 87% rename from dev/tutorials/uciwweihr_simulation_data/31c5fcda.svg rename to dev/tutorials/uciwweihr_simulation_data/286f1eb4.svg index f5ff652..bac0edb 100644 --- a/dev/tutorials/uciwweihr_simulation_data/31c5fcda.svg +++ b/dev/tutorials/uciwweihr_simulation_data/286f1eb4.svg @@ -1,39 +1,39 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/26e7b817.svg b/dev/tutorials/uciwweihr_simulation_data/2be2e446.svg similarity index 87% rename from dev/tutorials/uciwweihr_simulation_data/26e7b817.svg rename to dev/tutorials/uciwweihr_simulation_data/2be2e446.svg index be2ec57..bf4c835 100644 --- a/dev/tutorials/uciwweihr_simulation_data/26e7b817.svg +++ b/dev/tutorials/uciwweihr_simulation_data/2be2e446.svg @@ -1,41 +1,41 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/f878be13.svg b/dev/tutorials/uciwweihr_simulation_data/6396cdc5.svg similarity index 86% rename from dev/tutorials/uciwweihr_simulation_data/f878be13.svg rename to dev/tutorials/uciwweihr_simulation_data/6396cdc5.svg index 359dbbe..1937388 100644 --- a/dev/tutorials/uciwweihr_simulation_data/f878be13.svg +++ b/dev/tutorials/uciwweihr_simulation_data/6396cdc5.svg @@ -1,39 +1,39 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/60deadba.svg b/dev/tutorials/uciwweihr_simulation_data/71f90d5f.svg similarity index 87% rename from dev/tutorials/uciwweihr_simulation_data/60deadba.svg rename to dev/tutorials/uciwweihr_simulation_data/71f90d5f.svg index 213c8ae..ec7b8c7 100644 --- a/dev/tutorials/uciwweihr_simulation_data/60deadba.svg +++ b/dev/tutorials/uciwweihr_simulation_data/71f90d5f.svg @@ -1,39 +1,39 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/2a1346b0.svg b/dev/tutorials/uciwweihr_simulation_data/7e91b1fe.svg similarity index 87% rename from dev/tutorials/uciwweihr_simulation_data/2a1346b0.svg rename to dev/tutorials/uciwweihr_simulation_data/7e91b1fe.svg index 0e625bb..8022bdf 100644 --- a/dev/tutorials/uciwweihr_simulation_data/2a1346b0.svg +++ b/dev/tutorials/uciwweihr_simulation_data/7e91b1fe.svg @@ -1,43 +1,43 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/418ad40b.svg b/dev/tutorials/uciwweihr_simulation_data/95e79acf.svg similarity index 87% rename from dev/tutorials/uciwweihr_simulation_data/418ad40b.svg rename to dev/tutorials/uciwweihr_simulation_data/95e79acf.svg index bee0071..ddc2e87 100644 --- a/dev/tutorials/uciwweihr_simulation_data/418ad40b.svg +++ b/dev/tutorials/uciwweihr_simulation_data/95e79acf.svg @@ -1,39 +1,39 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/229ae7be.svg b/dev/tutorials/uciwweihr_simulation_data/f7ba540c.svg similarity index 87% rename from dev/tutorials/uciwweihr_simulation_data/229ae7be.svg rename to dev/tutorials/uciwweihr_simulation_data/f7ba540c.svg index 85886c3..c27088c 100644 --- a/dev/tutorials/uciwweihr_simulation_data/229ae7be.svg +++ b/dev/tutorials/uciwweihr_simulation_data/f7ba540c.svg @@ -1,39 +1,39 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/dev/tutorials/uciwweihr_simulation_data/index.html b/dev/tutorials/uciwweihr_simulation_data/index.html index 518aace..377bd7e 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 479954a..57fe7d3 100644 --- a/dev/tutorials/uciwwiehr_model_fitting_forecast/index.html +++ b/dev/tutorials/uciwwiehr_model_fitting_forecast/index.html @@ -44,7 +44,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
111233.55479.331422.9944
221201.816111.52617.3492
331231.87787.47125.2945
441221.34186.720923.0504
551227.50589.978218.8162
first(model_output[3][:,1:5], 5)
5×5 DataFrame
RowiterationchainE_init_non_centeredI_init_non_centeredH_init_non_centered
Int64Int64Float64Float64Float64
110110.671082-1.033430.598872
210210.0363160.576319-0.530151
310310.637538-0.6264521.05889
410410.42683-0.6639550.610081
510510.550107-0.50109-0.236761

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

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

uciwweihr_visualizer(
+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
111-0.7400520.631051-1.73773
221-0.7400520.631051-1.73773
331-0.7400520.631051-1.73773
441-0.7400520.631051-1.73773
551-0.7400520.631051-1.73773
first(model_output[2][:,1:5], 5)
5×5 DataFrame
RowiterationchainE_initI_initH_init
Int64Int64Float64Float64Float64
111218.40294.161321.7997
221223.088102.57117.9315
331229.77178.05922.7011
441191.911109.61815.3662
551209.63786.73226.2963
first(model_output[3][:,1:5], 5)
5×5 DataFrame
RowiterationchainE_init_non_centeredI_init_non_centeredH_init_non_centered
Int64Int64Float64Float64Float64
110110.368043-0.2919360.359946
210210.4617570.128528-0.413691
310310.595413-1.097050.540214
41041-0.1617820.480897-0.926751
510510.192742-0.6633981.25925

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

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

uciwweihr_visualizer(
     data_hosp,
     data_wastewater,
     forecast_weeks,
@@ -67,20 +67,17 @@
     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: 236.0
-Effective Sample Size for I_init for Chain 1: 334.0
-Effective Sample Size for H_init for Chain 1: 359.0
-Effective Sample Size for gamma for Chain 1: 125.0
-Effective Sample Size for nu for Chain 1: 215.0
-Effective Sample Size for epsilon for Chain 1: 150.0
-Effective Sample Size for rt_init for Chain 1: 163.0
-Effective Sample Size for w_init for Chain 1: 170.0
-Effective Sample Size for sigma_w for Chain 1: 65.0
-Effective Sample Size for sigma_Rt for Chain 1: 139.0
-Effective Sample Size for rho_gene for Chain 1: 111.0
-Effective Sample Size for tau for Chain 1: 145.0
-Effective Sample Size for df for Chain 1: 460.0
-Effective Sample Size for sigma_hosp for Chain 1: 248.0
+)
Effective Sample Size for E_init for Chain 1: 234.0
+Effective Sample Size for I_init for Chain 1: 283.0
+Effective Sample Size for H_init for Chain 1: 460.0
+Effective Sample Size for gamma for Chain 1: 170.0
+Effective Sample Size for nu for Chain 1: 159.0
+Effective Sample Size for epsilon for Chain 1: 206.0
+Effective Sample Size for rt_init for Chain 1: 195.0
+Effective Sample Size for w_init for Chain 1: 184.0
+Effective Sample Size for sigma_w for Chain 1: 176.0
+Effective Sample Size for sigma_Rt for Chain 1: 252.0
+Effective Sample Size for rho_gene for Chain 1: 228.0
 Plot saved to plots/mcmc_diagnosis_plots1.png
 Generating time varying parameter plots (with priors and with wastewater)...
 Using uciwweihr_model with wastewater!!!
@@ -100,4 +97,4 @@
 Sampling (1 threads) 100%|██████████████████████████████| Time: 0:00:00
 Using uciwweihr_model with wastewater!!!
 Plot saved to plots/mcmc_nontime_varying_parameter_plots1.png
-Plot saved to plots/mcmc_pred_parameter_plots1.png

3.1. MCMC Diagnostic Plots.

Plot 1

3.2. Time Varying Parameter Results Plot.

Plot 2

3.3. Non-Time Varying Parameter Results Plot.

Plot 3

3.4. Posterior Predictive Distribution Plot.

Plot 4

Tutorial Contents

+Plot saved to plots/mcmc_pred_parameter_plots1.png

3.1. MCMC Diagnostic Plots.

Plot 1

3.2. Time Varying Parameter Results Plot.

Plot 2

3.3. Non-Time Varying Parameter Results Plot.

Plot 3

3.4. Posterior Predictive Distribution Plot.

Plot 4

Tutorial Contents

diff --git a/dev/tutorials/uciwwiehr_model_fitting_no_forecast/index.html b/dev/tutorials/uciwwiehr_model_fitting_no_forecast/index.html index 5c8e31d..0e630c1 100644 --- a/dev/tutorials/uciwwiehr_model_fitting_no_forecast/index.html +++ b/dev/tutorials/uciwwiehr_model_fitting_no_forecast/index.html @@ -55,7 +55,7 @@ params = model_params ) -first(model_output[1][:,1:5], 5)
5×5 DataFrame
Rowiterationchaindata_wastewater[1]data_wastewater[2]data_wastewater[3]
Int64Int64Float64Float64Float64
1110.3463380.5790830.579577
2210.3228620.3161460.422632
3310.4072210.3158930.598174
4410.1566860.458380.601072
5510.4672640.5966850.403769
first(model_output[2][:,1:5], 5)
5×5 DataFrame
RowiterationchainE_initI_initH_init
Int64Int64Float64Float64Float64
111184.645102.10420.6551
221148.091105.41518.8636
331171.676107.12615.5598
441178.815101.42118.9034
551201.84193.980720.2438
first(model_output[3][:,1:5], 5)
5×5 DataFrame
RowiterationchainE_init_non_centeredI_init_non_centeredH_init_non_centered
Int64Int64Float64Float64Float64
11011-0.3070970.1052050.131012
21021-1.038170.270735-0.227275
31031-0.5664850.356307-0.888042
41041-0.4236940.0710276-0.219322
510510.0368155-0.3009640.0487528

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

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

uciwweihr_visualizer(
+first(model_output[1][:,1:5], 5)
5×5 DataFrame
Rowiterationchaindata_wastewater[1]data_wastewater[2]data_wastewater[3]
Int64Int64Float64Float64Float64
1110.05218480.4264580.457273
2210.2226650.391490.540492
3310.2358120.4210570.568437
4410.2180370.3821790.30116
5510.6017850.5498690.685098
first(model_output[2][:,1:5], 5)
5×5 DataFrame
RowiterationchainE_initI_initH_init
Int64Int64Float64Float64Float64
111199.39682.765713.7541
221219.97176.204514.8032
331204.11979.900814.6696
441176.91789.654118.9959
551188.72397.846120.0366
first(model_output[3][:,1:5], 5)
5×5 DataFrame
RowiterationchainE_init_non_centeredI_init_non_centeredH_init_non_centered
Int64Int64Float64Float64Float64
11011-0.0120857-0.861717-1.24918
210210.399416-1.18978-1.03937
310310.0823789-1.00496-1.06607
41041-0.461668-0.517294-0.200811
51051-0.225531-0.1076970.00732892

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

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

uciwweihr_visualizer(
     data_hosp,
     data_wastewater,
     forecast_weeks,
@@ -74,20 +74,17 @@
     actual_non_time_varying_vals = params,
     bayes_dist_type = "Posterior",
     save_plots = true
-)
Effective Sample Size for E_init for Chain 1: 78.0
-Effective Sample Size for I_init for Chain 1: 75.0
-Effective Sample Size for H_init for Chain 1: 86.0
-Effective Sample Size for gamma for Chain 1: 55.0
-Effective Sample Size for nu for Chain 1: 27.0
-Effective Sample Size for epsilon for Chain 1: 14.0
-Effective Sample Size for rt_init for Chain 1: 49.0
-Effective Sample Size for w_init for Chain 1: 54.0
-Effective Sample Size for sigma_w for Chain 1: 101.0
-Effective Sample Size for sigma_Rt for Chain 1: 72.0
-Effective Sample Size for rho_gene for Chain 1: 85.0
-Effective Sample Size for tau for Chain 1: 36.0
-Effective Sample Size for df for Chain 1: 213.0
-Effective Sample Size for sigma_hosp for Chain 1: 48.0
+)
Effective Sample Size for E_init for Chain 1: 59.0
+Effective Sample Size for I_init for Chain 1: 57.0
+Effective Sample Size for H_init for Chain 1: 150.0
+Effective Sample Size for gamma for Chain 1: 45.0
+Effective Sample Size for nu for Chain 1: 55.0
+Effective Sample Size for epsilon for Chain 1: 58.0
+Effective Sample Size for rt_init for Chain 1: 41.0
+Effective Sample Size for w_init for Chain 1: 48.0
+Effective Sample Size for sigma_w for Chain 1: 54.0
+Effective Sample Size for sigma_Rt for Chain 1: 49.0
+Effective Sample Size for rho_gene for Chain 1: 33.0
 Plot saved to plots/mcmc_diagnosis_plots.png
 Generating time varying parameter plots (with priors and with wastewater)...
 Using uciwweihr_model with wastewater!!!
@@ -107,4 +104,4 @@
 Sampling (1 threads) 100%|██████████████████████████████| Time: 0:00:00
 Using uciwweihr_model with wastewater!!!
 Plot saved to plots/mcmc_nontime_varying_parameter_plots.png
-Plot saved to plots/mcmc_pred_parameter_plots.png

3.1. MCMC Diagnostic Plots.

Plot 1

3.2. Time Varying Parameter Results Plot.

Plot 2

3.3. Non-Time Varying Parameter Results Plot.

Plot 3

3.4. Posterior Predictive Distribution Plot.

Plot 4

Tutorial Contents

+Plot saved to plots/mcmc_pred_parameter_plots.png

3.1. MCMC Diagnostic Plots.

Plot 1

3.2. Time Varying Parameter Results Plot.

Plot 2

3.3. Non-Time Varying Parameter Results Plot.

Plot 3

3.4. Posterior Predictive Distribution Plot.

Plot 4

Tutorial Contents