ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
Loading...
Searching...
No Matches
inverse_gamma.cpp File Reference

InvGamma(α, β) family implementation: shape α > 0, scale β > 0. More...

#include "DistributionCommon.h"
#include <algorithm>
#include <cmath>
#include <memory>
#include <optional>
#include <random>
#include <string>
#include <utility>
#include <vector>
Include dependency graph for inverse_gamma.cpp:

Go to the source code of this file.

Namespaces

namespace  provsql

Detailed Description

InvGamma(α, β) family implementation: shape α > 0, scale β > 0.

The distribution of 1/Y for Y ~ Gamma(shape α, rate β): the conjugate prior for a Gaussian variance and a common heavy-tailed model for positive quantities. The CDF is the regularised upper incomplete gamma \(Q(α, β/x)\), so it reuses the same gammaP kernel as Gamma; raw moments E[X^k] = β^k Γ(α-k)/Γ(α) are infinite for α <= k and reported honestly as +Infinity (the mean for α <= 1, the variance for α <= 2) rather than estimated. Positive scalings rescale β (scale family); the quantile / truncated-moment paths decline (no elementary inverse CDF) and fall through to the numeric bisection / Monte Carlo, exactly as Gamma does.

Self-contained family implementation: the class is file-local and reaches the evaluators only through the registrars at the bottom (DistributionRegistry factory). No evaluator or parser code changes.

Definition in file inverse_gamma.cpp.