ts_periodic: Periodic Deterministic Predictor

View source: R/ts_deterministic.R

ts_periodicR Documentation

Periodic Deterministic Predictor

Description

Forecast a univariate series by repeating a learned periodic cycle.

Usage

ts_periodic(period, context_size = NULL)

Arguments

period

Integer. Cycle length to repeat.

context_size

Optional integer. Most recent values used to identify the next state within the cycle. When omitted, the smallest non-ambiguous value is inferred automatically.

Value

A ts_periodic object, inheriting from ts_deterministic.

Examples

series <- c(4, 5, 6, 7, 1, 2, 3)
model <- ts_periodic(7)
model <- daltoolbox::fit(model, x = series)
predict(model, steps_ahead = 5)

tspredit documentation built on Sept. 9, 2026, 9:08 a.m.