fmcs  v0.2.1
Probability< typename, O, Ts > Struct Template Reference

Computes the empirical probability of an event. More...

#include "query.hpp"

Public Member Functions

void clear ()
 
double emit ()
 
void update (record_t< DTypes< Ts... >> &r, O output, double weight, inf_options_t opts)
 

Public Attributes

double denom
 
double num
 
sat_t< Ts... > sat
 

Detailed Description

template<typename, typename O, typename... Ts>
struct Probability< typename, O, Ts >

Computes the empirical probability of an event.

Suppose \(f: r<\prod_n D_n> \rightarrow bool\) computes if a sampled record satisfies a condition \(c\). This queryer computes \(\Pr(c) \approx (\sum_r f(r) \exp w(r)) / (\sum_r \exp w(r)) \) in a single pass with constant memory, where \( w(r) = \log \sum_a p(r(a))\). With large negative log probabilities of records this method may exhibit underflow.


The documentation for this struct was generated from the following file: