s of the generalized inverse Gaussian distribution.

  1. Tuple!(T, "lambda", T, "chi", T, "psi") generalizedInverseGaussianEstimate(T[] sample, T relTolerance, T absTolerance)
    Tuple!(T, "lambda", T, "chi", T, "psi")
    generalizedInverseGaussianEstimate
    (
    T
    )
    (
    in T[] sample
    ,
    in T relTolerance = sqrt(T.epsilon)
    ,
    in T absTolerance = sqrt(T.epsilon)
    )
    if (
    isFloatingPoint!T
    )
  2. Tuple!(T, "lambda", T, "chi", T, "psi") generalizedInverseGaussianEstimate(T[] sample, T[] weights, T relTolerance, T absTolerance)
  3. Tuple!(T, "lambda", T, "chi", T, "psi") generalizedInverseGaussianEstimate(GeneralizedInverseGaussinStatistic!T stat, T relTolerance, T absTolerance)

Parameters

sample T[]

obeservation.

relTolerance T

Relative tolerance.

absTolerance T

Absolute tolerance.

Preconditions: ax and bx shall be finite reals.
relTolerance shall be normal positive real.
absTolerance shall be normal positive real no less then T.epsilon*2.

References: "Algorithms for Minimization without Derivatives", Richard Brent, Prentice-Hall, Inc. (1973)

Examples

import std.range;
import std.random;
import atmosphere.random;
import atmosphere.likelihood;
import atmosphere.params;
auto length = 1000;
auto lambda = -2.0, chi = 1.4, psi = 2.3;
auto rng = Random(1234);
auto sample = new GeneralizedInverseGaussianRNG!double(rng, lambda, chi, psi).take(length).array;
auto params1 = generalizedInverseGaussianEstimate(sample);
auto params2 = generalizedInverseGaussianFixedLambdaEstimate!double(lambda, sample);
auto p0 = GIGChiPsi!double(chi, psi);
auto p1 = GIGChiPsi!double(params1.chi, params1.psi);
auto p2 = GIGChiPsi!double(params2.chi, params2.psi);
auto lh0 = properGeneralizedInverseGaussianLikelihood(lambda, p0.eta, p0.omega, sample);
auto lh1 = properGeneralizedInverseGaussianLikelihood(params1.lambda, p1.eta, p1.omega, sample);
auto lh2 = properGeneralizedInverseGaussianLikelihood(lambda, p2.eta, p2.omega, sample);
assert(lh0 <= lh1);
assert(lh0 <= lh2);
assert(lh2 <= lh1);
import std.range;
import std.random;
import atmosphere.random;
import atmosphere.likelihood;
import atmosphere.params;
auto length = 1000;
auto lambda = -2.0, chi = 1.4, psi = 2.3;
auto rng = Random(1234);
auto sample = new GeneralizedInverseGaussianRNG!double(rng, lambda, chi, psi).take(length).array;
auto weights = iota(1.0, length + 1.0).array;
auto params1 = generalizedInverseGaussianEstimate!double(sample, weights);
auto params2 = generalizedInverseGaussianFixedLambdaEstimate!double(lambda, sample, weights);
auto p0 = GIGChiPsi!double(chi, psi);
auto p1 = GIGChiPsi!double(params1.chi, params1.psi);
auto p2 = GIGChiPsi!double(params2.chi, params2.psi);
auto lh0 = properGeneralizedInverseGaussianLikelihood(lambda, p0.eta, p0.omega, sample, weights);
auto lh1 = properGeneralizedInverseGaussianLikelihood(params1.lambda, p1.eta, p1.omega, sample, weights);
auto lh2 = properGeneralizedInverseGaussianLikelihood(lambda, p2.eta, p2.omega, sample, weights);
assert(lh0 <= lh1);
assert(lh0 <= lh2);
assert(lh2 <= lh1);

See Also

atmosphere.params

Meta

Source

See Implementation

Continue to overload