]> https://gitweb.dealii.org/ - code-gallery.git/commitdiff
Augment documentation.
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 16 Jan 2020 21:22:13 +0000 (14:22 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 16 Jan 2020 22:03:17 +0000 (15:03 -0700)
MCMC-Laplace/mcmc-laplace.cc

index 47417a0e30f0fabc1516d618c42cf19194144afc..483ea248b156669cc3c1ee908ae206436243bb01 100644 (file)
@@ -571,7 +571,7 @@ namespace ProposalGenerator
 // The last main class is the Metropolis-Hastings sampler itself.
 // If you understand the algorithm behind this method, then
 // the following implementation should not be too difficult
-// to understand. The only thing of relevance is that descriptions
+// to read. The only thing of relevance is that descriptions
 // of the algorithm typically ask whether the *ratio* of two
 // probabilities (the "posterior" probabilities of the current
 // and the previous samples, where the "posterior" is the product of the
@@ -580,7 +580,12 @@ namespace ProposalGenerator
 // *logarithms* of these probabilities, we now need to take
 // the ratio of appropriate exponentials -- which is made numerically
 // more stable by considering the exponential of the difference of
-// the log probabilities.
+// the log probabilities. The only other slight complication is that
+// we need to multiply this ratio by the ratio of proposal probabilities
+// since we use a non-symmetric proposal distribution. This makes the
+// formula for accepting a sample slightly more awkward, but if you
+// take exponentials on both sides of the comparison, the formula
+// should become obvious again.
 namespace Sampler
 {
   class MetropolisHastings

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.