Constructor
import std.random; import std.range; class MyVarianceGammaRNG : NormalVarianceMeanMixtureRNG!double { this(double shape, double scale, double beta) { auto components = GammaSRNG!double(rndGen, shape, scale); super(rndGen, components.toDistributionRNG, beta); } } auto rng = new MyVarianceGammaRNG(1.2, 10, 3); auto sample = rng.take(10).array;
Class to create normal variance-mean mixture random number generators. Assume U has mixing probability density, Y ~ N(0, 1). Class constructs RNG for Z = Y*U^(1/2)+beta*U.