GeneralizedVarianceGammaCDF

Generalized variance-gamma (generalized gamma mixture of normals) CDF. Unstable algorithm.

final
class GeneralizedVarianceGammaCDF : NormalVarianceMeanMixtureCDF!T(
T
) {}

Constructors

this
this(T shape, T power, T scale, T beta, T mu)

Constructor

Examples

auto cdf = new GeneralizedVarianceGammaCDF!double(3, 2, 4, 5, 6);
auto x = cdf(0.1);
assert(isNormal(x));
1 final class MyGeneralizedVarianceGammaCDF(T): NumericCDF!T
2 {
3 	this(T shape, T power, T scale, T beta, T mu)
4 	{
5 		auto pdf = new GeneralizedVarianceGammaPDF!T(shape, power, scale, beta, mu);
6 		immutable mean = mu + generalizedVarianceGammaMean(shape, power, scale, beta);
7 		super(pdf, [mean]);	
8 	}
9 }
10 immutable double shape = 2, power = 1.2, scale = 0.3, beta = 3, mu = -1;
11 auto p0 = new GeneralizedVarianceGammaCDF!double(shape, power, scale, beta, mu);
12 auto p1 = new MyGeneralizedVarianceGammaCDF!double(shape, power, scale, beta, mu);
13 foreach(i; 0..10)
14 	assert(approxEqual(p0(i), p1(i)));

Meta