queso-0.55.0
StatisticalInverseProblem.C
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-2015 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 #include <queso/StatisticalInverseProblem.h>
26 #include <queso/GslVector.h>
27 #include <queso/GslMatrix.h>
28 #include <queso/GPMSA.h>
29 #include <queso/GslOptimizer.h>
30 #include <queso/OptimizerMonitor.h>
31 
32 namespace QUESO {
33 
34 // Default constructor -----------------------------
35 template <class P_V,class P_M>
36 StatisticalInverseProblem<P_V,P_M>::StatisticalInverseProblem( const char* prefix, const SipOptionsValues* alternativeOptionsValues, // dakota const BaseVectorRV <P_V,P_M>& priorRv, const BaseScalarFunction<P_V,P_M>& likelihoodFunction, GenericVectorRV <P_V,P_M>& postRv)
42  :
43  m_env (priorRv.env()),
44  m_priorRv (priorRv),
45  m_likelihoodFunction (likelihoodFunction),
46  m_postRv (postRv),
47  m_solutionDomain (NULL),
48  m_solutionPdf (NULL),
49  m_subSolutionMdf (NULL),
50  m_subSolutionCdf (NULL),
51  m_solutionRealizer (NULL),
52  m_mhSeqGenerator (NULL),
53  m_mlSampler (NULL),
54  m_chain (NULL),
55  m_logLikelihoodValues (NULL),
56  m_logTargetValues (NULL),
57  m_optionsObj (alternativeOptionsValues),
58  m_seedWithMAPEstimator (false),
59  m_userDidNotProvideOptions(false)
60 {
61 #ifdef QUESO_MEMORY_DEBUGGING
62  std::cout << "Entering Sip" << std::endl;
63 #endif
64  if (m_env.subDisplayFile()) {
65  *m_env.subDisplayFile() << "Entering StatisticalInverseProblem<P_V,P_M>::constructor()"
66  << ": prefix = " << prefix
67  << ", alternativeOptionsValues = " << alternativeOptionsValues
68  << ", m_env.optionsInputFileName() = " << m_env.optionsInputFileName()
69  << std::endl;
70  }
71 
72  // If NULL, we create one
73  if (m_optionsObj == NULL) {
74  SipOptionsValues * tempOptions = new SipOptionsValues(&m_env, prefix);
75 
76  // We did this dance because scanOptionsValues is not a const method, but
77  // m_optionsObj is a pointer to const
78  m_optionsObj = tempOptions;
79 
80  // We set this flag so we don't delete the user-created object when it
81  // comes time to deconstruct
82  m_userDidNotProvideOptions = true;
83  }
84 
85  if (m_optionsObj->m_help != "") {
86  if (m_env.subDisplayFile()) {
87  *m_env.subDisplayFile() << (*m_optionsObj) << std::endl;
88  }
89  }
90 
91 #ifdef QUESO_MEMORY_DEBUGGING
92  std::cout << "In Sip, finished scanning options" << std::endl;
93 #endif
94 
95  queso_require_equal_to_msg(priorRv.imageSet().vectorSpace().dimLocal(), likelihoodFunction.domainSet().vectorSpace().dimLocal(), "'priorRv' and 'likelihoodFunction' are related to vector spaces of different dimensions");
96 
97  queso_require_equal_to_msg(priorRv.imageSet().vectorSpace().dimLocal(), postRv.imageSet().vectorSpace().dimLocal(), "'priorRv' and 'postRv' are related to vector spaces of different dimensions");
98 
99  if (m_env.subDisplayFile()) {
100  *m_env.subDisplayFile() << "Leaving StatisticalInverseProblem<P_V,P_M>::constructor()"
101  << ": prefix = " << m_optionsObj->m_prefix
102  << std::endl;
103  }
104 
105  return;
106 }
107 
108 template <class P_V,class P_M>
110  const char * prefix,
111  const SipOptionsValues * alternativeOptionsValues,
112  const GPMSAFactory<P_V, P_M> & gpmsaFactory,
113  GenericVectorRV <P_V,P_M> & postRv)
114  :
115  m_env (gpmsaFactory.m_totalPrior->env()),
116  m_priorRv (*(gpmsaFactory.m_totalPrior)),
117  m_likelihoodFunction (gpmsaFactory.getGPMSAEmulator()),
118  m_postRv (postRv),
119  m_solutionDomain (NULL),
120  m_solutionPdf (NULL),
121  m_subSolutionMdf (NULL),
122  m_subSolutionCdf (NULL),
123  m_solutionRealizer (NULL),
124  m_mhSeqGenerator (NULL),
125  m_mlSampler (NULL),
126  m_chain (NULL),
127  m_logLikelihoodValues (NULL),
128  m_logTargetValues (NULL),
129  m_optionsObj (alternativeOptionsValues),
130  m_seedWithMAPEstimator (false),
131  m_userDidNotProvideOptions(false)
132 {
133  if (m_env.subDisplayFile()) {
134  *m_env.subDisplayFile() << "Entering StatisticalInverseProblem<P_V,P_M>::constructor()"
135  << ": prefix = " << prefix
136  << ", alternativeOptionsValues = " << alternativeOptionsValues
137  << ", m_env.optionsInputFileName() = " << m_env.optionsInputFileName()
138  << std::endl;
139  }
140 
141  // If NULL, we create one
142  if (m_optionsObj == NULL) {
143  SipOptionsValues * tempOptions = new SipOptionsValues(&m_env, prefix);
144 
145  // We did this dance because scanOptionsValues is not a const method, but
146  // m_optionsObj is a pointer to const
147  m_optionsObj = tempOptions;
148 
150  }
151 
152  if (m_optionsObj->m_help != "") {
153  if (m_env.subDisplayFile()) {
154  *m_env.subDisplayFile() << (*m_optionsObj) << std::endl;
155  }
156  }
157 
158  queso_require_equal_to_msg(m_priorRv.imageSet().vectorSpace().dimLocal(), m_likelihoodFunction.domainSet().vectorSpace().dimLocal(), "'priorRv' and 'likelihoodFunction' are related to vector spaces of different dimensions");
159 
160  queso_require_equal_to_msg(m_priorRv.imageSet().vectorSpace().dimLocal(), postRv.imageSet().vectorSpace().dimLocal(), "'priorRv' and 'postRv' are related to vector spaces of different dimensions");
161 
162  if (m_env.subDisplayFile()) {
163  *m_env.subDisplayFile() << "Leaving StatisticalInverseProblem<P_V,P_M>::constructor()"
164  << ": prefix = " << m_optionsObj->m_prefix
165  << std::endl;
166  }
167 
168  return;
169 }
170 
171 // Destructor --------------------------------------
172 template <class P_V,class P_M>
174 {
175  if (m_chain) {
176  m_chain->clear();
177  delete m_chain;
178  }
179  if (m_logLikelihoodValues) {
180  m_logLikelihoodValues->clear();
181  delete m_logLikelihoodValues;
182  }
183  if (m_logTargetValues) {
184  m_logTargetValues->clear();
185  delete m_logTargetValues;
186  }
187  if (m_mlSampler ) delete m_mlSampler;
188  if (m_mhSeqGenerator ) delete m_mhSeqGenerator;
189  if (m_solutionRealizer) delete m_solutionRealizer;
190  if (m_subSolutionCdf ) delete m_subSolutionCdf;
191  if (m_subSolutionMdf ) delete m_subSolutionMdf;
192  if (m_solutionPdf ) delete m_solutionPdf;
193  if (m_solutionDomain ) delete m_solutionDomain;
194 
195  if (m_optionsObj && m_userDidNotProvideOptions) {
196  delete m_optionsObj;
197  }
198 }
199 // Statistical methods -----------------------------
200 template <class P_V,class P_M>
201 void
203  const MhOptionsValues* alternativeOptionsValues, // dakota
204  const P_V& initialValues,
205  const P_M* initialProposalCovMatrix)
206 {
207  //grvy_timer_begin("BayesMetropolisHastings"); TODO: revisit timing output
208  //std::cout << "proc " << m_env.fullRank() << ", HERE sip 000" << std::endl;
209  m_env.fullComm().Barrier();
210  //std::cout << "proc " << m_env.fullRank() << ", HERE sip 001" << std::endl;
211  m_env.fullComm().syncPrintDebugMsg("Entering StatisticalInverseProblem<P_V,P_M>::solveWithBayesMetropolisHastings()",1,3000000);
212 
213  if (m_optionsObj->m_computeSolution == false) {
214  if ((m_env.subDisplayFile())) {
215  *m_env.subDisplayFile() << "In StatisticalInverseProblem<P_V,P_M>::solveWithBayesMetropolisHastings()"
216  << ": avoiding solution, as requested by user"
217  << std::endl;
218  }
219  return;
220  }
221  if ((m_env.subDisplayFile())) {
222  *m_env.subDisplayFile() << "In StatisticalInverseProblem<P_V,P_M>::solveWithBayesMetropolisHastings()"
223  << ": computing solution, as requested by user"
224  << std::endl;
225  }
226 
227  queso_require_equal_to_msg(m_priorRv.imageSet().vectorSpace().dimLocal(), initialValues.sizeLocal(), "'m_priorRv' and 'initialValues' should have equal dimensions");
228 
229  if (initialProposalCovMatrix) {
230  queso_require_equal_to_msg(m_priorRv.imageSet().vectorSpace().dimLocal(), initialProposalCovMatrix->numRowsLocal(), "'m_priorRv' and 'initialProposalCovMatrix' should have equal dimensions");
231  queso_require_equal_to_msg(initialProposalCovMatrix->numCols(), initialProposalCovMatrix->numRowsGlobal(), "'initialProposalCovMatrix' should be a square matrix");
232  }
233 
234  if (m_mlSampler ) delete m_mlSampler;
235  if (m_mhSeqGenerator ) delete m_mhSeqGenerator;
236  if (m_solutionRealizer) delete m_solutionRealizer;
237  if (m_subSolutionCdf ) delete m_subSolutionCdf;
238  if (m_subSolutionMdf ) delete m_subSolutionMdf;
239  if (m_solutionPdf ) delete m_solutionPdf;
240  if (m_solutionDomain ) delete m_solutionDomain;
241 
242  P_V numEvaluationPointsVec(m_priorRv.imageSet().vectorSpace().zeroVector());
243  numEvaluationPointsVec.cwSet(250.);
244 
245  // Compute output pdf up to a multiplicative constant: Bayesian approach
246  m_solutionDomain = InstantiateIntersection(m_priorRv.pdf().domainSet(),m_likelihoodFunction.domainSet());
247 
248  m_solutionPdf = new BayesianJointPdf<P_V,P_M>(m_optionsObj->m_prefix.c_str(),
249  m_priorRv.pdf(),
250  m_likelihoodFunction,
251  1.,
252  *m_solutionDomain);
253 
254  m_postRv.setPdf(*m_solutionPdf);
255  m_chain = new SequenceOfVectors<P_V,P_M>(m_postRv.imageSet().vectorSpace(),0,m_optionsObj->m_prefix+"chain");
256 
257  // Decide whether or not to create a MetropolisHastingsSG instance from the
258  // user-provided initial seed, or use the user-provided seed for a
259  // deterministic optimisation instead and seed the chain with the result of
260  // the optimisation
261  if (this->m_seedWithMAPEstimator ||
262  m_optionsObj->m_seedWithMAPEstimator) {
263  // Unfortunately, I didn't have the foresight to make this an input file
264  // option from the beginning, hence needing to check two flags
265 
266  // Do optimisation before sampling
267  GslOptimizer optimizer(*m_solutionPdf);
268  optimizer.setInitialPoint(dynamic_cast<const GslVector &>(initialValues));
269 
270  OptimizerMonitor monitor(m_env);
271  monitor.set_display_output(true, true);
272 
273  // If the input file option is set, then use the monitor, otherwise don't
274  if (m_optionsObj->m_useOptimizerMonitor) {
275  optimizer.minimize(&monitor);
276  }
277  else {
278  optimizer.minimize();
279  }
280 
281  // Compute output realizer: Metropolis-Hastings approach
282  m_mhSeqGenerator = new MetropolisHastingsSG<P_V, P_M>(
283  m_optionsObj->m_prefix.c_str(), alternativeOptionsValues,
284  m_postRv, optimizer.minimizer(), initialProposalCovMatrix);
285  }
286  else {
287  // Compute output realizer: Metropolis-Hastings approach
288  m_mhSeqGenerator = new MetropolisHastingsSG<P_V, P_M>(
289  m_optionsObj->m_prefix.c_str(), alternativeOptionsValues, m_postRv,
290  initialValues, initialProposalCovMatrix);
291  }
292 
293 
294  m_logLikelihoodValues = new ScalarSequence<double>(m_env, 0,
295  m_optionsObj->m_prefix +
296  "logLike");
297 
298  m_logTargetValues = new ScalarSequence<double>(m_env, 0,
299  m_optionsObj->m_prefix +
300  "logTarget");
301 
302  // m_logLikelihoodValues and m_logTargetValues may be NULL
303  m_mhSeqGenerator->generateSequence(*m_chain, m_logLikelihoodValues,
304  m_logTargetValues);
305 
306  m_solutionRealizer = new SequentialVectorRealizer<P_V,P_M>(m_optionsObj->m_prefix.c_str(),
307  *m_chain);
308 
309  m_postRv.setRealizer(*m_solutionRealizer);
310 
311  m_env.fullComm().syncPrintDebugMsg("In StatisticalInverseProblem<P_V,P_M>::solveWithBayesMetropolisHastings(), code place 1",3,3000000);
312  //m_env.fullComm().Barrier();
313 
314  // Compute output mdf: uniform sampling approach
315 #ifdef UQ_ALSO_COMPUTE_MDFS_WITHOUT_KDE
316  m_subMdfGrids = new ArrayOfOneDGrids <P_V,P_M>((m_optionsObj->m_prefix+"Mdf_").c_str(),m_postRv.imageSet().vectorSpace());
317  m_subMdfValues = new ArrayOfOneDTables<P_V,P_M>((m_optionsObj->m_prefix+"Mdf_").c_str(),m_postRv.imageSet().vectorSpace());
318  m_chain->subUniformlySampledMdf(numEvaluationPointsVec, // input
319  *m_subMdfGrids, // output
320  *m_subMdfValues); // output
321  m_subSolutionMdf = new SampledVectorMdf<P_V,P_M>(m_optionsObj->m_prefix.c_str(),
322  *m_subMdfGrids,
323  *m_subMdfValues);
324  m_postRv.setMdf(*m_subSolutionMdf);
325 
326  if ((m_optionsObj->m_dataOutputFileName != UQ_SIP_FILENAME_FOR_NO_FILE ) &&
327  (m_optionsObj->m_dataOutputAllowedSet.find(m_env.subId()) != m_optionsObj->m_dataOutputAllowedSet.end())) {
328  if (m_env.subRank() == 0) {
329  // Write data output file
330  if (m_env.subDisplayFile()) {
331  *m_env.subDisplayFile() << "Opening data output file '" << m_optionsObj->m_dataOutputFileName
332  << "' for calibration problem with problem with prefix = " << m_optionsObj->m_prefix
333  << std::endl;
334  }
335 
336  // Open file
337  // Always write at the end of an eventual pre-existing file
338  std::ofstream* ofsvar = new std::ofstream((m_optionsObj->m_dataOutputFileName+"_sub"+m_env.subIdString()+".m").c_str(), std::ofstream::out | std::ofstream::in | std::ofstream::ate);
339  if ((ofsvar == NULL ) ||
340  (ofsvar->is_open() == false)) {
341  delete ofsvar;
342  ofsvar = new std::ofstream((m_optionsObj->m_dataOutputFileName+"_sub"+m_env.subIdString()+".m").c_str(), std::ofstream::out | std::ofstream::trunc);
343  }
344  queso_require_msg((ofsvar && ofsvar->is_open()), "failed to open file");
345 
346  m_postRv.mdf().print(*ofsvar);
347 
348  // Close file
349  //ofsvar->close();
350  delete ofsvar;
351  if (m_env.subDisplayFile()) {
352  *m_env.subDisplayFile() << "Closed data output file '" << m_optionsObj->m_dataOutputFileName
353  << "' for calibration problem with problem with prefix = " << m_optionsObj->m_prefix
354  << std::endl;
355  }
356  }
357  }
358 #endif
359  if (m_env.subDisplayFile()) {
360  *m_env.subDisplayFile() << std::endl;
361  }
362 
363  m_env.fullComm().syncPrintDebugMsg("Leaving StatisticalInverseProblem<P_V,P_M>::solveWithBayesMetropolisHastings()",1,3000000);
364  m_env.fullComm().Barrier();
365  // grvy_timer_end("BayesMetropolisHastings"); TODO: revisit timers
366  return;
367 }
368 
369 template <class P_V, class P_M>
370 void
372 {
373  this->m_seedWithMAPEstimator = true;
374 }
375 
376 template <class P_V,class P_M>
377 void
379 {
380  m_env.fullComm().Barrier();
381  m_env.fullComm().syncPrintDebugMsg("Entering StatisticalInverseProblem<P_V,P_M>::solveWithBayesMLSampling()",1,3000000);
382 
383  if (m_optionsObj->m_computeSolution == false) {
384  if ((m_env.subDisplayFile())) {
385  *m_env.subDisplayFile() << "In StatisticalInverseProblem<P_V,P_M>::solveWithBayesMLSampling()"
386  << ": avoiding solution, as requested by user"
387  << std::endl;
388  }
389  return;
390  }
391  if ((m_env.subDisplayFile())) {
392  *m_env.subDisplayFile() << "In StatisticalInverseProblem<P_V,P_M>::solveWithBayesMLSampling()"
393  << ": computing solution, as requested by user"
394  << std::endl;
395  }
396 
397  if (m_mlSampler ) delete m_mlSampler;
398  if (m_mhSeqGenerator ) delete m_mhSeqGenerator;
399  if (m_solutionRealizer) delete m_solutionRealizer;
400  if (m_subSolutionCdf ) delete m_subSolutionCdf;
401  if (m_subSolutionMdf ) delete m_subSolutionMdf;
402  if (m_solutionPdf ) delete m_solutionPdf;
403  if (m_solutionDomain ) delete m_solutionDomain;
404 
405  P_V numEvaluationPointsVec(m_priorRv.imageSet().vectorSpace().zeroVector());
406  numEvaluationPointsVec.cwSet(250.);
407 
408  // Compute output pdf up to a multiplicative constant: Bayesian approach
409  m_solutionDomain = InstantiateIntersection(m_priorRv.pdf().domainSet(),m_likelihoodFunction.domainSet());
410 
411  m_solutionPdf = new BayesianJointPdf<P_V,P_M>(m_optionsObj->m_prefix.c_str(),
412  m_priorRv.pdf(),
413  m_likelihoodFunction,
414  1.,
415  *m_solutionDomain);
416 
417  m_postRv.setPdf(*m_solutionPdf);
418 
419  // Compute output realizer: ML approach
420  m_chain = new SequenceOfVectors<P_V,P_M>(m_postRv.imageSet().vectorSpace(),0,m_optionsObj->m_prefix+"chain");
421  m_mlSampler = new MLSampling<P_V,P_M>(m_optionsObj->m_prefix.c_str(),
422  //m_postRv,
423  m_priorRv,
424  m_likelihoodFunction);
425  // initialValues,
426  // initialProposalCovMatrix);
427 
428  m_mlSampler->generateSequence(*m_chain,
429  NULL,
430  NULL);
431 
432  m_solutionRealizer = new SequentialVectorRealizer<P_V,P_M>(m_optionsObj->m_prefix.c_str(),
433  *m_chain);
434 
435  m_postRv.setRealizer(*m_solutionRealizer);
436 
437  if (m_env.subDisplayFile()) {
438  *m_env.subDisplayFile() << std::endl;
439  }
440 
441  m_env.fullComm().syncPrintDebugMsg("Leaving StatisticalInverseProblem<P_V,P_M>::solveWithBayesMLSampling()",1,3000000);
442  m_env.fullComm().Barrier();
443 
444  return;
445 }
446 
447 template <class P_V, class P_M>
450 {
451  return *m_mhSeqGenerator;
452 }
453 
454 //--------------------------------------------------
455 template <class P_V,class P_M>
458 {
459  return m_priorRv;
460 }
461 //--------------------------------------------------
462 template <class P_V,class P_M>
465 {
466  return m_postRv;
467 }
468 //--------------------------------------------------
469 template <class P_V,class P_M>
472 {
473  queso_require_msg(m_chain, "m_chain is NULL");
474  return *m_chain;
475 }
476 //--------------------------------------------------
477 template <class P_V,class P_M>
480 {
481  queso_require_msg(m_logLikelihoodValues, "m_logLikelihoodValues is NULL");
482  return *m_logLikelihoodValues;
483 }
484 //--------------------------------------------------
485 template <class P_V,class P_M>
488 {
489  queso_require_msg(m_logTargetValues, "m_logTargetValues is NULL");
490  return *m_logTargetValues;
491 }
492 //--------------------------------------------------
493 template <class P_V,class P_M>
495 {
496  queso_require_msg(m_mlSampler, "m_mlSampler is NULL");
497  return m_mlSampler->logEvidence();
498 }
499 //--------------------------------------------------
500 template <class P_V,class P_M>
502 {
503  queso_require_msg(m_mlSampler, "m_mlSampler is NULL");
504  return m_mlSampler->meanLogLikelihood();
505 }
506 //--------------------------------------------------
507 template <class P_V,class P_M>
509 {
510  queso_require_msg(m_mlSampler, "m_mlSampler is NULL");
511  return m_mlSampler->eig();
512 }
513 // I/O methods--------------------------------------
514 template <class P_V,class P_M>
515 void
517 {
518  return;
519 }
520 
521 } // End namespace QUESO
522 
Class to accommodate arrays of one-dimensional grid.
void solveWithBayesMetropolisHastings(const MhOptionsValues *alternativeOptionsValues, const P_V &initialValues, const P_M *initialProposalCovMatrix)
Solves the problem via Bayes formula and a Metropolis-Hastings algorithm.
This templated class represents a Statistical Inverse Problem.
void seedWithMAPEstimator()
Seeds the chain with the result of a deterministic optimisation.
A class for handling sampled vector MDFs.
This class provides options for the Metropolis-Hastings generator of samples if no input file is avai...
StatisticalInverseProblem(const char *prefix, const SipOptionsValues *alternativeOptionsValues, const BaseVectorRV< P_V, P_M > &priorRv, const BaseScalarFunction< P_V, P_M > &likelihoodFunction, GenericVectorRV< P_V, P_M > &postRv)
Constructor.
A base class for handling optimisation of scalar functions.
Definition: GslOptimizer.h:50
const BaseVectorRV< P_V, P_M > & m_priorRv
void setInitialPoint(const GslVector &intialPoint)
Set the point at which the optimization starts.
Definition: GslOptimizer.C:219
const BaseVectorSequence< P_V, P_M > & chain() const
Returns the MCMC chain; access to private attribute m_chain.
virtual const VectorSpace< V, M > & vectorSpace() const =0
Vector space to which this set belongs to. See template specialization.
const ScalarSequence< double > & logTargetValues() const
Returns log target values; access to private attribute m_logTargetValues.
const BaseVectorRV< P_V, P_M > & priorRv() const
Returns the Prior RV; access to private attribute m_priorRv.
const ScalarSequence< double > & logLikelihoodValues() const
Returns log likelihood values; access to private attribute m_logLikelihoodValues. ...
virtual void minimize(OptimizerMonitor *monitor=NULL)
Minimize the objective function, starting at m_initialPoint.
Definition: GslOptimizer.C:184
#define queso_require_msg(asserted, msg)
Definition: asserts.h:69
#define queso_require_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:85
std::string optionsInputFileName() const
Access to the attribute m_optionsInputFileName, which stores the name of the input file passed by the...
Definition: Environment.C:311
A class for handling sequential draws (sampling) from probability density distributions.
const VectorSet< V, M > & domainSet() const
Access to the protected attribute m_domainSet: domain set of the scalar function. ...
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:278
const BaseScalarFunction< P_V, P_M > & m_likelihoodFunction
const MetropolisHastingsSG< P_V, P_M > & sequenceGenerator() const
Return the underlying MetropolisHastingSG object.
VectorSet< V, M > * InstantiateIntersection(const VectorSet< V, M > &domain1, const VectorSet< V, M > &domain2)
This method calculates the intersection of domain1 and domain2.
std::string m_help
If this string is non-empty, options are print to the output file.
This class provides options for a Statistical Inverse Problem if no input file is available...
void print(std::ostream &os) const
TODO: Prints the sequence.
A templated class that represents a Metropolis-Hastings generator of samples.
Class to accommodate arrays of one-dimensional tables.
const GslVector & minimizer() const
Return the point that minimizes the objective function.
Definition: GslOptimizer.C:227
void set_display_output(bool enable_output, bool print_xmin)
Enabling output to std::cout everytime append is called.
const GenericVectorRV< P_V, P_M > & postRv() const
Returns the Posterior RV; access to private attribute m_postrRv.
const VectorSet< V, M > & imageSet() const
Image set of the vector RV; access to private attribute m_imageSet.
Definition: VectorRV.C:82
void solveWithBayesMLSampling()
Solves with Bayes Multi-Level (ML) sampling.
double meanLogLikelihood() const
Returns the mean of the logarithm value of the likelihood. Related to ML.
#define UQ_SIP_FILENAME_FOR_NO_FILE
double logEvidence() const
Returns the logarithm value of the evidence. Related to ML.
unsigned int dimLocal() const
Definition: VectorSpace.C:170
Object to monitor convergence of optimizers.
A templated class that represents a Multilevel generator of samples.
Definition: MLSampling.h:122

Generated on Fri Jun 17 2016 14:17:42 for queso-0.55.0 by  doxygen 1.8.5