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

Gamma(k, λ) family implementation (shape k any positive real, rate λ). More...

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

Go to the source code of this file.

Namespaces

namespace  provsql

Detailed Description

Gamma(k, λ) family implementation (shape k any positive real, rate λ).

The general-shape counterpart of Erlang: the SQL constructor routes integer shapes through provsql.erlang, so a gamma leaf always carries a non-integer (or sub-1) shape here. The CDF is the regularised lower incomplete gamma \(P(k, \lambda x)\) (series / continued fraction); Chi-squared is the SQL-level sugar gamma(k/2, 1/2).

Self-contained family implementation: the class is file-local and reaches the evaluators only through the registrars at the bottom (DistributionRegistry factory + closure rule). First family added under the per-family layout – no evaluator or parser code changes.

Definition in file gamma.cpp.