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

Internal helpers shared by the per-family Distribution implementations under src/distributions/. More...

#include <cmath>
#include <limits>
#include "Distribution.h"
Include dependency graph for DistributionCommon.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  provsql::BaseDistribution
 Base holding the two parameters; subclasses add closed forms. More...

Namespaces

namespace  provsql

Functions

double provsql::binomial_coeff (unsigned n, unsigned k)
 C(n, k) as a double (exact for the small moment orders used here).
double provsql::lbeta (double a, double b)
 ln B(a, b) = lnΓ(a) + lnΓ(b) − lnΓ(a+b), for a, b > 0.
double provsql::phi (double z)
 Standard normal pdf φ(z) = exp(-z²/2)/√(2π).
double provsql::Phi (double z)
 Standard normal CDF Φ(z) = ½(1 + erf(z/√2)).
double provsql::inv_phi (double p)
 Inverse standard-normal CDF, Beasley-Springer-Moro (1995).
double provsql::gammaP (double a, double x)
 Regularised lower incomplete gamma \(P(a, x) = \gamma(a, x) / \Gamma(a)\) for a > 0, x >= 0.

Variables

constexpr double provsql::kNaN = std::numeric_limits<double>::quiet_NaN()
constexpr double provsql::kInf = std::numeric_limits<double>::infinity()

Detailed Description

Internal helpers shared by the per-family Distribution implementations under src/distributions/.

Not part of the public Distribution interface – include only from the family implementation files.

Definition in file DistributionCommon.h.