queso-0.50.1
MLSampling.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // QUESO - a library to support the Quantification of Uncertainty
5 // for Estimation, Simulation and Optimization
6 //
7 // Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 #ifndef UQ_MULTI_LEVEL_SAMPLING_H
26 #define UQ_MULTI_LEVEL_SAMPLING_H
27 
28 #define ML_NEW_CODE_2009_12_29
29 
30 #include <queso/MLSamplingOptions.h>
31 #include <queso/MetropolisHastingsSG.h>
32 #include <queso/FiniteDistribution.h>
33 #include <queso/VectorRV.h>
34 #include <queso/GenericVectorRV.h>
35 #include <queso/VectorSpace.h>
36 #include <queso/MarkovChainPositionData.h>
37 #include <queso/ScalarFunctionSynchronizer.h>
38 #include <queso/SequenceOfVectors.h>
39 #include <queso/ArrayOfSequences.h>
40 #ifdef QUESO_HAS_GLPK
41 #include <glpk.h>
42 #endif
43 #include <sys/time.h>
44 #include <fstream>
45 
46 #define ML_CHECKPOINT_FIXED_AMOUNT_OF_DATA 6
47 
48 //---------------------------------------------------------
49 
50 namespace QUESO {
51 
52 // aqui 1
53 #ifdef QUESO_HAS_GLPK
54 struct BIP_routine_struct {
55  const BaseEnvironment* env;
56  unsigned int currLevel;
57 };
58 
59 void BIP_routine(glp_tree *tree, void *info);
60 #endif
61 
62 //---------------------------------------------------------
63 
65 {
69  unsigned int numberOfPositions;
70 };
71 
72 //---------------------------------------------------------
73 
74 template <class P_V>
76 {
77  P_V* initialPosition; // KEY new: add logPrior and logLikelihood
78  unsigned int numberOfPositions;
79 };
80 
81 template <class P_V>
83 {
84  std::vector<BalancedLinkedChainControlStruct<P_V> > balLinkedChains;
85 };
86 
87 //---------------------------------------------------------
88 
90 {
91  unsigned int initialPositionIndexInPreviousChain; // KEY new: add logPrior and logLikelihood
92  unsigned int numberOfPositions;
93 };
94 
96 {
97  std::vector<UnbalancedLinkedChainControlStruct> unbLinkedChains;
98 };
99 
100 //---------------------------------------------------------
101 
102 //---------------------------------------------------------
112  /* If options request data to be written in the output file (MATLAB .m format
113  * only, for now), the user can check which MATLAB variables are defined and set by running
114  * 'grep zeros <OUTPUT FILE NAME>' after the solution procedures ends.
115  * The names of the variables are chosen to be self explanatory. */
116 
117 template <class P_V,class P_M>
119 {
120 public:
122 
123 
128  MLSampling( const char* prefix, const BaseVectorRV <P_V,P_M>& priorRv, const BaseScalarFunction<P_V,P_M>& likelihoodFunction);
132  ~MLSampling();
134 
136 
161  void generateSequence (BaseVectorSequence<P_V,P_M>& workingChain,
162  ScalarSequence<double>* workingLogLikelihoodValues,
163  ScalarSequence<double>* workingLogTargetValues);
164 
166 
167  double logEvidence () const;
168 
170 
171  double meanLogLikelihood() const;
172 
174 
191  double eig () const;
193 
195 
196 
198  void print (std::ostream& os) const;
200 
201 
202  friend std::ostream& operator<<(std::ostream& os,
203  const MLSampling<P_V,P_M>& obj) {
204  obj.print(os);
205  return os;
206  }
207 
208 private:
210 
212  void checkpointML (double currExponent, // input
213  double currEta, // input
214  const SequenceOfVectors<P_V,P_M>& currChain, // input
215  const ScalarSequence<double>& currLogLikelihoodValues, // input
216  const ScalarSequence<double>& currLogTargetValues); // input
217 
219 
222  void restartML (double& currExponent, // output
223  double& currEta, // output
224  SequenceOfVectors<P_V,P_M>& currChain, // output
225  ScalarSequence<double>& currLogLikelihoodValues, // output
226  ScalarSequence<double>& currLogTargetValues); // output
227 
229 
231  void generateSequence_Level0_all (const MLSamplingLevelOptions& currOptions, // input
232  unsigned int& unifiedRequestedNumSamples, // output
233  SequenceOfVectors<P_V,P_M>& currChain, // output
234  ScalarSequence<double>& currLogLikelihoodValues, // output
235  ScalarSequence<double>& currLogTargetValues); // output
236 
238 
241  void generateSequence_Step01_inter0(const MLSamplingLevelOptions* currOptions, // input
242  unsigned int& unifiedRequestedNumSamples); // output
243 
245 
249  void generateSequence_Step02_inter0(const MLSamplingLevelOptions* currOptions, // input
250  SequenceOfVectors<P_V,P_M>& currChain, // input/output
251  ScalarSequence<double>& currLogLikelihoodValues, // input/output
252  ScalarSequence<double>& currLogTargetValues, // input/output
253  SequenceOfVectors<P_V,P_M>& prevChain, // output
254  ScalarSequence<double>& prevLogLikelihoodValues, // output
255  ScalarSequence<double>& prevLogTargetValues, // output
256  unsigned int& indexOfFirstWeight, // output
257  unsigned int& indexOfLastWeight); // output
258 
260 
263  void generateSequence_Step03_inter0(const MLSamplingLevelOptions* currOptions, // input
264  const ScalarSequence<double>& prevLogLikelihoodValues, // input
265  double prevExponent, // input
266  double failedExponent, // input // gpmsa1
267  double& currExponent, // output
268  ScalarSequence<double>& weightSequence); // output
269 
271 
274  void generateSequence_Step04_inter0(const SequenceOfVectors<P_V,P_M>& prevChain, // input
275  const ScalarSequence<double>& weightSequence, // input
276  P_M& unifiedCovMatrix); // output
277 
279 
282  void generateSequence_Step05_inter0(unsigned int unifiedRequestedNumSamples, // input
283  const ScalarSequence<double>& weightSequence, // input
284  std::vector<unsigned int>& unifiedIndexCountersAtProc0Only, // output
285  std::vector<double>& unifiedWeightStdVectorAtProc0Only); // output
286 
288 
291  void generateSequence_Step06_all (const MLSamplingLevelOptions* currOptions, // input
292  unsigned int indexOfFirstWeight, // input
293  unsigned int indexOfLastWeight, // input
294  const std::vector<unsigned int>& unifiedIndexCountersAtProc0Only, // input
295  bool& useBalancedChains, // output
296  std::vector<ExchangeInfoStruct>& exchangeStdVec); // output
297 
299 
303  void generateSequence_Step07_inter0(bool useBalancedChains, // input
304  unsigned int indexOfFirstWeight, // input
305  unsigned int indexOfLastWeight, // input
306  const std::vector<unsigned int>& unifiedIndexCountersAtProc0Only, // input
307  UnbalancedLinkedChainsPerNodeStruct& unbalancedLinkControl, // (possible) output
308  const MLSamplingLevelOptions* currOptions, // input
309  const SequenceOfVectors<P_V,P_M>& prevChain, // input
310  std::vector<ExchangeInfoStruct>& exchangeStdVec, // (possible) input/output
311  BalancedLinkedChainsPerNodeStruct<P_V>& balancedLinkControl); // (possible) output
312 
314 
317  void generateSequence_Step08_all (BayesianJointPdf<P_V,P_M>& currPdf, // input/output
318  GenericVectorRV<P_V,P_M>& currRv); // output
319 
321 
325  void generateSequence_Step09_all (const SequenceOfVectors<P_V,P_M>& prevChain, // input
326  unsigned int indexOfFirstWeight, // input
327  unsigned int indexOfLastWeight, // input
328  const std::vector<double>& unifiedWeightStdVectorAtProc0Only, // input
329  const ScalarSequence<double>& weightSequence, // input
330  double prevEta, // input
331  const GenericVectorRV<P_V,P_M>& currRv, // input
332  MLSamplingLevelOptions* currOptions, // input (changed temporarily internally)
333  P_M& unifiedCovMatrix, // input/output
334  double& currEta); // output
335 
337 
340  void generateSequence_Step10_all (MLSamplingLevelOptions& currOptions, // input (changed temporarily internally)
341  const P_M& unifiedCovMatrix, // input
342  const GenericVectorRV <P_V,P_M>& currRv, // input
343  bool useBalancedChains, // input
344  const UnbalancedLinkedChainsPerNodeStruct& unbalancedLinkControl, // input // Round Rock
345  unsigned int indexOfFirstWeight, // input // Round Rock
346  const SequenceOfVectors<P_V,P_M>& prevChain, // input // Round Rock
347  const BalancedLinkedChainsPerNodeStruct<P_V>& balancedLinkControl, // input // Round Rock
348  SequenceOfVectors <P_V,P_M>& currChain, // output
349  double& cumulativeRawChainRunTime, // output
350  unsigned int& cumulativeRawChainRejections, // output
351  ScalarSequence <double>* currLogLikelihoodValues, // output
352  ScalarSequence <double>* currLogTargetValues); // output
353 
355 
359  void generateSequence_Step11_inter0(const MLSamplingLevelOptions* currOptions, // input
360  unsigned int unifiedRequestedNumSamples, // input
361  unsigned int cumulativeRawChainRejections, // input
362  SequenceOfVectors<P_V,P_M>& currChain, // input/output
363  ScalarSequence<double>& currLogLikelihoodValues, // input/output
364  ScalarSequence<double>& currLogTargetValues, // input/output
365  unsigned int& unifiedNumberOfRejections); // output
366 
369  void sampleIndexes_proc0 (unsigned int unifiedRequestedNumSamples, // input
370  const std::vector<double>& unifiedWeightStdVectorAtProc0Only, // input
371  std::vector<unsigned int>& unifiedIndexCountersAtProc0Only); // output
372 
375  bool decideOnBalancedChains_all (const MLSamplingLevelOptions* currOptions, // input
376  unsigned int indexOfFirstWeight, // input
377  unsigned int indexOfLastWeight, // input
378  const std::vector<unsigned int>& unifiedIndexCountersAtProc0Only, // input
379  std::vector<ExchangeInfoStruct>& exchangeStdVec); // output
380 
383  void prepareBalLinkedChains_inter0 (const MLSamplingLevelOptions* currOptions, // input
384  const SequenceOfVectors<P_V,P_M>& prevChain, // input
385  std::vector<ExchangeInfoStruct>& exchangeStdVec, // input/output
386  BalancedLinkedChainsPerNodeStruct<P_V>& balancedLinkControl); // output
387 
390  void prepareUnbLinkedChains_inter0 (unsigned int indexOfFirstWeight, // input
391  unsigned int indexOfLastWeight, // input
392  const std::vector<unsigned int>& unifiedIndexCountersAtProc0Only, // input
393  UnbalancedLinkedChainsPerNodeStruct& unbalancedLinkControl); // output
394 
397  void generateBalLinkedChains_all (MLSamplingLevelOptions& inputOptions, // input, only m_rawChainSize changes
398  const P_M& unifiedCovMatrix, // input
399  const GenericVectorRV <P_V,P_M>& rv, // input
400  const BalancedLinkedChainsPerNodeStruct<P_V>& balancedLinkControl, // input // Round Rock
401  SequenceOfVectors <P_V,P_M>& workingChain, // output
402  double& cumulativeRunTime, // output
403  unsigned int& cumulativeRejections, // output
404  ScalarSequence <double>* currLogLikelihoodValues, // output
405  ScalarSequence <double>* currLogTargetValues); // output
406 
409  void generateUnbLinkedChains_all (MLSamplingLevelOptions& inputOptions, // input, only m_rawChainSize changes
410  const P_M& unifiedCovMatrix, // input
411  const GenericVectorRV <P_V,P_M>& rv, // input
412  const UnbalancedLinkedChainsPerNodeStruct& unbalancedLinkControl, // input // Round Rock
413  unsigned int indexOfFirstWeight, // input // Round Rock
414  const SequenceOfVectors<P_V,P_M>& prevChain, // input // Round Rock
415  SequenceOfVectors <P_V,P_M>& workingChain, // output
416  double& cumulativeRunTime, // output
417  unsigned int& cumulativeRejections, // output
418  ScalarSequence <double>* currLogLikelihoodValues, // output
419  ScalarSequence <double>* currLogTargetValues); // output
420 
421 #ifdef QUESO_HAS_GLPK
422 
424  void solveBIP_proc0 (std::vector<ExchangeInfoStruct>& exchangeStdVec); // input/output
425 #endif
426 
429  void justBalance_proc0 (const MLSamplingLevelOptions* currOptions, // input
430  std::vector<ExchangeInfoStruct>& exchangeStdVec); // input/output
431 
434  void mpiExchangePositions_inter0 (const SequenceOfVectors<P_V,P_M>& prevChain, // input
435  const std::vector<ExchangeInfoStruct>& exchangeStdVec, // input
436  const std::vector<unsigned int>& finalNumChainsPerNode, // input
437  const std::vector<unsigned int>& finalNumPositionsPerNode, // input
438  BalancedLinkedChainsPerNodeStruct<P_V>& balancedLinkControl); // output
439 
440  // Private variables
443 
446 
449 
452 
455 
456  unsigned int m_numDisabledParameters; // gpmsa2
457 
458  std::vector<bool> m_parameterEnabledStatus; // gpmsa2
459 
462 
464  unsigned int m_currLevel; // restart
465 
467  unsigned int m_currStep;
468 
471  std::vector<double> m_logEvidenceFactors; // restart
474  double m_eig;
475 };
476 
477 } // End namespace QUESO
478 
479 #endif // UQ_MULTI_LEVEL_SAMPLING_H
void restartML(double &currExponent, double &currEta, SequenceOfVectors< P_V, P_M > &currChain, ScalarSequence< double > &currLogLikelihoodValues, ScalarSequence< double > &currLogTargetValues)
Restarts ML algorithm.
Definition: MLSampling.C:2149
A templated class that represents a Multilevel generator of samples.
Definition: MLSampling.h:118
void generateBalLinkedChains_all(MLSamplingLevelOptions &inputOptions, const P_M &unifiedCovMatrix, const GenericVectorRV< P_V, P_M > &rv, const BalancedLinkedChainsPerNodeStruct< P_V > &balancedLinkControl, SequenceOfVectors< P_V, P_M > &workingChain, double &cumulativeRunTime, unsigned int &cumulativeRejections, ScalarSequence< double > *currLogLikelihoodValues, ScalarSequence< double > *currLogTargetValues)
Definition: MLSampling.C:656
double m_logEvidence
Definition: MLSampling.h:472
double meanLogLikelihood() const
Method to calculate the mean of the logarithm of the likelihood.
Definition: MLSampling.C:4878
bool decideOnBalancedChains_all(const MLSamplingLevelOptions *currOptions, unsigned int indexOfFirstWeight, unsigned int indexOfLastWeight, const std::vector< unsigned int > &unifiedIndexCountersAtProc0Only, std::vector< ExchangeInfoStruct > &exchangeStdVec)
Definition: MLSampling.C:147
double m_debugExponent
Exponent for debugging.
Definition: MLSampling.h:470
const BaseEnvironment & m_env
Queso enviroment.
Definition: MLSampling.h:442
const BaseVectorRV< P_V, P_M > & m_priorRv
Prior RV.
Definition: MLSampling.h:445
void generateUnbLinkedChains_all(MLSamplingLevelOptions &inputOptions, const P_M &unifiedCovMatrix, const GenericVectorRV< P_V, P_M > &rv, const UnbalancedLinkedChainsPerNodeStruct &unbalancedLinkControl, unsigned int indexOfFirstWeight, const SequenceOfVectors< P_V, P_M > &prevChain, SequenceOfVectors< P_V, P_M > &workingChain, double &cumulativeRunTime, unsigned int &cumulativeRejections, ScalarSequence< double > *currLogLikelihoodValues, ScalarSequence< double > *currLogTargetValues)
Definition: MLSampling.C:890
void generateSequence_Step04_inter0(const SequenceOfVectors< P_V, P_M > &prevChain, const ScalarSequence< double > &weightSequence, P_M &unifiedCovMatrix)
Creates covariance matrix for current level (Step 04 from ML algorithm).
Definition: MLSampling.C:2985
MLSamplingOptions m_options
Options for the ML algorithm.
Definition: MLSampling.h:461
std::vector< bool > m_parameterEnabledStatus
Definition: MLSampling.h:458
unsigned int m_numDisabledParameters
Definition: MLSampling.h:456
void sampleIndexes_proc0(unsigned int unifiedRequestedNumSamples, const std::vector< double > &unifiedWeightStdVectorAtProc0Only, std::vector< unsigned int > &unifiedIndexCountersAtProc0Only)
Definition: MLSampling.C:93
const VectorSpace< P_V, P_M > & m_vectorSpace
Vector space.
Definition: MLSampling.h:451
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
Definition: Environment.h:187
void generateSequence_Step02_inter0(const MLSamplingLevelOptions *currOptions, SequenceOfVectors< P_V, P_M > &currChain, ScalarSequence< double > &currLogLikelihoodValues, ScalarSequence< double > &currLogTargetValues, SequenceOfVectors< P_V, P_M > &prevChain, ScalarSequence< double > &prevLogLikelihoodValues, ScalarSequence< double > &prevLogTargetValues, unsigned int &indexOfFirstWeight, unsigned int &indexOfLastWeight)
Saves chain and corresponding target pdf values from previous level (Step 02 from ML algorithm)...
Definition: MLSampling.C:2540
void generateSequence_Step01_inter0(const MLSamplingLevelOptions *currOptions, unsigned int &unifiedRequestedNumSamples)
Reads options for the ML algorithm (Step 01 from ML algorithm).
Definition: MLSampling.C:2494
void prepareUnbLinkedChains_inter0(unsigned int indexOfFirstWeight, unsigned int indexOfLastWeight, const std::vector< unsigned int > &unifiedIndexCountersAtProc0Only, UnbalancedLinkedChainsPerNodeStruct &unbalancedLinkControl)
Definition: MLSampling.C:481
void generateSequence_Step07_inter0(bool useBalancedChains, unsigned int indexOfFirstWeight, unsigned int indexOfLastWeight, const std::vector< unsigned int > &unifiedIndexCountersAtProc0Only, UnbalancedLinkedChainsPerNodeStruct &unbalancedLinkControl, const MLSamplingLevelOptions *currOptions, const SequenceOfVectors< P_V, P_M > &prevChain, std::vector< ExchangeInfoStruct > &exchangeStdVec, BalancedLinkedChainsPerNodeStruct< P_V > &balancedLinkControl)
Plans for number of linked chains for each node so that all nodes generate the closest possible to th...
Definition: MLSampling.C:3195
void generateSequence_Step09_all(const SequenceOfVectors< P_V, P_M > &prevChain, unsigned int indexOfFirstWeight, unsigned int indexOfLastWeight, const std::vector< double > &unifiedWeightStdVectorAtProc0Only, const ScalarSequence< double > &weightSequence, double prevEta, const GenericVectorRV< P_V, P_M > &currRv, MLSamplingLevelOptions *currOptions, P_M &unifiedCovMatrix, double &currEta)
Scales the unified covariance matrix until min &lt;= rejection rate &lt;= max (Step 09 from ML algorithm)...
Definition: MLSampling.C:3288
MLSampling(const char *prefix, const BaseVectorRV< P_V, P_M > &priorRv, const BaseScalarFunction< P_V, P_M > &likelihoodFunction)
Constructor.
Definition: MLSampling.C:4033
This class provides options for the Multilevel sequence generator if no input file is available...
void prepareBalLinkedChains_inter0(const MLSamplingLevelOptions *currOptions, const SequenceOfVectors< P_V, P_M > &prevChain, std::vector< ExchangeInfoStruct > &exchangeStdVec, BalancedLinkedChainsPerNodeStruct< P_V > &balancedLinkControl)
Definition: MLSampling.C:343
void justBalance_proc0(const MLSamplingLevelOptions *currOptions, std::vector< ExchangeInfoStruct > &exchangeStdVec)
Definition: MLSampling.C:1518
unsigned int m_currStep
Curret step.
Definition: MLSampling.h:467
double m_meanLogLikelihood
Definition: MLSampling.h:473
void checkpointML(double currExponent, double currEta, const SequenceOfVectors< P_V, P_M > &currChain, const ScalarSequence< double > &currLogLikelihoodValues, const ScalarSequence< double > &currLogTargetValues)
Writes checkpoint data for the ML method.
Definition: MLSampling.C:2033
void generateSequence_Step05_inter0(unsigned int unifiedRequestedNumSamples, const ScalarSequence< double > &weightSequence, std::vector< unsigned int > &unifiedIndexCountersAtProc0Only, std::vector< double > &unifiedWeightStdVectorAtProc0Only)
Creates unified finite distribution for current level (Step 05 from ML algorithm).
Definition: MLSampling.C:3079
~MLSampling()
Destructor.
Definition: MLSampling.C:4068
std::vector< double > m_logEvidenceFactors
Definition: MLSampling.h:471
void generateSequence_Step06_all(const MLSamplingLevelOptions *currOptions, unsigned int indexOfFirstWeight, unsigned int indexOfLastWeight, const std::vector< unsigned int > &unifiedIndexCountersAtProc0Only, bool &useBalancedChains, std::vector< ExchangeInfoStruct > &exchangeStdVec)
Decides on wheter or not to use balanced chains (Step 06 from ML algorithm).
Definition: MLSampling.C:3162
std::vector< UnbalancedLinkedChainControlStruct > unbLinkedChains
Definition: MLSampling.h:97
unsigned int m_currLevel
Current level.
Definition: MLSampling.h:464
void generateSequence_Step10_all(MLSamplingLevelOptions &currOptions, const P_M &unifiedCovMatrix, const GenericVectorRV< P_V, P_M > &currRv, bool useBalancedChains, const UnbalancedLinkedChainsPerNodeStruct &unbalancedLinkControl, unsigned int indexOfFirstWeight, const SequenceOfVectors< P_V, P_M > &prevChain, const BalancedLinkedChainsPerNodeStruct< P_V > &balancedLinkControl, SequenceOfVectors< P_V, P_M > &currChain, double &cumulativeRawChainRunTime, unsigned int &cumulativeRawChainRejections, ScalarSequence< double > *currLogLikelihoodValues, ScalarSequence< double > *currLogTargetValues)
Samples the vector RV of current level (Step 10 from ML algorithm).
Definition: MLSampling.C:3758
unsigned int numberOfPositions
Definition: MLSampling.h:69
const BaseScalarFunction< P_V, P_M > & m_likelihoodFunction
Likelihood function.
Definition: MLSampling.h:448
VectorSet< P_V, P_M > * m_targetDomain
Domain of the target PDF: intersection of the domains of the prior PDf and likelihood function...
Definition: MLSampling.h:454
This class provides options for each level of the Multilevel sequence generator if no input file is a...
void generateSequence_Step11_inter0(const MLSamplingLevelOptions *currOptions, unsigned int unifiedRequestedNumSamples, unsigned int cumulativeRawChainRejections, SequenceOfVectors< P_V, P_M > &currChain, ScalarSequence< double > &currLogLikelihoodValues, ScalarSequence< double > &currLogTargetValues, unsigned int &unifiedNumberOfRejections)
Filters chain (Step 11 from ML algorithm).
Definition: MLSampling.C:3864
void generateSequence(BaseVectorSequence< P_V, P_M > &workingChain, ScalarSequence< double > *workingLogLikelihoodValues, ScalarSequence< double > *workingLogTargetValues)
Method to generate the chain.
Definition: MLSampling.C:4080
void mpiExchangePositions_inter0(const SequenceOfVectors< P_V, P_M > &prevChain, const std::vector< ExchangeInfoStruct > &exchangeStdVec, const std::vector< unsigned int > &finalNumChainsPerNode, const std::vector< unsigned int > &finalNumPositionsPerNode, BalancedLinkedChainsPerNodeStruct< P_V > &balancedLinkControl)
Definition: MLSampling.C:1821
void print(std::ostream &os) const
TODO: Prints the sequence.
void generateSequence_Step08_all(BayesianJointPdf< P_V, P_M > &currPdf, GenericVectorRV< P_V, P_M > &currRv)
Creates a vector RV for current level (Step 08 from ML algorithm).
Definition: MLSampling.C:3255
void generateSequence_Step03_inter0(const MLSamplingLevelOptions *currOptions, const ScalarSequence< double > &prevLogLikelihoodValues, double prevExponent, double failedExponent, double &currExponent, ScalarSequence< double > &weightSequence)
Computes currExponent and sequence of weights for current level and update &#39;m_logEvidenceFactors&#39; (St...
Definition: MLSampling.C:2678
double logEvidence() const
Method to calculate the logarithm of the evidence.
Definition: MLSampling.C:4872
std::vector< BalancedLinkedChainControlStruct< P_V > > balLinkedChains
Definition: MLSampling.h:84
void generateSequence_Level0_all(const MLSamplingLevelOptions &currOptions, unsigned int &unifiedRequestedNumSamples, SequenceOfVectors< P_V, P_M > &currChain, ScalarSequence< double > &currLogLikelihoodValues, ScalarSequence< double > &currLogTargetValues)
Generates the sequence at the level 0.
Definition: MLSampling.C:2344
unsigned int originalIndexOfInitialPosition
Definition: MLSampling.h:67
double eig() const
Calculates the expected information gain value, EIG.
Definition: MLSampling.C:4884
friend std::ostream & operator<<(std::ostream &os, const MLSampling< P_V, P_M > &obj)
Definition: MLSampling.h:202
Class for handling vector samples (sequence of vectors).

Generated on Thu Apr 23 2015 19:18:34 for queso-0.50.1 by  doxygen 1.8.5