| predict.tsd_onset | R Documentation |
This function is used to predict future cases based on a tsd_onset object.
It uses the time_interval attribute from the tsd_onset object to make predictions.
## S3 method for class 'tsd_onset'
predict(object, n_step = 3, ...)
object |
A |
n_step |
An integer specifying the number of future time steps for which you want to predict cases. |
... |
Additional arguments (not used). |
A tibble-like object called tsd_predict containing the predicted cases, including reference time,
lower confidence interval, and upper confidence interval for the specified number of future time steps.
# Generate predictions of time series data
set.seed(123)
time_series <- generate_seasonal_data(
years = 1,
time_interval = "days"
)
# Apply `seasonal_onset` analysis
time_series_with_onset <- seasonal_onset(
tsd = time_series,
k = 7
)
# Predict cases for the next 7 time steps
predict(object = time_series_with_onset, n_step = 7)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.