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(UniformRNG rng, DistributionRNG!T components, T beta)

Constructor

Members

Functions

front
T front()
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

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;

Meta