import mir.test: shouldApprox; 2.0.gammaPDF(3.0).shouldApprox == 0.2706706; 2.0.gammaPDF(3.0, 4.0).shouldApprox == 0.01895408; // Calling with `size_t` uses factorial function instead of gamma, but // produces same results 2.0.gammaPDF(3).shouldApprox == 2.0.gammaPDF(3.0); 2.0.gammaPDF(3, 4.0).shouldApprox == 2.0.gammaPDF(3.0, 4.0);
Computes the gamma probability density function (PDF).
shape values less than 1 are supported when it is a floating point type.
If shape is passed as a size_t type (or a type convertible to that), then the PDF is calculated using the relationship with the poisson distribution (i.e. replacing the gamma function with the factorial).