Learn R Programming

aedseo (version 0.3.0)

predict.tsd_onset: Predict Observations for Future Time Steps

Description

This function is used to predict future observations based on a tsd_onset object. It uses the time_interval attribute from the tsd_onset object to make predictions.

Usage

# S3 method for tsd_onset
predict(object, n_step = 3, ...)

Value

A tibble-like object called tsd_predict containing the predicted observations, including reference time, lower confidence interval, and upper confidence interval for the specified number of future time steps.

Arguments

object

A tsd_onset object created using the seasonal_onset() function.

n_step

An integer specifying the number of future time steps for which you want to predict observations.

...

Additional arguments (not used).

Examples

Run this code
# Generate predictions of time series data
set.seed(123)
time_series <- generate_seasonal_data(
  years = 1,
  time_interval = "day"
)
# Apply `seasonal_onset` analysis
time_series_with_onset <- seasonal_onset(
  tsd = time_series,
  k = 7
)
# Predict observations for the next 7 time steps
predict(object = time_series_with_onset, n_step = 7)

Run the code above in your browser using DataLab