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

Entropy / KL divergence / mutual information readouts. More...

#include "InformationTheory.h"
#include "CircuitFromMMap.h"
#include "ConjugatePosterior.h"
#include "Expectation.h"
#include "MonteCarloSampler.h"
#include "PivotIntegration.h"
#include "RandomVariable.h"
#include "distributions/Distribution.h"
#include "provsql_utils_cpp.h"
#include "postgres.h"
#include "fmgr.h"
#include "utils/uuid.h"
#include "provsql_utils.h"
#include "provsql_error.h"
#include <algorithm>
#include <cmath>
#include <functional>
#include <map>
#include <memory>
#include <set>
#include <string>
#include <vector>
Include dependency graph for InformationTheory.cpp:

Go to the source code of this file.

Namespaces

namespace  provsql

Functions

double provsql::computeEntropy (const GenericCircuit &gc, gate_t root, std::optional< gate_t > event)
 Entropy of root in nats: Shannon for a discrete view, differential for a continuous one.
double provsql::computeKL (const GenericCircuit &gc, gate_t p_root, gate_t q_root)
 Kullback-Leibler divergence KL(P || Q) in nats.
double provsql::computeMutualInformation (const GenericCircuit &gc, gate_t x_root, gate_t y_root)
 Mutual information I(X; Y) in nats: exactly 0 for structurally independent roots, H(X) / Infinity for identical discrete / continuous roots, and the 2-D histogram plug-in estimate over coupled joint draws otherwise.
Datum rv_entropy (PG_FUNCTION_ARGS)
 SQL: rv_entropy(token uuid, prov uuid) -> float8.
Datum rv_kl (PG_FUNCTION_ARGS)
 SQL: rv_kl(p uuid, q uuid) -> float8.
Datum rv_mutual_information (PG_FUNCTION_ARGS)
 SQL: rv_mutual_information(x uuid, y uuid) -> float8.

Detailed Description

Entropy / KL divergence / mutual information readouts.

Definition in file InformationTheory.cpp.

Function Documentation

◆ rv_entropy()

Datum rv_entropy ( PG_FUNCTION_ARGS )

SQL: rv_entropy(token uuid, prov uuid) -> float8.

Definition at line 393 of file InformationTheory.cpp.

Here is the call graph for this function:

◆ rv_kl()

Datum rv_kl ( PG_FUNCTION_ARGS )

SQL: rv_kl(p uuid, q uuid) -> float8.

Definition at line 420 of file InformationTheory.cpp.

Here is the call graph for this function:

◆ rv_mutual_information()

Datum rv_mutual_information ( PG_FUNCTION_ARGS )

SQL: rv_mutual_information(x uuid, y uuid) -> float8.

Definition at line 441 of file InformationTheory.cpp.

Here is the call graph for this function: