prime-diffusion
Stochastic diffusion processes — Ornstein-Uhlenbeck and Geometric Brownian Motion, with seeded and unseeded variants.
Part of the prime math ecosystem.
What's inside
ou_step/ou_step_seeded— Ornstein-Uhlenbeck mean-reverting processgbm_step/gbm_step_seeded— Geometric Brownian Motion
Usage
use ;
// Ornstein-Uhlenbeck — mean-reverting random walk (useful for AI behavior, price simulation)
// Returns (next_value, next_seed)
let = ou_step_seeded;
// Geometric Brownian Motion — multiplicative random walk (asset prices, population growth)
let = gbm_step_seeded;
Design
Seeded variants use prime-random to thread noise deterministically. Unseeded variants accept a pre-sampled Wiener increment w for integration with external noise sources.
License
MIT