Skip to content

Commit

Permalink
2024-10-24 update : reverting model to see identifiability issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
cbernalz committed Oct 24, 2024
1 parent 77f9dee commit 66547e9
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 7 deletions.
22 changes: 20 additions & 2 deletions src/uciwweihr_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@ The defaults for this fuction will follow those of the default simulation in gen
epsilon_non_centered ~ Normal()
# Parameters for wastewater
rho_gene_non_centered ~ Normal() # gene detection rate

tau_non_centered ~ Normal() # for showing identifyability issue

# Parameters for hospital

sigma_hosp_non_centered ~ Normal() # for showing identifyability issue

# Non-constant Rt
Rt_params_non_centered ~ MvNormal(zeros(l_param_change_times + 2), I) # +2 for sigma and init
sigma_Rt_non_centered = Rt_params_non_centered[1]
Expand All @@ -67,7 +73,13 @@ The defaults for this fuction will follow those of the default simulation in gen
epsilon = exp(epsilon_non_centered * params.epsilon_sd + params.log_epsilon_mean)
# Parameters for wastewater
rho_gene = exp(rho_gene_non_centered * params.rho_gene_sd + params.log_rho_gene_mean)

tau = exp(tau_non_centered * params.tau_sd + params.log_tau_mean) # for showing identifyability issue

# Parameters for hospital

sigma_hosp = clamp.(sigma_hosp_non_centered * params.sigma_hosp_sd + params.sigma_hosp_mean, min_neg_bin_sigma, max_neg_bin_sigma) # for showing identifyability issue

# Non-constant Rt
Rt_init = exp(Rt_init_non_centered * params.Rt_init_sd + params.Rt_init_mean)
sigma_Rt = exp(sigma_Rt_non_centered * params.sigma_Rt_sd + params.sigma_Rt_mean)
Expand Down Expand Up @@ -120,10 +132,12 @@ The defaults for this fuction will follow those of the default simulation in gen
# E - 1 // I - 2 // H - 3 // R - 4
# Likelihood calculations------------
for i in 1:l_obs_ww
data_wastewater[i] ~ Normal(log_W_means[i], params.sigma_wastewater)
#data_wastewater[i] ~ Normal(log_W_means[i], params.sigma_wastewater)
data_wastewater[i] ~ Normal(log_W_means[i], tau)
end
for i in 1:l_obs_hosp
data_hosp[i] ~ NegativeBinomial2(H_means[i], params.sigma_hosp)
#data_hosp[i] ~ NegativeBinomial2(H_means[i], params.sigma_hosp)
data_hosp[i] ~ NegativeBinomial2(H_means[i], sigma_hosp)
end


Expand All @@ -147,6 +161,10 @@ The defaults for this fuction will follow those of the default simulation in gen
rt_vals = rt_vals,
sigma_Rt = sigma_Rt,
rho_gene = rho_gene,

tau = tau, # for showing identifyability issue
sigma_hosp = sigma_hosp, # for showing identifyability issue

H = H_means,
log_genes_mean = log_W_means,
rt_init = rt_init,
Expand Down
24 changes: 19 additions & 5 deletions src/uciwweihr_model_params.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,14 @@ struct uciwweihr_model_params
log_epsilon_mean::Float64
rho_gene_sd::Float64
log_rho_gene_mean::Float64
sigma_wastewater::Float64
sigma_hosp::Float64
#sigma_wastewater::Float64
#sigma_hosp::Float64

tau_sd::Float64
log_tau_mean::Float64
sigma_hosp_sd::Float64
sigma_hosp_mean::Float64

Rt_init_sd::Float64
Rt_init_mean::Float64
sigma_Rt_sd::Float64
Expand Down Expand Up @@ -75,8 +81,12 @@ function create_uciwweihr_model_params(;
nu_sd::Float64=0.02, log_nu_mean::Float64=log(1/7),
epsilon_sd::Float64=0.02, log_epsilon_mean::Float64=log(1/5),
rho_gene_sd::Float64=0.02, log_rho_gene_mean::Float64=log(0.011),
sigma_wastewater::Float64=0.1,
sigma_hosp::Float64=500.0,
#sigma_wastewater::Float64=0.1,
#sigma_hosp::Float64=500.0,

tau_sd::Float64=0.02, log_tau_mean::Float64=log(0.1),
sigma_hosp_sd::Float64=50.0, sigma_hosp_mean::Float64=500.0,

Rt_init_sd::Float64=0.3, Rt_init_mean::Float64=0.2,
sigma_Rt_sd::Float64=0.2, sigma_Rt_mean::Float64=-3.0,
w_init_sd::Float64=0.04, w_init_mean::Float64=logit(0.35),
Expand All @@ -92,7 +102,11 @@ function create_uciwweihr_model_params(;
nu_sd, log_nu_mean,
epsilon_sd, log_epsilon_mean,
rho_gene_sd, log_rho_gene_mean,
sigma_wastewater, sigma_hosp,
#sigma_wastewater, sigma_hosp,

tau_sd, log_tau_mean,
sigma_hosp_sd, sigma_hosp_mean,

Rt_init_sd, Rt_init_mean,
sigma_Rt_sd, sigma_Rt_mean,
w_init_sd, w_init_mean,
Expand Down
2 changes: 2 additions & 0 deletions src/uciwweihr_visualizer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ function uciwweihr_visualizer(
["gamma", "nu", "epsilon"],
["rt_init", "w_init"],
["sigma_w", "sigma_Rt"],
["tau", "sigma_hosp"], # For identifyability issue checking
["rho_gene"]
],
time_varying_params = ["rt_vals", "w_t"],
Expand Down Expand Up @@ -169,6 +170,7 @@ function uciwweihr_visualizer(
["gamma", "nu", "epsilon"],
["rt_init", "w_init"],
["sigma_w", "sigma_Rt"],
["tau", "sigma_hosp"], # For identifyability issue checking
["rho_gene"]
],
time_varying_params = ["rt_vals", "w_t"],
Expand Down

0 comments on commit 66547e9

Please sign in to comment.