GIG statistica.
Relative tolerance.
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)
import std.range; import std.random; import atmosphere.random; import atmosphere.likelihood; auto length = 1000; auto lambda = -2.0, eta = 1.4, omega = 2.3; auto rng = Random(1234); auto sample = ProperGeneralizedInverseGaussianSRNG!double(rng, lambda, eta, omega).take(length).array; auto params1 = properGeneralizedInverseGaussianEstimate(sample); auto params2 = properGeneralizedInverseGaussianFixedLambdaEstimate!double(lambda, sample); auto lh0 = properGeneralizedInverseGaussianLikelihood(lambda, eta, omega, sample); auto lh1 = properGeneralizedInverseGaussianLikelihood(params1.lambda, params1.eta, params1.omega, sample); auto lh2 = properGeneralizedInverseGaussianLikelihood(lambda, params2.eta, params2.omega, sample); assert(lh0 <= lh1); assert(lh0 <= lh2); assert(lh2 <= lh1);
import std.range; import std.random; import atmosphere.random; import atmosphere.likelihood; auto length = 1000; auto lambda = -2.0, eta = 1.4, omega = 2.3; auto rng = Random(1234); auto sample = ProperGeneralizedInverseGaussianSRNG!double(rng, lambda, eta, omega).take(length).array; auto weights = iota(1.0, length + 1.0).array; auto params1 = properGeneralizedInverseGaussianEstimate!double(sample, weights); auto params2 = properGeneralizedInverseGaussianFixedLambdaEstimate!double(lambda, sample, weights); auto lh0 = properGeneralizedInverseGaussianLikelihood(lambda, eta, omega, sample, weights); auto lh1 = properGeneralizedInverseGaussianLikelihood(params1.lambda, params1.eta, params1.omega, sample, weights); auto lh2 = properGeneralizedInverseGaussianLikelihood(lambda, params2.eta, params2.omega, sample, weights); assert(lh0 <= lh1); assert(lh0 <= lh2); assert(lh2 <= lh1);
atmosphere.params
Estimates parameters of the proper generalized inverse Gaussian distribution.