libqueso/queso — pull request #264 by dmcdougall (2014-09-10 03:09:58+00:00)
Title: Speedup: Allow user to seed chain with MAP estimator

Introduction
--

With this change, a new method is added to the `StatisticalInverseProblem` class, `seedWithMAPEstimator()`. This function, when called before `solveWithBayesMetropolisHastings(...)`, will instruct `QUESO` to do a deterministic minimisation of `-log(posterior_pdf)` and the minimiser computed as a result of this deterministic optimisation will be used as the initial value of the chain.

What?
--

This picture may help:

![seed](https://cloud.githubusercontent.com/assets/328518/4212043/391fcaec-3895-11e4-8a95-915bd18d2601.png)

Details and motivation
--

At present, the user has to seed the chain with an initial value. If this seed is in a low-probability region of the posterior distribution it may take a while for the Markov chain to get to a mode and reach stationarity. It may also mean a large proportion of the resulting chain has to be discarded to reduce the effect of pollution on the computed means. Furthermore, if likelihood evaluations are expensive (for example, a PDE solve), discarding a large proportion of the chain has its obvious downsides.

Doing a deterministic optimisation usually results in fewer likelihood calls to get to a mode.

Note, the signature of `solveWithBayesMetropolisHastings(...)` has not changed, and the user still passes an initial value. It's just that this initial value will be used to initialise the optimisation rather than the chain.

Extra foo
--

1. I've only done this for DRAM (so far).
2. There are knobs in the deterministic algorithm that could/should be made tweakable
3. The `GslOptimizer` and `Optimizer` classes are not templated. This is intentional; `GslVector` is a subclass of the abstract base `Vector`, so no speedup is gained from templating around this type. I'd also like to support many more vector/matrix implementations in the future and this design is a good step towards that goal.
4. I've tried incredibly hard to use American English in the class names, but I'd like someone to check I haven't missed any due to my colonial muscle memory.
5. This change includes a test and comments and even a little documentation, too.
6. Damon out.