View source: R/estimate_disease_threshold.R
| estimate_disease_threshold | R Documentation |
This function estimates the disease specific threshold, based on previous seasons. If the disease threshold is estimated between ]0:1] it will be set to 1.
estimate_disease_threshold(
tsd,
season_start = 21,
season_end = season_start - 1,
skip_current_season = TRUE,
min_significant_time = 3,
max_gap_time = 1,
use_prev_seasons_num = 3,
pick_significant_sequence = c("longest", "earliest"),
season_importance_decay = 0.8,
conf_levels = c(0.25, 0.5, 0.75),
...
)
tsd |
A |
season_start, season_end |
Integers giving the start and end weeks of the seasons to stratify the observations by. |
skip_current_season |
A logical. Do you want to skip your current season? |
min_significant_time |
An integer specifying how many time steps that have to be significant to the sequence to be considered in estimation. |
max_gap_time |
A numeric value specifying how many time steps there is allowed to be non-significant between two significant sequences for maybe considering them as the same sequence. Sometimes e.g. vacations or less testing can lead to false decreases. |
use_prev_seasons_num |
An integer specifying how many previous seasons you want to include in estimation. |
pick_significant_sequence |
A character string specifying which significant sequence to pick from each season.
|
season_importance_decay |
A numeric value between 0 and 1, that specifies the weight applied to previous
seasons. It is used as |
conf_levels |
A numeric vector specifying the confidence levels for parameter estimates. The values have
to be unique and in ascending order, the first percentile is the disease specific threshold.
Specify one or three confidence levels e.g.: |
... |
Arguments passed to the |
An object of class tsd_disease_threshold, containing;
....
# Generate seasonal data
tsd_data <- generate_seasonal_data(
years = 3,
start_date = as.Date("2021-01-01"),
noise_overdispersion = 3
)
# Estimate disease threshold
estimate_disease_threshold(tsd_data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.