NormalVarianceMeanMixtureRNG

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.

class NormalVarianceMeanMixtureRNG : DistributionRNG!T(
T
UniformRNG = Random
) if (
isFloatingPoint!T
) {}

Constructors

this
this(ref UniformRNG rng, DistributionRNG!T components, T beta)

Constructor

Examples

1 import std.random;
2 import std.range;
3 class MyVarianceGammaRNG : NormalVarianceMeanMixtureRNG!double
4 {
5 	this(double shape, double scale, double beta)
6 	{
7 		auto components = GammaSRNG!double(rndGen, shape, scale);
8 		super(rndGen, components.toDistributionRNG, beta);
9 	}
10 }
11 auto rng = new MyVarianceGammaRNG(1.2, 10, 3);
12 auto sample = rng.take(10).array;

Meta