Open pscicluna opened 6 years ago
Python implementations exist for many of these. We should aim to exploit the following packages as part of AMPERE: Nested sampling: pyMultinest and dynesty MCMC: pyMC L-M algorithm & similar: scipy implementations, lmfit.
We should probably roll our own for grid searchs and genetic algorithms, as these are fairly straight forward and that way they can be customised to AMPERE's needs. Dynesty is highlighted above, I plan on making this a priority for the near future, as it should avoid some of the problems we have been having with emcee, and nested sampling is one of the few methods that works well for high-dimensional problems (N > 20).
I started working on adding (dynamic) nested sampling using dynesty. A class has been added that should work for static nested sampling, the class for dynamic nested sampling should be able to inherit everything except the constructor from the static nested sampling class.
An important thing to bear in mind is that nested sampling and MCMC use the priors in different ways, so we need two different methods in each model/data class: one (as now) that computes the natural log of the prior probability of a given set of parameter values, used by MCMC-type methods (self.lnprior) ; and one that computes the transformation from random numbers uniformly distributed in the interval [0,1) to random numbers uniformly distributed in the prior volume, known as the prior transform (self.prior_transform). This means we need to add an extra method to every existing model/data class to accommodate this.
Now adding individual issues for individual methods to track progress on each one independently and track overall progress here. Please make requests for new algorithms here, and they will be spun out into new issues when we decide to work on them.
So far, there is an issue to track progress on the L-M algorithm in scipy, nested sampling with dynesty, slice-sampling MCMC with Zeus, variational Bayes with snowline, and likelihood-free inference with ELFI.
Future codes to consider will be Ultranest, which will work similarly to dynesty and snowline; pyMC3 and pyro, which will be more complicated because they need gradient estimates, but which will open up a lot of room for problems with N > 100; other implementations of the L-M algorithm or
We need some extra optimisers. We should aim to add at least one implementation of each of the following:
L-M algorithm Grid search Genetic Algorithm Nested Sampling
For some of them we can use existing packages, but for others we will need to roll our own. If you have other suggestions for optimisers that you think are essential, add them to the list.