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, T epsRel, T epsAbs)

Constructor

Members

Functions

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

Examples

import atmosphere;

class MyGeneralizedHyperbolicCDF(T) : NormalVarianceMeanMixtureCDF!T
{
	this(T lambda, GHypEtaOmega!T params, T mu)
	{
		with(params)
		{
			auto pdf = ProperGeneralizedInverseGaussianSPDF!T(lambda, eta, omega);
			auto mean = properGeneralizedInverseGaussianMean(lambda, eta, omega);
			super(pdf.toPDF, params.beta, mu, [mean]);				
		}
	}
}

immutable double lambda = 2;
immutable double mu = 0.3;
immutable params = GHypEtaOmega!double(2, 3, 4);
auto cghyp = new GeneralizedHyperbolicCDF!double(lambda, params.alpha, params.beta, params.delta, mu);
auto cnvmm = new MyGeneralizedHyperbolicCDF!double(lambda, params, mu);
foreach(i; [-100, 10, 0, 10, 100])
	assert(approxEqual(cghyp(i), cnvmm(i)));

Meta