29 #define GIBBS_SAMPLING_DEFAULT_EPSILON std::exp(-1.6) 30 #define GIBBS_SAMPLING_DEFAULT_MIN_EPSILON_RATE std::exp(-5) 31 #define GIBBS_SAMPLING_DEFAULT_BURNIN 300 33 #define GIBBS_SAMPLING_POURCENT_DRAWN_SAMPLE 50 // percent drawn 34 #define GIBBS_SAMPLING_DRAWN_AT_RANDOM true 39 template <
typename GUM_SCALAR >
44 &this->hardEvidence(),
55 template <
typename GUM_SCALAR >
61 template <
typename GUM_SCALAR >
67 template <
typename GUM_SCALAR >
70 if (this->
burnIn() == 0)
return Ip;
75 Ip = this->
_draw(&w, Ip);
82 template <
typename GUM_SCALAR >
~GibbsSampling() override
Destructor.
GibbsSampling(const IBayesNet< GUM_SCALAR > *bn)
Default constructor.
void setBurnIn(Size b)
Number of burn in for one iteration.
Class representing the minimal interface for Bayesian Network.
Instantiation _draw(GUM_SCALAR *w, Instantiation prev) override
draws a sample given previous one according to Gibbs sampling
gum is the global namespace for all aGrUM entities
void setMinEpsilonRate(double rate)
Given that we approximate f(t), stopping criterion on d/dt(|f(t+1)-f(t)|).
#define GIBBS_SAMPLING_DEFAULT_BURNIN
#define GIBBS_SAMPLING_DEFAULT_MIN_EPSILON_RATE
<agrum/BN/inference/gibbsSampling.h>
#define GIBBS_SAMPLING_DEFAULT_EPSILON
Instantiation nextSample(Instantiation prev)
draws next sample of Gibbs sampling
#define GIBBS_SAMPLING_POURCENT_DRAWN_SAMPLE
Size burnIn() const
Returns the number of burn in.
Instantiation _monteCarloSample()
draws a Monte Carlo sample
Class for assigning/browsing values to tuples of discrete variables.
This file contains Gibbs sampling class definition.
Instantiation monteCarloSample()
draws a Monte Carlo sample
void setEpsilon(double eps)
Given that we approximate f(t), stopping criterion on |f(t+1)-f(t)|.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
#define GIBBS_SAMPLING_DRAWN_AT_RANDOM
Instantiation _burnIn() override
draws a defined number of samples without updating the estimators
class containing all variables and methods required for Gibbssampling