NormalVarianceMeanMixtureCDF

Variance-mean mixture of normals. Unstable algorithm.

abstract
class NormalVarianceMeanMixtureCDF : CDF!T(
T
) if (
isFloatingPoint!T
) {}

Constructors

this
this(PDF!T pdf, T beta, T mu, T[] subdivisions = null, T epsRel = 1e-6, T epsAbs = 0)

Constructor

Examples

1 import atmosphere;
2 
3 class MyGeneralizedHyperbolicCDF(T) : NormalVarianceMeanMixtureCDF!T
4 {
5 	this(T lambda, GHypEtaOmega!T params, T mu)
6 	{
7 		with(params)
8 		{
9 			auto pdf = ProperGeneralizedInverseGaussianSPDF!T(lambda, eta, omega);
10 			auto mean = properGeneralizedInverseGaussianMean(lambda, eta, omega);
11 			super(pdf.toPDF, params.beta, mu, [mean]);				
12 		}
13 	}
14 }
15 
16 immutable double lambda = 2;
17 immutable double mu = 0.3;
18 immutable params = GHypEtaOmega!double(2, 3, 4);
19 auto cghyp = new GeneralizedHyperbolicCDF!double(lambda, params.alpha, params.beta, params.delta, mu);
20 auto cnvmm = new MyGeneralizedHyperbolicCDF!double(lambda, params, mu);
21 foreach(i; [-100, 10, 0, 10, 100])
22 	assert(approxEqual(cghyp(i), cnvmm(i)));

Meta