Skip to content

Commit

Permalink
2024-11-25 update : fixing hosp only model.
Browse files Browse the repository at this point in the history
  • Loading branch information
cbernalz committed Nov 25, 2024
1 parent 91a02c9 commit fe48736
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/uciwweihr_gq_pp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ function uciwweihr_gq_pp(
return(results)
end


function uciwweihr_gq_pp(
samples,
data_hosp,
Expand All @@ -120,6 +121,7 @@ function uciwweihr_gq_pp(
return_bool::Bool=true,
gq_bool::Bool=true
)

println("Using uciwweihr_model without wastewater!!!")
obstimes_hosp = convert(Vector{Float64}, obstimes_hosp)
param_change_times = convert(Vector{Float64}, param_change_times)
Expand All @@ -139,11 +141,11 @@ function uciwweihr_gq_pp(
end

my_model = uciwweihr_model(
data_hosp,
data_hosp,
obstimes_hosp;
param_change_times,
params,
return_bool
return_bool# = true
)


Expand All @@ -154,34 +156,32 @@ function uciwweihr_gq_pp(
#gq_randn = Chains(generated_quantities(my_model, samples_randn))

my_model_forecast_missing = uciwweihr_model(
missing_data_hosp,
missing_data_hosp,
obstimes_hosp;
param_change_times,
params,
return_bool
return_bool# = true,
)


indices_to_keep = .!isnothing.(generated_quantities(my_model, samples))
samples_randn = ChainsCustomIndex(samples, indices_to_keep)


Random.seed!(seed)
predictive_randn = predict(my_model_forecast_missing, samples_randn)

samples_df = DataFrame(samples)

if gq_bool
indices_to_keep = .!isnothing.(generated_quantities(my_model, samples))
samples_randn = ChainsCustomIndex(samples, indices_to_keep)

Random.seed!(seed)
predictive_randn = predict(my_model_forecast_missing, samples_randn)
Random.seed!(seed)
println("Generating quantities...")
gq_randn = Chains(generated_quantities(my_model, samples_randn))
results = [DataFrame(predictive_randn), DataFrame(gq_randn), samples_df]
else
println("Not generating quantities...")
println("**result will only contain pp**")
Random.seed!(seed)
predictive_randn = predict(my_model_forecast_missing, samples)
results = [DataFrame(predictive_randn)]

end

return(results)
end
end

0 comments on commit fe48736

Please sign in to comment.