generalizedGammaFixedPowerEstimate

Estimates parameters of the generalized gamma distribution.

  1. Tuple!(T, "shape", T, "scale") generalizedGammaFixedPowerEstimate(T power, T[] sample)
  2. Tuple!(T, "shape", T, "scale") generalizedGammaFixedPowerEstimate(T power, T[] sample, T[] weights)
  3. Tuple!(T, "shape", T, "scale") generalizedGammaFixedPowerEstimate(T power, GeneralizedGammaFixedPowerStatistic!T stat)
    Tuple!(T, "shape", T, "scale")
    generalizedGammaFixedPowerEstimate
    (
    T
    )
    if (
    isFloatingPoint!T
    )

Examples

import std.range;
import std.random;
import atmosphere.random;
import atmosphere.likelihood;
size_t length = 1000;
auto shape = 2.0, power = 1.4, scale = 2.3;
auto rng = Random(1234);
auto sample = GeneralizedGammaSRNG!double(rng, shape, power, scale).take(length).array;
auto params = generalizedGammaFixedPowerEstimate!double(power, sample);
auto lh0 = generalizedGammaLikelihood(shape, power, scale, sample);
auto lh1 = generalizedGammaLikelihood(params.shape, power, params.scale, sample);
assert(lh0 <= lh1);
import std.range;
import std.random;
import atmosphere.random;
import atmosphere.likelihood;
size_t length = 1000;
auto shape = 2.0, power = 1.4, scale = 2.3;
auto rng = Random(1234);
auto sample = GeneralizedGammaSRNG!double(rng, shape, power, scale).take(length).array;
auto weights = iota(1.0, length + 1.0).array;
auto params = generalizedGammaFixedPowerEstimate!double(power, sample, weights);
auto lh0 = generalizedGammaLikelihood(shape, power, scale, sample, weights);
auto lh1 = generalizedGammaLikelihood(params.shape, power, params.scale, sample, weights);
assert(lh0 <= lh1);

Meta