Formal Methodology

Mathematical Foundations & Generative Architecture

A detailed technical breakdown of the generative pipeline: state transition graphs, parametric emission sampling, population heterogeneity, and explicit synthetic data boundaries.

1. Generative Execution Pipeline

The simulation loop advances agents through discrete temporal steps. Each step samples internal state progression, evaluates condition rules, and emits observable features.

01Phase
Config / Prior
Load States & Profiles
02Phase
Initial State
Sample s_0 ~ π_0
03Phase
Dynamics
Evaluate P(s_t+1 | s_t)
04Phase
Active State
Resolve s_t ∈ S
05Phase
Emission
Sample x_t ~ F(s_t)
06Phase
Lineage
Append to DataFrame

2. State Transition Model

BehaviorSim formalizes behavioral paths as a discrete-time Markov decision process without external reward feedback.

Let \mathcal{S} = \{s_1, s_2, \dots, s_K\} denote a finite state space of K discrete states. The transition dynamics between states are governed by a row-stochastic transition matrix P \in \mathbb{R}^{K \times K}, where each entry satisfies:

P_ij = P(s_t+1 = s_j \mid s_t = s_i), \quad \sum_{j=1}^K P_ij = 1, \quad P_ij \ge 0

Absorbing / Terminal States

States such as Churned or Discharged act as absorbing states where P_ii = 1.0, terminating further trajectory progression for that specific agent.

Dynamic Condition Rules

In addition to static matrices, transition probabilities can be modulated dynamically using TransitionRule objects that evaluate historical aggregations (last, sum, max, mean, min).

3. Supported Parametric Feature Distributions

At each temporal step, observable continuous and discrete variables are emitted from probability distributions strictly conditioned on the active state.

Distribution KeyParametersDescription
normalloc (mean), scale (std)Gaussian continuous emissions
lognormalmean, sigmaRight-skewed positive values (durations, volumes)
exponentialscale (1 / lambda)Inter-arrival intervals and elapsed times
poissonlam (rate)Discrete event frequencies and counts
uniformlow, highBounded continuous intervals
uniform_discretelow, highEquiprobable integer sampling
bernoullip (probability)Binary indicators, clicks, and event flags
categoricalcategories, probabilitiesDiscrete non-numeric choices or classes

4. Profiles, Presets & Reproducibility

Calibrating population diversity across cohorts with strict bitwise deterministic replay.

Profile Mixtures

When simulating populations of users, patients, or accounts, individual agents exhibit distinct baseline tendencies. BehaviorSim supports multiple profiles within a single simulator run, allocating profiles according to a calibrated mixture weight distribution.

Seeded Random Number Generation

Every stochastic decision—from initial state sampling to Gaussian noise generation—relies on an internal NumPy Generator initialized with the user-supplied seed. Re-running a simulation with identical configurations and seed guarantees bitwise identical trace outputs.

5. Scientific Boundary & Limitations

Essential disclosure regarding the synthetic nature of generated data and the scope of built-in domain presets.

Explicit Scientific & Regulatory Boundary

Synthetic Nature: All data produced by BehaviorSim is entirely synthetic. It is generated from mathematical state machines and parametric distributions specified by configuration files or preset defaults.

Domain Presets Are Not Validated Real-World Models: Built-in presets for education, finance, healthcare, and mobile_app are illustrative scenario generators constructed for software testing, algorithm prototyping, and pipeline validation. They carry:

  • NO clinical or medical validation: The healthcare preset must not be used as clinical evidence or diagnostic validation.
  • NO financial or market predictive validity: The finance preset is not financial advice or econometric forecasting.
  • NO educational efficacy certification: The education preset is a synthetic benchmark, not pedagogical validation.

Researchers and engineers must calibrate transition probabilities and emission parameters against empirical domain datasets before drawing real-world scientific conclusions.