MARGenerator draws mixture autoregressive (MAR) series for
foundation-model pretraining. At each time step it selects an
autoregressive component and uses that component’s intercept, lag
coefficients, and innovation scale:
The mixture autoregressive model is due to Wong and Li
(2000); the breadth-oriented
sampling recipe follows GRATIS.
SynForecast samples stationary coefficients through partial
autocorrelations and adds bounded retries, optional seasonal AR factors,
and explicit output standardization.
Generate a diverse MAR pool
Random mode samples a new configuration for every series.seasonal_period enables a seasonal AR factor for a random subset of
components.
generate() calls use the native Rust batch path and are
deterministic for a fixed seed regardless of worker count. The native
and Python reference paths implement the same model contract but use
different RNG streams, so do not compare generate() output bit-for-bit
with successive generate_single_series() calls.
By default each accepted series is standardized to population mean zero
and standard deviation one. Set standardize=False when
component-implied levels and scales are part of the desired
distribution.
Supply a fixed MAR model
Fixed mode is enabled by supplying all four fixed fields together. Every AR component must be stationary and the mixture must be second-order stationary (Wong and Li 2000); weights are normalized during validation.seasonal_period has no effect in fixed mode. A fixed model whose
simulation fails the finite, bounded, non-constant output guards raises
a ValueError instead of silently returning noise.
weights, ar_coefficients, intercepts, and noise_scales are an
all-or-nothing group. Leaving all four unset selects random mode.
Target time-series features
tune_to_features searches for one fixed MAR configuration whose
realized features approach a target. Supported features are
spectral_entropy, trend_strength, seasonal_strength, and acf1.
seasonal_period and at least
two complete periods at min_length.
Note The search evaluates at most the product ofn_generations,population_size, andn_draws_per_candidatesimulated paths, stopping early once the best L2 feature distance is at or belowtolerance(default0.05). Infeasible targets return the best candidate found within that fixed budget.tuning_diagnosticsreportsbest_distance,converged,generations_run, andcandidates_evaluated. The distance is the selected candidate’s observed search fitness; evaluate fresh draws to measure performance on new samples.

