Skip to content

Commit 0d4095e

Browse files
authored
Issue 563: Change lookback to 90 time steps (#564)
* change lookback to 90 time steps * fix unit tests
1 parent 7dde0e9 commit 0d4095e

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

pipeline/src/constructors/make_default_params.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function make_default_params(pipeline::AbstractEpiAwarePipeline)
2222
α_delay = 4.0
2323
θ_delay = 5.0 / 4.0
2424
lookahead = 21
25-
lookback = 35
25+
lookback = 90
2626
stride = 7
2727
return Dict(
2828
"Rt" => Rt,

pipeline/src/constructors/make_tspan.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Constructs a time span for performing inference on a case data time series. This
77
- `T::Union{Integer,Nothing} = nothing`: The `stop` point at which to construct
88
the time span. If `nothing`, the time span will be constructed using the
99
length of the Rt vector for `pipeline`.
10-
- `lookback = 35`: The number of days to look back from the specified time point.
10+
- `lookback`: The number of days to look back from the specified time point.
1111
1212
# Returns
1313
A tuple `(start, stop)` representing the start and stop indices of the time span.
@@ -16,7 +16,7 @@ A tuple `(start, stop)` representing the start and stop indices of the time span
1616
1717
"""
1818
function make_tspan(pipeline::AbstractEpiAwarePipeline;
19-
T::Union{Integer, Nothing} = nothing, lookback = 35)
19+
T::Union{Integer, Nothing} = nothing, lookback)
2020
N = size(make_Rt(pipeline), 1)
2121
_T = isnothing(T) ? N : T
2222
return (max(1, _T - lookback), min(N, _T))

pipeline/src/infer/InferenceConfig.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,10 @@ to make inference on and model configuration.
118118
function create_inference_results(config, epiprob)
119119
#Return the sampled infections and observations
120120
idxs = config.tspan[1]:config.tspan[2]
121+
#Subselect the case data to the time span
121122
y_t = ismissing(config.case_data) ? missing :
122123
Vector{Union{Missing, Int64}}(config.case_data[idxs])
124+
#Run inference once
123125
inference_results = apply_method(epiprob,
124126
config.epimethod,
125127
(y_t = y_t,)

pipeline/test/constructors/test_constructors.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ end
2424
@testset "default_tspan: returns an Tuple{Integer, Integer}" begin
2525
pipeline = EpiAwareExamplePipeline()
2626

27-
tspan = make_tspan(pipeline)
27+
tspan = make_tspan(pipeline; lookback = 90)
2828
@test tspan isa Tuple{Integer, Integer}
2929
end
3030

@@ -138,7 +138,7 @@ end
138138
"α_delay" => 4.0,
139139
"θ_delay" => 5.0 / 4.0,
140140
"lookahead" => 21,
141-
"lookback" => 35,
141+
"lookback" => 90,
142142
"stride" => 7
143143
)
144144

0 commit comments

Comments
 (0)