ProperGeneralizedInverseGaussianSRNG

Class to generate random observations from a proper (chi > 0, psi > 0) generalized inverse Gaussian distribution. The algorithm is based on that given by Dagpunar (1989).

References: Original R source code.

struct ProperGeneralizedInverseGaussianSRNG (
T
UniformRNG = Random
) if (
isFloatingPoint!T
) {}

Constructors

this
this(ref UniformRNG rng, T lambda, T eta, T omega)

Constructor

Members

Functions

front
T front()

Manifest constants

empty
enum empty;

Static functions

popFront
void popFront()

Examples

import std.algorithm : map;
import std.range;
auto rng = ProperGeneralizedInverseGaussianSRNG!double(rndGen, -2, 5.0, 2);
auto sample = rng.map!(x => x + 4).take(9).array;

Meta