Skip to main content
A seasonal series is a repeating cycle riding on a trend โ€” daily traffic, weekly sales, yearly demand. SeasonalGenerator builds one by adding a periodic wave, a linear trend, and observation noise, which makes it the natural test of whether a model captures periodicity and extrapolates the level.
The model yt=base+trendโ‹…t+amplitudeโ‹…sโ€‰โฃ(2ฯ€t/period)+ฮตty_t = \text{base} + \text{trend}\cdot t + \text{amplitude}\cdot s\!\left(2\pi t / \text{period}\right) + \varepsilon_t
  • seasonality_period โ€” length of one cycle in time steps (24 gives a daily cycle on hourly data).
  • seasonality_amplitude โ€” height of the seasonal swing.
  • trend โ€” linear drift per step; base_level โ€” the starting level.
  • noise_level โ€” standard deviation of the additive noise.

Define generator parameters

Configure a seasonal generator with daily seasonality (24-hour period), a slight upward trend, and a base level of 50.
Every series repeats on a 24-step cycle around a gently rising level. The series have different lengths (min_length โ‰  max_length) but share the same daily shape and trend โ€” the seasonal structure a forecaster should learn.

Inspect the generated data

Statistics by series

Sample of one series

View the first 24 hours of a single series to see the seasonal pattern.
Related generators
  • SARIMA โ€” seasonality with autoregressive/moving-average dynamics instead of a fixed wave.
  • ETS โ€” seasonality through exponential-smoothing state-space models.
  • Layer on anomalies or changepoints to stress-test a seasonal model.