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

"chaining" #32

Open TTitscher opened 3 years ago

TTitscher commented 3 years ago

Out of curiosity, I quickly implemented a test case here that generates n_data (currently 2) datasets (linear model m * xs + c) and compares

Potential issue: The results do not match. Should they?

joergfunger commented 3 years ago

I would have assumed this to give the same result, since the theoretical solution is exactly the same, since the model is linear (thus the linearization does not depend on m).

TTitscher commented 3 years ago

Even if you decrease the tolerance such that it is never reached and VB iterates 50 times -- and I would expect 50 fixed-point iterations to be enough -- you get the same result as above...

joergfunger commented 3 years ago

That could be checked with the analytical example, we could take 2 data points and compute the exact solution with a given prior, and then do the same thing with the sequential approach. Would Isabela or Abbas being interested to check the standard deviation part in the example for the analytical solution Thomas implemented and verify, if this is true for the subsequent iteration, and then, why this is not the case for our implementation. Maybe we still have a bug in our implementation that leads to wrong results, and then any discussion of results with a larger complexity might be obsolete.

TTitscher commented 3 years ago

If I skip the noise update (I know that this actually requires a new derivation of the equations...), the parameter posteriors match. So I also expect investigating the standard deviation part in the example for the analytical solution to be fruitful.