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

Implementation of the conjugate-posterior recogniser. More...

#include "ConjugatePosterior.h"
#include "Circuit.h"
#include "distributions/Distribution.h"
#include <cmath>
#include <cstring>
#include <vector>
#include "provsql_utils.h"
Include dependency graph for ConjugatePosterior.cpp:

Go to the source code of this file.

Namespaces

namespace  provsql

Functions

std::optional< DistributionSpecprovsql::conjugatePosterior (const GenericCircuit &gc, gate_t target, gate_t evidence)
 The exact posterior of target given evidence, as a resolved distribution spec, when the circuit matches the conjugate shape; std::nullopt on any mismatch (the caller falls back to importance sampling).
std::optional< double > provsql::conjugateLogEvidence (const GenericCircuit &gc, gate_t evidence)
 The exact log marginal likelihood \(\ln P(\mathrm{data})\) of a conjugate-shaped evidence circuit; std::nullopt on any shape mismatch or when a rule in the fold has no predictive density (the caller keeps the Monte Carlo mean-weight path).

Detailed Description

Implementation of the conjugate-posterior recogniser.

Definition in file ConjugatePosterior.cpp.