|
4 | 4 | Bayesian Analysis - DREAM |
5 | 5 | ========================= |
6 | 6 |
|
7 | | -The main Bayesian Sampler bundled with RAT is an implementation of the DREAM (DiffeRential Evolution Adaptive Metropolis) |
8 | | -algorithm first described by `Vrugt`_. |
| 7 | +The main Bayesian Sampler in RAT is a MATLAB implementation of the DREAM (DiffeRential Evolution Adaptive Metropolis) |
| 8 | +algorithm of Vrugt (2016), [#vrugt2016]_ modified to be compilable to C++ via MATLAB Coder. |
9 | 9 |
|
| 10 | +As the name suggests, DREAM combines :ref:`differential evolution<DE>` with a variant on the |
| 11 | +`Metropolis-Hastings optimisation algorithm <https://en.wikipedia.org/wiki/Metropolis%E2%80%93Hastings_algorithm>`_. |
10 | 12 |
|
| 13 | +The basic idea of the Metropolis-Hastings algorithm is that it randomly "walks" around the parameter space, by taking |
| 14 | +a "step" of a fixed distance and either accepting the step or rejecting it (i.e. going back to the previous step and starting again) |
| 15 | +based on the following process: |
11 | 16 |
|
| 17 | +#. Let :math:`x` be the current point, :math:`x'` be the proposed new step, and :math:`f` the function that calculates chi-squared at any point. |
| 18 | +#. Calculate the ratio |
12 | 19 |
|
| 20 | + .. math:: \alpha = f(x')/f(x). |
13 | 21 |
|
| 22 | +#. Generate a random number :math:`u` between 0 and 1. |
| 23 | +#. If :math:`u \leq \alpha`, accept the candidate. Otherwise, reject it. |
14 | 24 |
|
| 25 | +This means that while steps into points with better chi-squared are more likely, they are not *guaranteed*, and the algorithm is also able to step |
| 26 | +to points of worse fit (but this is less likely to be accepted). The sequence of steps is an example of a Markov chain. After a large number of steps |
| 27 | +we can infer various things about the shape of our probability distribution for each parameter. The algorithm can be adapted to, for example, adapt |
| 28 | +the size of the steps to shrink proportionally to the number of steps that have been accepted, with the assumption that the algorithm has found a minimum |
| 29 | +after many accepted steps. |
15 | 30 |
|
| 31 | +DREAM modifies this idea and combines it with differential evolution. It creates multiple Markov chains ("walks") in parallel, |
| 32 | +and the new proposed points are generated by using a differential evolution process between all the chains: |
16 | 33 |
|
| 34 | +#. Let :math:`v_i` be the vector representing chain :math:`i`; |
| 35 | + :math:`v_i = (x^i_1, x^i_2, x^i_3,...)` |
| 36 | + where :math:`x^i_j` is the :math:`j`'th point on chain :math:`i`. |
| 37 | +#. Let there be :math:`N` chains, and say we are on iteration :math:`t`. |
| 38 | + Use differential evolution over all points on all chains to propose a new point for each chain: |
| 39 | + :math:`x^1_t, x^2_t, ..., x^N_t`. |
| 40 | +#. For each point, either accept or reject using the same criteria as in Metropolis-Hastings. If |
| 41 | + accepted, add it to its respective chain. |
17 | 42 |
|
| 43 | +This means that over time, DREAM creates :math:`N` parallel Markov chains that explore the parameter space, |
| 44 | +and each chain can 'learn' from better-performing chains via the differential evolution process. After some iterations, |
| 45 | +we start 'cutting off' the older end of the chain so that the new proposals are generated from a sample set of better points. |
18 | 46 |
|
| 47 | +It also performs several auxilliary improvements such as subspace sampling (i.e. generating proposals from only a subset of the parameters |
| 48 | +at a time), and a correction algorithm for chains that are outliers. It has been found to outperform other adaptive |
| 49 | +MCMC approaches, and in some cases even outperforms classical optimisation algorithms at parameter estimation. [#laloy2012]_ |
19 | 50 |
|
20 | 51 |
|
| 52 | +Algorithm control parameters |
| 53 | +---------------------------- |
| 54 | +The following parameters in the :ref:`Controls object<controlsInfo>` are specific to DREAM: |
21 | 55 |
|
22 | | -.. _Vrugt: https://www.sciencedirect.com/science/article/abs/pii/S1364815215300396 |
| 56 | +- ``nSamples``: The number of samples in the initial population for each chain. |
| 57 | + |
| 58 | +- ``nChains``: The number of Markov chains to use in the algorithm. |
| 59 | + |
| 60 | +- ``jumpProbability``: A probability range for the size of jumps when performing subspace sampling. Larger values mean |
| 61 | + more random variation in jump sizes for new proposed values. |
| 62 | + |
| 63 | +- ``pUnitGamma``: The 'probability of unit jump' rate. New proposals are scaled down by a factor :math:`\gamma = 2.38/2d`, |
| 64 | + where :math:`d` is the current length of the chain. This means that as the chain gets longer and 'better', jumps to new |
| 65 | + points aren't as far from the rest of the chain (as we are likely close to a minimum of the space). |
| 66 | + ``pUnitGamma`` is the probability that this will be ignored for an iteration |
| 67 | + and instead :math:`\gamma = 1` for that iteration (hence the name: "p unit gamma", the probability that gamma |
| 68 | + will be unital for an iteration). This allows chains to 'jump' out of their local area and more easily explore other |
| 69 | + parts of the parameter space. |
| 70 | + |
| 71 | +- ``boundHandling``: How steps across the boundary of the space should be handled. Can be: |
| 72 | + - ``"off"``: allow steps to pass the boundary. |
| 73 | + - ``"reflect"``: if a step passes a boundary, reflect it back across the boundary. |
| 74 | + - ``"bound"``: if a step passes a boundary, set it equal to the nearest point on the boundary. |
| 75 | + - ``"fold"``: treat the boundary as periodic and 'wrap the step around' to the other side of the space. |
| 76 | + |
| 77 | +- ``adaptPCR``: whether crossover probabilities for differential evolution should be adapted by the algorithm as it runs. |
| 78 | + |
| 79 | + |
| 80 | +.. [#vrugt2016] |
| 81 | + Vrugt, Jasper (2016), |
| 82 | + "Markov chain Monte Carlo simulation using the DREAM software package: Theory, concepts, and MATLAB implementation". |
| 83 | + DOI: 10.1016/j.envsoft.2015.08.013, |
| 84 | + URL: https://www.sciencedirect.com/science/article/abs/pii/S1364815215300396 |
| 85 | +
|
| 86 | +.. [#laloy2012] |
| 87 | + Laloy, Eric; Vrugt, Jasper (2012), |
| 88 | + "High-dimensional posterior exploration of hydrologic models using multiple-try DREAM(ZS) and high-performance computing". |
| 89 | + DOI: 10.1029/2011WR010608, |
| 90 | + URL: https://agupubs.onlinelibrary.wiley.com/doi/10.1029/2011WR010608 |
0 commit comments