KernelSynthGenerator samples each series from a Gaussian-process prior
whose covariance is a random composition of simple base kernels. For
every series it draws 1..max_kernels kernels from a fixed bank, folds
them together with randomly chosen + and * operators, and draws one
path from the resulting prior. Addition mixes behaviors (trend +
seasonality); multiplication modulates them (locally periodic,
amplitude-varying seasonality).
This adapts the KernelSynth recipe introduced for pretraining the
Chronos forecasting models (Ansari et al. 2024, Chronos: Learning the
Language of Time Series) and its
Apache-2.0-licensed reference
implementation.
SynForecast makes the bank configurable, expresses seasonal periods in
time steps on a normalized grid, and adds bounded retries, divergence
guards, and optional standardization.
Generate a diverse pool
With the default bank, each series is a different kernel composition, so one call yields a varied pool. Lengths are fixed here to make the paths easy to compare; the composition is what varies.
Constrain the kernel bank
Every kernel family is a list you can narrow or extend. To bias the pool toward a specific inductive structure, restrict the bank — here to a single daily period plus a smooth RBF trend, composed one or two at a time — so the draws concentrate on smooth, near-daily-periodic shapes.
Use in a pretraining corpus
standardize=True (the default) rescales each series to zero mean and
unit variance, so compositions that span very different natural scales
stay comparable — the usual setting for a pretraining pool. Set
standardize=False to keep the raw GP draws. Because
KernelSynthGenerator is an ordinary generator, it composes with
SynSet, generate_series, and the pattern-injection options like any
other.
Related generatorsFull parameters are in the generator reference.
- TSI and TCM — the other pretraining generators (component composition and random causal graphs).
- Gaussian process — a single fixed kernel rather than random compositions.

