Skip to main content

generate_series

Generate a synthetic panel of time series. Series are drawn from the interpretable pool of generators covering diverse temporal behaviors (or from generators when provided) and returned in long format, mirroring utilsforecast.data.generate_series. Series are spread evenly across the generator list from the front, so when n_series is smaller than the pool only the first n_series generators contribute. The default pool is ordered round-robin across its behavioral niches, so a small panel still spans distinct behaviors: the first 15 generators cover all 15 niches. Parameters: Returns:

interpretable_pool

Create a pool of interpretable single-mechanism generators. Returns 42 pre-configured generator instances across 15 behavioral niches, with allocation proportional to each generator’s behavioral range, so no domain dominates. Every instance is one named data-generating process; the meta-generators that randomize their own composition per series are left to :func:pretraining_pool. Until version 0.2 this function was called balanced_pool; that name remains available as a deprecated alias. The list is ordered round-robin across the niches (one variant of every niche, then second variants, and so on), so any prefix spans as many distinct behaviors as possible: the first 15 entries cover all 15 niches. Consumers that use only the first k generators — such as generate_series with n_series < 42 — therefore still get a behaviorally diverse panel. The seasonal variants (seasonal SARIMA, Holt-Winters ETS, seasonal intermittent demand and the periodic Gaussian process) share one seasonal period, which also sets the mean period of the two cyclic variants. Unless seasonal_period is given it is derived from freq as the number of steps in the next-larger calendar cycle: hourly data gets 24, daily 7, business-daily 5, weekly 52, monthly 12, quarterly 4, and multiples divide accordingly ("15min" gives 4, "2h" gives 12). Integer frequencies and offsets without a calendar convention fall back to 12. Yearly data has no sub-annual cycle, so its period is 1 and the seasonal variants reduce to their non-seasonal counterparts. Parameters: Returns: Examples:

balanced_pool

Deprecated alias of :func:interpretable_pool. The pool is balanced across behavioral niches, but so is :func:pretraining_pool; the distinguishing property is that every instance is an interpretable single-mechanism process. Use :func:interpretable_pool. This alias warns and will be removed in a future release.

pretraining_pool

Create a breadth-maximizing pool for foundation-model pretraining. This is the pretraining-oriented counterpart to :func:interpretable_pool. It adds the diversity-targeted meta-generators that interpretable_pool deliberately excludes — TSIGenerator (randomized trend/seasonal/ irregular composition), TCMGenerator (random temporal causal graphs), KernelSynthGenerator (samples from randomly composed GP kernels), and MARGenerator (GRATIS-style mixtures of autoregressive components). Each resamples a fresh configuration per series, so a handful of instances spans a very wide distribution. By default it also includes the full interpretable_pool so the corpus carries interpretable single-mechanism behaviors alongside the meta-generators. Unlike interpretable_pool, the default length range is wide (256-1024 steps), matching the longer contexts typical of pretraining. Parameters: Returns: Examples:

seasonal_pool

Create an opt-in pool of strongly seasonal series on a moving level. Feature-space coverage benchmarks found that real quarterly and monthly panels with a pronounced, regular seasonal cycle whose swing grows with the level (tourism demand, hospital patient counts) have few near neighbours in :func:interpretable_pool. This pool adds eight configured instances of existing generators that fill that region: TSIGenerator with one harmonic at the seasonal period under moderate to heavy noise, including persistent AR(1) and heavy-tailed variants and a weakly seasonal variant; noisy multiplicative and additive Holt-Winters ETSGenerator instances with fast level adaptation; and SeasonalGenerator sines with level or slope breaks. It is meant to be added on top of interpretable_pool or pretraining_pool, never to replace them or any share of them. On tourism, hospital, and M1 monthly panels, adding it raised the fraction of real series with a close synthetic neighbour by 8 to 32 points; on M4 panels, which have no such gap, it was neutral; and on intermittent car-parts sales it slightly lowered coverage when it displaced the pretraining pool’s share. As a standalone corpus it covers far fewer real series than the pools. It was evaluated only at quarterly and monthly periods; other periods are supported but untested, and its effect on forecasting accuracy has not been measured. Parameters: Returns: Examples:

Multivariatizer

Bases: BaseModel Wrap a univariate :class:BaseGenerator to produce correlated channels. generate(n_series) draws n_series independent series of one shared length from the wrapped generator, standardizes them, applies the configured couplings, then restores each channel’s original level and scale. The output is the same long-format frame the wrapped generator produces (its id_col/time_col/target_col and engine). Couplings (both may compose; mixing is applied first):
  • "mixing" (cotemporaneous): channels become instantaneous linear combinations Z @ L.T of the standardized bases, where L is the Cholesky factor of a random well-conditioned correlation target C = (1 - s) I + s Q. Q is the correlation matrix of a random Gaussian Gram matrix and s (the mixing strength, drawn from mixing_strength_range) directly sets the magnitude of the induced cross-correlations; s < 1 keeps C positive definite, so L is well conditioned.
  • "leadlag" (sequential): each non-root channel becomes, with probability 0.5 (at least one always does), a lagged, sign-flipped, noise-perturbed copy of an earlier channel: z_j = sign * roll(z_src, lag) + sigma * eps with lag from lag_range (clamped below the series length, circular wrap so all channels share the same timestamps) and sigma from noise_scale_range. Per-channel scaling comes from the level/scale restore.
Guards: every drawn base series must be finite with |x| < 1e8 and std > 1e-8; violating draws are redrawn up to 5 times, then replaced by unit Gaussian noise. Seeding: the multivariatizer’s own seed fully determines the output. The wrapped generator is copied and reseeded from the multivariatizer’s rng on every generate call, so the base generator’s own seed and rng state never influence the result and the original object is not mutated. The last sampled coupling recipe (mixing strength/matrix, lead-lag pairs with their lags) is exposed as last_recipe for introspection. Parameters:

Multivariatizer.generate

Generate n_series cross-dependent channels from the wrapped base. All channels share one length drawn from the base generator’s [min_length, max_length]; each channel is one unique_id in the long-format output. Parameters: Returns:

Multivariatizer.last_recipe

The coupling recipe sampled by the most recent generate() call.