-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* extra constructors for default params, delay distribution etc * rename to mention latent in latentmodel * single constructor for model priors * Delete make_epiaware_name_model_pairs.jl * update make inference configs * update Inference Config * unit test updates * fix spelling * Update test_InferenceConfig.jl * Fix test-infer/forecast to avoid error on missing output data
- Loading branch information
1 parent
e506f7d
commit 2b6ef61
Showing
16 changed files
with
178 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
include("make_gi_params.jl") | ||
include("make_inf_generating_processes.jl") | ||
include("make_latent_model_priors.jl") | ||
include("make_epiaware_name_model_pairs.jl") | ||
include("make_model_priors.jl") | ||
include("make_epiaware_name_latentmodel_pairs.jl") | ||
include("make_inference_method.jl") | ||
include("make_truth_data_configs.jl") | ||
include("make_inference_configs.jl") | ||
include("make_Rt.jl") | ||
include("make_tspan.jl") | ||
include("make_default_params.jl") | ||
include("make_delay_distribution.jl") | ||
include("make_observation_model.jl") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
""" | ||
Constructs and returns a delay distribution for the given `pipeline`. This is the default method | ||
returning a `Gamma` distribution with shape parameter `α = 4.` and rate parameter `θ = 5. / 4.`. | ||
# Arguments | ||
- `pipeline::AbstractEpiAwarePipeline`: The pipeline for which the delay distribution is constructed. | ||
# Returns | ||
- `delay_distribution::Distribution`: The constructed delay distribution. | ||
""" | ||
function make_delay_distribution(pipeline::AbstractEpiAwarePipeline) | ||
default_params = make_default_params(pipeline) | ||
Gamma(default_params["α_delay"], default_params["θ_delay"]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
""" | ||
Constructs an observation model for the given pipeline. This is the defualt method. | ||
# Arguments | ||
- `pipeline::AbstractEpiAwarePipeline`: The pipeline for which the observation model is constructed. | ||
# Returns | ||
- `obs`: The constructed observation model. | ||
""" | ||
function make_observation_model(pipeline::AbstractEpiAwarePipeline) | ||
default_params = make_default_params(pipeline) | ||
#Model for ascertainment based on day of the week | ||
dayofweek_logit_ascert = ascertainment_dayofweek(NegativeBinomialError(cluster_factor_prior = HalfNormal(default_params["cluster_factor"]))) | ||
#Default continuous-time model for latent delay in observations | ||
delay_distribution = make_delay_distribution(pipeline) | ||
#Model for latent delay in observations | ||
obs = LatentDelay(dayofweek_logit_ascert, delay_distribution) | ||
return obs | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Test | ||
|
||
@testset "make_observation_model" begin | ||
# Mock pipeline object | ||
struct MockPipeline <: AbstractEpiAwarePipeline | ||
end | ||
|
||
# Test case 1: Check if the returned object is of type LatentDelay | ||
@testset "Returned object type" begin | ||
obs = make_observation_model(MockPipeline()) | ||
@test typeof(obs) == LatentDelay | ||
end | ||
|
||
# Test case 2: Check if the default parameters are correctly passed to ascertainment_dayofweek | ||
@testset "Default parameters" begin | ||
obs = make_observation_model(MockPipeline()) | ||
@test obs.dayofweek_logit_ascert.cluster_factor_prior == | ||
HalfNormal(make_default_params(MockPipeline())["cluster_factor"]) | ||
end | ||
|
||
# Test case 3: Check if the delay distribution is correctly constructed | ||
@testset "Delay distribution" begin | ||
obs = make_observation_model(MockPipeline()) | ||
@test typeof(obs.delay_distribution) == DelayDistribution | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.