Skip to content

Commit

Permalink
change lookback to 90 time steps
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelBrand1 committed Dec 19, 2024
1 parent 9b467f2 commit b3c24f0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pipeline/src/constructors/make_default_params.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function make_default_params(pipeline::AbstractEpiAwarePipeline)
α_delay = 4.0
θ_delay = 5.0 / 4.0
lookahead = 21
lookback = 35
lookback = 90
stride = 7
return Dict(
"Rt" => Rt,
Expand Down
4 changes: 2 additions & 2 deletions pipeline/src/constructors/make_tspan.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Constructs a time span for performing inference on a case data time series. This
- `T::Union{Integer,Nothing} = nothing`: The `stop` point at which to construct
the time span. If `nothing`, the time span will be constructed using the
length of the Rt vector for `pipeline`.
- `lookback = 35`: The number of days to look back from the specified time point.
- `lookback`: The number of days to look back from the specified time point.
# Returns
A tuple `(start, stop)` representing the start and stop indices of the time span.
Expand All @@ -16,7 +16,7 @@ A tuple `(start, stop)` representing the start and stop indices of the time span
"""
function make_tspan(pipeline::AbstractEpiAwarePipeline;
T::Union{Integer, Nothing} = nothing, lookback = 35)
T::Union{Integer, Nothing} = nothing, lookback)
N = size(make_Rt(pipeline), 1)
_T = isnothing(T) ? N : T
return (max(1, _T - lookback), min(N, _T))
Expand Down
2 changes: 2 additions & 0 deletions pipeline/src/infer/InferenceConfig.jl
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,10 @@ to make inference on and model configuration.
function create_inference_results(config, epiprob)
#Return the sampled infections and observations
idxs = config.tspan[1]:config.tspan[2]
#Subselect the case data to the time span
y_t = ismissing(config.case_data) ? missing :
Vector{Union{Missing, Int64}}(config.case_data[idxs])
#Run inference once
inference_results = apply_method(epiprob,
config.epimethod,
(y_t = y_t,)
Expand Down

0 comments on commit b3c24f0

Please sign in to comment.