Skip to content

Commit

Permalink
fix generate_epiaware unit tests
Browse files Browse the repository at this point in the history
New usage of RW
  • Loading branch information
SamuelBrand1 committed Dec 2, 2024
1 parent 4a69ec4 commit a1f0790
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions EpiAware/test/EpiAwareUtils/generate_epiware.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
#Define the epi_model
epi_model = DirectInfections(data, Normal())

#Define the latent process model
rwp = RandomWalk(Normal(0.0, 1.0),
truncated(Normal(0.0, 0.05), 0.0, Inf))
#Define the latent process model using defaults
rwp = RandomWalk()

#Define the observation model
delay_distribution = Gamma(2.0, 5 / 2)
Expand Down Expand Up @@ -38,17 +37,18 @@ end
@testitem "`generate_epiaware` with Exp growth rate and RW latent process runs" begin
using Distributions, Turing, DynamicPPL
# Define test inputs
y_t = missing# rand(1:10, 365) # Data will be generated from the model
y_t = missing # Data will be generated from the model
data = EpiData([0.2, 0.3, 0.5], exp)

#Define the epi_model
epi_model = ExpGrowthRate(data, Normal())

#Define the latent process model
r_3 = log(2) / 3.0
rwp = RandomWalk(
truncated(Normal(0.0, r_3 / 3), -r_3, r_3), # 3 day doubling time at 3 sigmas in prior
truncated(Normal(0.0, 0.01), 0.0, 0.1))
init_prior = truncated(Normal(0.0, r_3 / 3), -r_3, r_3)# initial 3 day doubling time at 3 sigmas in prior
step_size_dist = HierarchicalNormal(std_prior = truncated(Normal(0.0, 0.01), 0.0, 0.1))
rwp = RandomWalk(init_prior = init_prior,
ϵ_t = step_size_dist)

#Define the observation model - no delay model
time_horizon = 5
Expand Down Expand Up @@ -83,9 +83,10 @@ end

#Define the latent process model
r_3 = log(2) / 3.0
rwp = RandomWalk(
truncated(Normal(0.0, r_3 / 3), -r_3, r_3), # 3 day doubling time at 3 sigmas in prior
truncated(Normal(0.0, 0.01), 0.0, 0.1))
init_prior = truncated(Normal(0.0, r_3 / 3), -r_3, r_3)# initial 3 day doubling time at 3 sigmas in prior
step_size_dist = HierarchicalNormal(std_prior = truncated(Normal(0.0, 0.01), 0.0, 0.1))
rwp = RandomWalk(init_prior = init_prior,
ϵ_t = step_size_dist)

#Define the observation model - no delay model
time_horizon = 5
Expand Down

0 comments on commit a1f0790

Please sign in to comment.