57 template < GUM_Numeric GUM_SCALAR >
66 this->
setEpsilon(conf.typed<
double >(
"gibbs",
"epsilon"));
72 template < GUM_Numeric GUM_SCALAR >
77 template < GUM_Numeric GUM_SCALAR >
82 template < GUM_Numeric GUM_SCALAR >
92 Ip = this->
draw_(&w, Ip);
99 template < GUM_Numeric GUM_SCALAR >
105 template < GUM_Numeric GUM_SCALAR >
110 template < GUM_Numeric GUM_SCALAR >
This file contains Gibbs sampling class definition.
static Size sizeFromConfiguration_(const std::string §ion, const std::string &key)
Read a non negative integer key of gum::Configuration.
void setMinEpsilonRate(double rate) override
Given that we approximate f(t), stopping criterion on d/dt(|f(t+1)-f(t)|).
Size burn_in_
Number of iterations before checking stopping criteria.
void setEpsilon(double eps) override
Given that we approximate f(t), stopping criterion on |f(t+1)-f(t)|.
static Configuration & instance()
The global configuration.
Instantiation nextSample(Instantiation prev)
draws next sample of Gibbs sampling
Instantiation monteCarloSample()
draws a first sample with a positive probability (starting point of a Gibbs chain)
GibbsOperator(const IBayesNet< GUM_SCALAR > &BN, const NodeProperty< Idx > *hardEv, Size nbr=1, bool atRandom=false)
constructor
void updateSamplingNodes_()
~GibbsSampling() override
Destructor.
Instantiation draw_(GUM_SCALAR *w, Instantiation prev) override
draws a sample given previous one according to Gibbs sampling
Instantiation burnIn_() override
draws a defined number of samples without updating the estimators
Instantiation monteCarloSample_()
draws a Monte Carlo sample
void setBurnIn(Size b)
Number of burn in for one iteration.
Size burnIn() const
Returns the number of burn in.
GibbsSampling(const IBayesNet< GUM_SCALAR > *bn)
Default constructor.
const NodeProperty< Idx > & hardEvidence() const
indicate for each node with hard evidence which value it took
Class representing the minimal interface for Bayesian network with no numerical data.
Class for assigning/browsing values to tuples of discrete variables.
SamplingInference(const IBayesNet< GUM_SCALAR > *bn)
default constructor
Typed, documented, sectioned configuration singleton read from an .ini content.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
gum is the global namespace for all aGrUM entities