![]() |
ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
|
NegativeBinomial(r, p) family implementation (discrete). More...
#include "DistributionCommon.h"#include <cmath>#include <memory>#include <optional>#include <random>#include <string>#include <utility>
Go to the source code of this file.
Namespaces | |
| namespace | provsql |
NegativeBinomial(r, p) family implementation (discrete).
Number of failures before the r-th success, support {0, 1, 2, ...}, pmf(k) = C(k+r-1, k) p^r (1-p)^k (r real > 0 via the gamma form) – the same convention as the literal provsql.negative_binomial constructor. Only ever instantiated for a latent leaf provsql.negative_binomial(integer, random_variable); reached by sample(), by observe (weight = pmf at the datum), and the moment readouts. Self-contained: registered at the bottom.
Definition in file negative_binomial.cpp.