queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
MetropolisAdjustedLangevinTK.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-2017 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_MALA_TK_H
26 #define UQ_MALA_TK_H
27 
28 #include <queso/TKGroup.h>
29 
30 namespace QUESO {
31 
32 class GslVector;
33 class GslMatrix;
34 template <class V, class M> class BayseianJointPdf;
35 
42 template <class V = GslVector, class M = GslMatrix>
44 public:
46 
47  MetropolisAdjustedLangevinTK(const char * prefix,
49  const BayesianJointPdf<V, M> & targetPdf,
50  const std::vector<double> & scales,
51  const M & covMatrix);
55 
57 
58 
60  bool symmetric() const;
61 
63  const GaussianVectorRV<V, M> & rv(unsigned int stageId) const;
64 
66  const GaussianVectorRV<V, M> & rv(const std::vector<unsigned int> & stageIds);
67 
69  /*
70  * This uses the formula for the transition kernel in Roberts & Tweedie 2001.
71  *
72  * http://projecteuclid.org/download/pdf_1/euclid.bj/1178291835
73  */
74  virtual const GaussianVectorRV<V, M> & rv(const V & position) const;
75 
77 
78  void updateLawCovMatrix(const M & covMatrix);
80 
82 
83  bool setPreComputingPosition(const V & position, unsigned int stageId);
85 
88 
89  virtual bool covMatrixIsDirty() { return false; }
90  virtual void cleanCovMatrix() { }
92 
94 
95 
97  void print(std::ostream & os) const;
99 private:
101  void setRVsWithZeroMean();
108 
110 
112 
113  double m_time_step;
114 };
115 
116 } // End namespace QUESO
117 
118 #endif // UQ_MALA_TK_H
A class representing a Gaussian vector RV.
const BayesianJointPdf< V, M > & m_targetPdf
const GaussianVectorRV< V, M > & rv(unsigned int stageId) const
Gaussian increment property to construct a transition kernel.
void setRVsWithZeroMean()
Sets the mean of the RVs to zero.
void updateLawCovMatrix(const M &covMatrix)
Scales the covariance matrix.
bool setPreComputingPosition(const V &position, unsigned int stageId)
Sets the pre-computing positions m_preComputingPositions[stageId] with a new vector of size position...
void clearPreComputingPositions()
Clears the pre-computing positions m_preComputingPositions[stageId].
This base class allows the representation of a transition kernel.
Definition: Algorithm.h:32
MetropolisAdjustedLangevinTK(const char *prefix, const BayesianJointPdf< V, M > &targetPdf, const std::vector< double > &scales, const M &covMatrix)
Default constructor.
bool symmetric() const
Whether or not the matrix is symmetric. Always &#39;true&#39;.
void print(std::ostream &os) const
TODO: Prints the transition kernel.
This class allows the representation of the MALA transition kernel with a scaled covariance matrix fo...
A class for handling Bayesian joint PDFs.

Generated on Tue Jun 5 2018 19:48:55 for queso-0.57.1 by  doxygen 1.8.5