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

Fix few bugs #81

Closed ajafarihub closed 2 years ago

ajafarihub commented 2 years ago

A few bugs in updating k,J and update of noises.

TTitscher commented 2 years ago

So the ARD test is the only one failing. Even in master, however, this test fails when slightly changing the noise prior. I'm not sure how to proceed. Maybe you could deactivate the test and open an issue...

Edit: Also nice catch of the bug with the too early return inupdate_noise`! How did you find that? Could you provide a test case or extend an existing one?

ajafarihub commented 2 years ago

So the ARD test is the only one failing. Even in master, however, this test fails when slightly changing the noise prior. I'm not sure how to proceed. Maybe you could deactivate the test and open an issue...

Edit: Also nice catch of the bug with the too early return inupdate_noise`! How did you find that? Could you provide a test case or extend an existing one?

To your Edit. @TTitscher : My example had several noise groups some of which were prescribed. When I checked the algorithm in debug mode, however, I realized that none of noises are updated. I do not know if it is always possible (or wise!) to come up with tests that are able to detect ANY possible coding bug (like this one). I mean, there could be no end for that. Maybe a test could be that we observe a change of noise parameters in a problem with several noise groups, where some of them are prescribed and some are identified. Does that make any sense in your opinion ?

TTitscher commented 2 years ago

I do not know if it is always possible (or wise!) to come up with tests that are able to detect ANY possible coding bug (like this one).

(As always in life,) we should to our best to not repeat the mistakes/bugs. So it is certainly not possible to detect any possible bug, but in this case, we exactly know the bug and could provide a test to prevent it. I mean, if I revert the bugfix, say by accident, I have no idea that I break your code.

ajafarihub commented 2 years ago

I do not know if it is always possible (or wise!) to come up with tests that are able to detect ANY possible coding bug (like this one).

(As always in life,) we should to our best to not repeat the mistakes/bugs. So it is certainly not possible to detect any possible bug, but in this case, we exactly know the bug and could provide a test to prevent it. I mean, if I revert the bugfix, say by accident, I have no idea that I break your code.

I added a test in last commit. If it is fine now, then I merge the pull request.