Table of Contents

Class StochasticState

Namespace
Virtufin.Base.Execution
Assembly
Virtufin.Base.dll

State for stochastic executors — a seeded PRNG. Deterministic given the seed, reproducible across runs. Mutable: the PRNG seed evolves as the executor steps.

public sealed class StochasticState : IExecutionState
Inheritance
StochasticState
Implements
Inherited Members

Constructors

StochasticState(int)

Construct a stochastic state from a seed.

public StochasticState(int seed)

Parameters

seed int

Initial PRNG seed.

Properties

Seed

Current PRNG seed (mutable).

public int Seed { get; set; }

Property Value

int

Methods

NextNormal(double, double)

Generate a normally-distributed value via Box-Muller (approximate).

public double NextNormal(double mean = 0, double stddev = 1)

Parameters

mean double
stddev double

Returns

double

NextRandom()

Simple linear-congruential PRNG step.

public int NextRandom()

Returns

int

NextUnit()

Generate a uniform random number in [0, 1).

public double NextUnit()

Returns

double