prime-diffusion 1.1.1

Diffusion systems — Gray-Scott reaction-diffusion, cellular automata
Documentation
  • Coverage
  • 100%
    5 out of 5 items documented4 out of 4 items with examples
  • Size
  • Source code size: 14.56 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.3 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 13s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • bwyard/prime
    1 0 3
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • bwyard

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 process
  • gbm_step / gbm_step_seeded — Geometric Brownian Motion

Usage

use prime_diffusion::{ou_step_seeded, gbm_step_seeded};

// Ornstein-Uhlenbeck — mean-reverting random walk (useful for AI behavior, price simulation)
// Returns (next_value, next_seed)
let (x_next, seed_next) = ou_step_seeded(x, mu, theta, sigma, dt, seed);

// Geometric Brownian Motion — multiplicative random walk (asset prices, population growth)
let (x_next, seed_next) = gbm_step_seeded(x, mu, sigma, dt, seed);

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