dflemin3 / approxposterior

A Python package for approximate Bayesian inference and optimization using Gaussian processes
https://dflemin3.github.io/approxposterior/
MIT License
41 stars 9 forks source link

Can approxposterior derive posterior distributions for parameters that aren't initial conditions? #19

Closed dflemin3 closed 5 years ago

dflemin3 commented 6 years ago

Right now, no. Approxposterior can only derive posterior distributions for forward model inputs, i.e. initial conditions. It would be awesome to be able to derive posterior distributions for model outputs, like final water content for an exoplanet subject to hydrodynamic atmospheric escape. This can't be done using the BAPE or AGP algorithms since the GP predicts the likelihood of a given set of initial conditions by training on model input-output pairs, where the output is transformed to a likelihood by comparing to observations, perhaps using a Chi^2-like metic.

What I could do is allow the user to specify some ML algorithm to predict the output of interest, like a random forest model, that trains on the forward model input-output pairs, using cross-validation to optimize hyperparameters. I assume that this approach won't generalize well since the training sets will be small by design and the forward models are typically rather complicated. This would probably result in appreciable systematic error, but it's probably worth experimenting with for a bit to see if it's feasible.

dflemin3 commented 5 years ago

Also, I should consider this: MCMC can also track blobs, the 2nd returned parameter(s) in emcee's LnLike functions. approxposterior should include the functionality to handle them, either by saving them or ignoring them, depending on the user's needs.

dflemin3 commented 5 years ago

I think the answer to this question is no, but I did add the functionality handle blobs on the dev branch.