Skip to main content

GARCHGenerator

Bases: BaseGenerator Generate return series from a GARCH(p, q) model. The model is r_t = mu + eps_t with eps_t = sigma_t * z_t and conditional variance
Stationarity requires sum(alpha) + sum(beta) < 1, giving an unconditional variance of omega / (1 - sum(alpha) - sum(beta)). Squared returns are positively autocorrelated (volatility clustering) while the returns themselves are serially uncorrelated. Parameters:

GARCHGenerator.generate_single_series

Generate values for a single GARCH time series. Parameters: Returns:

OrnsteinUhlenbeckGenerator

Bases: BaseGenerator Generate time series from an Ornstein-Uhlenbeck (mean-reverting) process. The OU process is commonly used to model interest rates, volatility, and other mean-reverting phenomena:
Simulated with the Euler-Maruyama scheme X_t = X_{t-1} + theta * (mu - X_{t-1}) * dt + sigma * sqrt(dt) * z_t, where z_t are unit-variance draws from innovation_distribution. This is an AR(1) process with coefficient phi = 1 - theta * dt, stationary mean mu, stationary variance sigma^2 * dt / (1 - phi^2) (which approaches the continuous-time sigma^2 / (2 * theta) as dt -> 0), and lag-1 autocorrelation phi. Stability requires theta * dt < 2. dt is the model time per observation and is independent of freq. Parameters:

OrnsteinUhlenbeckGenerator.generate_single_series

Generate values for a single Ornstein-Uhlenbeck time series. Parameters: Returns:

GeometricBrownianMotionGenerator

Bases: BaseGenerator Generate time series from Geometric Brownian Motion. GBM models strictly positive processes such as asset prices:
Simulated via the exact solution of the SDE, S_t = S_{t-1} * exp((mu - sigma^2/2) * dt + sigma * sqrt(dt) * z_t), where z_t are unit-variance draws from innovation_distribution (exact for normal innovations). dt is the model time per observation and is independent of freq: with annualized mu/sigma, daily observations correspond to dt=1/252. Note that the default dt=1.0 treats mu and sigma as per-step rates; long series with a large mu * dt grow explosively. Parameters:

GeometricBrownianMotionGenerator.generate_single_series

Generate values for a single Geometric Brownian Motion time series. Parameters: Returns:

JumpDiffusionGenerator

Bases: BaseGenerator Generate time series from a jump diffusion process (Merton model). Combines Geometric Brownian Motion with discontinuous jumps from a compound Poisson process, commonly used for asset prices with rare events:
Each step multiplies the price by exp((mu - sigma^2/2) * dt + sigma * sqrt(dt) * z_t + sum_k Y_k) with N_t ~ Poisson(lambda_jump * dt) jumps of log-size Y_k = jump_mean + jump_std * eps_k. Both z_t and eps_k are unit-variance draws from innovation_distribution (normal by default, giving Merton’s log-normal jumps). The drift is not compensated for jumps, so the expected log-return per step is (mu - sigma^2/2) * dt + lambda_jump * dt * jump_mean. dt is the model time per observation and is independent of freq. Parameters:

JumpDiffusionGenerator.generate_single_series

Generate values for a single jump diffusion time series. Parameters: Returns:

PoissonProcessGenerator

Bases: BaseGenerator Generate time series based on a homogeneous Poisson process. Each observation is the event count in one time step: y_t ~ Poisson(lambda_rate), i.i.d., so mean and variance both equal lambda_rate. With cumulative=True the running total N(t) = sum y_s is returned instead (the counting process itself). lambda_rate is expressed per time step of freq. Parameters:

PoissonProcessGenerator.generate_single_series

Generate values for a single Poisson Process time series. Parameters: Returns:

CyclicGenerator

Bases: BaseGenerator Generate time series with irregular cyclic patterns. Models business cycles and economic indicators: a linear trend plus num_cycles superposed sinusoids whose periods and amplitudes are drawn once per series (period ~ |N(period_mean, period_std)|, amplitude ~ N(amplitude_mean, amplitude_std)), plus additive noise drawn from the configured innovation_distribution. Each sinusoid’s instantaneous frequency is slowly modulated (+-20% around 2*pi/period, integrated as a cumulative phase), so cycle lengths vary within a series, unlike regular seasonal patterns. Parameters:

CyclicGenerator.generate_single_series

Generate values for a single time series with irregular cycles. Parameters: Returns:

FractionalBrownianMotionGenerator

Bases: BaseGenerator Generate time series using Fractional Brownian Motion (fBm). fBm extends standard Brownian motion with a Hurst exponent H that controls long-range dependence:
  • H = 0.5: standard Brownian motion (independent increments)
  • H > 0.5: persistent/trending (positively correlated increments)
  • H < 0.5: anti-persistent/mean-reverting (negatively correlated)
The increments (fractional Gaussian noise, fGn) are stationary with autocovariance gamma(k) = (sigma^2/2) * (|k+1|^&#123;2H&#125; - 2|k|^&#123;2H&#125; + |k-1|^&#123;2H&#125;), and the path satisfies Var(B_H(t)) = sigma^2 * t^&#123;2H&#125;. Parameters:

FractionalBrownianMotionGenerator.generate_single_series

Generate a single fBm series. Parameters: Returns:

FractionalBrownianMotionGenerator.get_model_info

Return model parameters and qualitative behavior.

FractionalBrownianMotionGenerator.estimate_hurst

Estimate the Hurst exponent from an increment (fGn) series. Parameters: Returns:

HawkesProcessGenerator

Bases: BaseGenerator Generate time series using Hawkes (self-exciting) point processes. Hawkes processes model events where past occurrences increase the probability of future events. The conditional intensity at time t is:
with baseline intensity mu and excitation kernel g. Supported kernels:
Stability requires n < 1; the long-run event rate is then mu / (1 - n) events per time step, and each event spawns on average 1 / (1 - n) events (itself included) in its cluster. Time is measured in steps of freq, so mu and beta are per-step quantities. Applications: order arrivals in high-frequency trading, earthquake aftershock sequences, viral cascades, clustered fraud events. Parameters:

HawkesProcessGenerator.generate_single_series

Generate values for a single Hawkes process series. Parameters: Returns:

HawkesProcessGenerator.simulate_with_events

Simulate and return both event times and intensity at those times. Parameters: Returns:

HawkesProcessGenerator.get_model_info

Get information about the Hawkes process model. Returns:

HawkesProcessGenerator.estimate_parameters

Estimate Hawkes process parameters from observed event times. Heuristic moment-based estimation: the coefficient of variation of inter-arrival times proxies the branching ratio (CV = 1 for a Poisson process, larger under clustering), and the mean rate identifies mu via rate = mu / (1 - n). Parameters: Returns:

StochasticVolatilityGenerator

Bases: BaseGenerator Generate time series where volatility itself follows a stochastic process. Heston model (variance is mean-reverting square-root/CIR):
SABR model (for rates/FX):
Both are simulated with Euler-Maruyama; the Heston variance uses a truncation scheme (floored at a small positive value) so the discretized variance stays positive even when the Feller condition 2 * kappa * theta > sigma_v^2 is violated. Negative rho produces the leverage effect (volatility rises when prices fall). Parameters:

StochasticVolatilityGenerator.generate_single_series

Generate values for a single stochastic volatility series. Parameters: Returns:

StochasticVolatilityGenerator.generate_with_volatility

Generate series and return both prices and volatility paths. Parameters: Returns:

StochasticVolatilityGenerator.get_model_info

Get information about the stochastic volatility model. Returns:

StochasticVolatilityGenerator.implied_volatility_smile

Approximate implied volatility smile for given strikes. Uses the Hagan SABR approximation formula (valid for the SABR model; a rough approximation for Heston). Parameters: Returns:

RegimeSwitchingGenerator

Bases: BaseGenerator Generate time series with Markov regime-switching dynamics. A hidden regime s_t follows a first-order Markov chain with transition matrix P (rows sum to 1). Conditional on the regime, values follow an AR(1) around the regime mean:
When no initial regime is given, s_0 is drawn from the stationary distribution pi of P (pi = pi P), so long-run regime occupancy matches pi. Parameters:

RegimeSwitchingGenerator.generate_single_series

Generate values for a single regime-switching time series. Parameters: Returns:

RegimeSwitchingGenerator.generate_with_regimes

Generate series and return both values and regime labels. Parameters: Returns:

RegimeSwitchingGenerator.get_model_info

Get information about the regime-switching model. Returns:

ChaoticSystemGenerator

Bases: BaseGenerator Generate time series from deterministic chaotic dynamical systems. Produces series that look stochastic but are fully deterministic given the initial condition; randomness enters only through a seeded perturbation of the initial condition and optional observation noise. Parameters:

ChaoticSystemGenerator.generate_single_series

Generate a single chaotic time series. Parameters: Returns:

ChaoticSystemGenerator.get_model_info

Return information about the chaotic system configuration.

BoundedProcessGenerator

Bases: BaseGenerator Generate time series constrained to a bounded interval. Values are simulated on the unit interval and affinely mapped to [lower, upper] (default [0, 1]). Useful for proportions, market shares, probabilities, and other bounded quantities. Parameters:

BoundedProcessGenerator.generate_single_series

Generate a single bounded time series. Parameters: Returns:

BoundedProcessGenerator.get_model_info

Return information about the bounded process configuration.

LevyProcessGenerator

Bases: BaseGenerator Generate time series with alpha-stable (Levy) increments. Each observation step adds an independent increment scale * X + location where X ~ S(alpha, beta_skew; 1) is a standard alpha-stable random variable in the S1 parameterization (matching scipy.stats.levy_stable), sampled with the Chambers-Mallows-Stuck algorithm. For alpha < 2 the increments have infinite variance, producing extreme jumps far beyond Gaussian or t-distributed innovations. There is no separate dt: scale is the per-step scale (a step of duration dt in model time corresponds to scale ~ dt**(1/alpha) by self-similarity). Parameters:

LevyProcessGenerator.generate_single_series

Generate a single Levy process time series. Parameters: Returns:

LevyProcessGenerator.get_model_info

Return information about the Levy process configuration.