-
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.
* adding make_Rt methods * more make Rt methods * Make endemic scenarios geometric mean 1 * Update test_constructors.jl * prefix methods * format fix * Update infer.jl * add prefix for simulate * define a `lookback` parameter * Update make_tspan.jl * Default params for stride of rolling window * new make_tspan and modify other areas of code that assume a fixed tspan
- Loading branch information
1 parent
d43f033
commit 15d8aff
Showing
7 changed files
with
38 additions
and
20 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
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,16 +1,23 @@ | ||
""" | ||
Constructs the time span for the given `pipeline` object. | ||
Constructs a time span for performing inference on a case data time series. This | ||
is the default method. | ||
# Arguments | ||
- `pipeline::AbstractEpiAwarePipeline`: The pipeline object for which the time | ||
span is constructed. This is the default method. | ||
- `pipeline::AbstractEpiAwarePipeline`: The pipeline object used for analysis. | ||
- `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. | ||
# Returns | ||
- `tspan::Tuple{Float64, Float64}`: The time span as a tuple of start and end times. | ||
A tuple `(start, stop)` representing the start and stop indices of the time span. | ||
# Examples | ||
""" | ||
function make_tspan(pipeline::AbstractEpiAwarePipeline; backhorizon = 21) | ||
function make_tspan(pipeline::AbstractEpiAwarePipeline; | ||
T::Union{Integer, Nothing} = nothing, lookback = 35) | ||
N = size(make_Rt(pipeline), 1) | ||
@assert backhorizon<N "Backhorizon must be less than the length of the default Rt." | ||
return (1, N - backhorizon) | ||
_T = isnothing(T) ? N : T | ||
return (max(1, _T - lookback), min(N, _T)) | ||
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