predict.tsd_onset: Predict Observations for Future Time Steps

View source: R/predict.R

predict.tsd_onsetR Documentation

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 class 'tsd_onset'
predict(object, n_step = 3, ...)

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).

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.

Examples

# 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)

aedseo documentation built on April 12, 2025, 1:35 a.m.