BAMresearch / bayem

Implementation and derivation of "Variational Bayesian inference for a nonlinear forward model." [Chappell et al. 2008] for arbitrary, user-defined model errors.
MIT License
2 stars 1 forks source link

Separate hyperparameters #11

Closed TTitscher closed 3 years ago

TTitscher commented 3 years ago

Hyperparameters are parameters that are not direct input to the model error computation, but are rather used outside (, right?!) One example would be parameters of the noise distribution. For the current VB implementation, they are a separate input to the method and for sampling, they are used in the transformation of the model error to a likelihood function.

Having those, conceptually, in two separate objects, allows us to define the problem independent of the inference method used. In some "simple" cases -- in my experience the majority though -- a small wrapper around the problem definition or the inference methods can lead to a drop-in replacement of the methods. So without any effort, you can start your investigations with a scipy.optimize, validate with sampling and switch to VB for performance or larger problem size.

joergfunger commented 3 years ago

On the one hand, I agree that they are separate objects, since they are not required in the forward model. On the other hand, the structure is quite similar to the model parameters (so there can be hyperparameters local or shared by different data sets/experiments). The structure can even be used for scipy optimize or pyMC3 as shown here. At least from my own experience with the framework, it is not very intuitive yet - maybe that's due to the lack of a general concept we have not yet agreed on or documented and thus adding another parallel hyperparameter layer might increase the complexity again, even though after some online discussions the code is now much clearer. The usecase shown in the link above is currently working (still needs some debugging) with pyMC3, the next step would then be to get it to work with VB. Maybe that would help to get an agreement on how we should use the framework.

TTitscher commented 3 years ago

I try to summarize some internal discussion with @joergfunger

TTitscher commented 3 years ago

IMO this is solved with the LatentParameters and NoiseModel classes.