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

Sub-optimal control flow #89

Open TTitscher opened 2 years ago

TTitscher commented 2 years ago

In the case of starting vba with the correct parameters, I expect it to evaluate the model twice to compute two free energies, which will be close enough for the algorithm to stop.

In our current implementation, we need at least three, as we compute no free energy with the result of the first model evaluation.

ajafarihub commented 2 years ago

I think, this algorithm can be the best one:

1- compute model error and Jacobian: k, J = model_error(parameters) 2- update Lambda and its inverse 3- compute F (free energy) --> for the prior. 4- update parameters 5- compute model error and Jacobian: k, J = model_error(parameters) 6- update noises 7- update Lambda and its inverse 8- compute F 9- if not convergence_met, then go to 4