IntermittentDemandGenerator
Bases: BaseGenerator
Generate intermittent demand time series with sparse patterns.
Demand is a two-part process: a binary occurrence process decides at
which periods demand happens, and a size distribution draws the demand
quantity for those periods (all other periods are zero). Common in
retail, spare parts, and inventory contexts (Croston-style demand).
Size distributions are moment-matched to (demand_mean, demand_std):
- ‘poisson’: Poisson(demand_mean); demand_std is ignored.
- ‘negative_binomial’: p = mean/var, n = mean*p/(1-p); falls back to Poisson when demand_std**2 <= demand_mean.
- ‘lognormal’: mu = ln(mean^2 / sqrt(var + mean^2)), sigma^2 = ln(1 + var/mean^2).
- ‘gamma’: shape = (mean/std)^2, scale = var/mean. Sizes are clipped from below at min_demand.
IntermittentDemandGenerator.generate_single_series
Returns:
IoTSensorGenerator
Bases: BaseGenerator
Generate IoT sensor readings with realistic degradation patterns.
The signal is base_value + trend * t plus optional sinusoidal
seasonality, a calibration offset, a cumulative drift random walk
(drift_rate per step with drift_noise variation), and Gaussian
measurement noise. After battery_life steps, noise grows and the
signal is attenuated at battery_degradation_rate. Failures can be
injected as NaN gaps (‘intermittent’), a permanent NaN tail (‘complete’),
or frozen readings (‘stuck’).
With n_sensors > 1, each generated “series” is a network of sensors
whose measurement noise is spatially correlated
(corr[i, j] = spatial_correlation ** |i - j|); each sensor becomes a
separate output series.
Parameters:
IoTSensorGenerator.generate_single_series
Returns:
IoTSensorGenerator.generate
n_sensors == 1, generates n_series independent sensors.
With n_sensors > 1, generates n_series sensor networks, each
contributing n_sensors correlated series.
Parameters:
Returns:
EnergyLoadGenerator
Bases: BaseGenerator
Generate electricity demand with nested daily/weekly/yearly cycles.
The load is a base level plus:
- A daily profile depending on
load_type: residential has Gaussian morning/evening peaks, commercial a broad midday peak, industrial a near-constant profile with a night dip. - A weekly cycle: weekend reduction for residential/commercial, a sinusoidal pattern for industrial.
- A yearly cosine cycle peaking around the series start (winter).
- Temperature-driven load: both heating (cold) and cooling (hot) increase
demand proportionally to
|temperature - base_temperature|. - Holiday reductions, random extreme-weather multipliers, and Gaussian noise. The result is clipped at zero.
freq (an integer freq is treated as hourly).
Parameters:
EnergyLoadGenerator.generate_single_series
Returns:
StateSpaceGenerator
Bases: BaseGenerator
Generate time series from a (linear-Gaussian or custom) state space model.
The linear model is:
x[0] ~ N(initial_state, initial_state_covariance). State noise
w follows the configured innovation distribution (scaled by the
Cholesky/PSD factor of Q); observation noise v is Gaussian. The
univariate output is the first observation dimension y[t][0], with
y[0] observing the initial state. Custom nonlinear dynamics can be
supplied via transition_fn / observation_fn, each called as
fn(x, t, rng).
Parameters:
StateSpaceGenerator.generate_single_series
Returns:
StateSpaceGenerator.generate_with_states
Returns:
(observations DataFrame in long format, states DataFrame
with one
state_j column per state dimension).
DailyActiveUsersGenerator
Bases: BaseGenerator
Generate Daily Active Users time series with event-driven jumps.
The DAU level is base_users * (1 + growth_rate)^day with a weekend
multiplier, plus a decaying boost from random events: with probability
event_probability per step an event adds (impact - 1) * base to a
boost that decays geometrically at rate event_decay_rate. Proportional
Gaussian noise is added and the result is clipped at zero.
The day index is derived from the step position relative to the series
start using the step size implied by freq (an integer freq is
treated as daily). Weekends are day indices 5 and 6 of each 7-day block.
Also outputs an exogenous column marking the steps where events occur,
usable as a feature for forecasting models.
Parameters:
DailyActiveUsersGenerator.generate_single_series
self._current_events with event indicators.
Parameters:
Returns:
DailyActiveUsersGenerator.generate
Returns:
VitalSignsGenerator
Bases: BaseGenerator
Generate realistic vital signs time series for healthcare applications.
Simulates one of six vital signs (heart rate, systolic/diastolic blood
pressure, respiratory rate, SpO2, temperature) as a per-series baseline
plus a slow random-walk drift, a circadian rhythm, heart rate variability
(for HR and BP), random physiological events (activity bursts, rest
periods, spikes), measurement noise, and cross-vital correlations with
heart rate. Values are clipped to physiological bounds that depend on the
patient archetype.
Parameters:
VitalSignsGenerator.generate_single_series
Returns:
VitalSignsGenerator.generate_all_vitals
Returns:
VitalSignsGenerator.get_model_info
ClickstreamGenerator
Bases: BaseGenerator
Generate web clickstream/session time series for analytics applications.
Human sessions per time bin are Poisson-distributed around
base_sessions modulated by hour-of-day/day-of-week seasonality and a
slow log-random-walk trend. Bot traffic (flatter profile plus occasional
crawl spikes) can be added on top. Bounces, pageviews (geometric page
depth for engaged sessions) and conversions are derived per bin from the
human sessions, with multipliers depending on traffic_source.
Output types:
- ‘sessions’: total session counts (human + bot) per time bin
- ‘pageviews’: total pageviews per time bin
- ‘conversions’: conversion counts per time bin
- ‘bounce_rate’: bounced fraction of total sessions per time bin
ClickstreamGenerator.generate_single_series
Returns:
ClickstreamGenerator.generate_full_metrics
Returns:
ClickstreamGenerator.generate_funnel
Returns:

