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

update parameter vector in eval instead of copy #9

Closed joergfunger closed 3 years ago

joergfunger commented 3 years ago

Parameter vector in evaluate has to update the parameter list (instead of copying), since it returns only the error vector, but not the parameter lists. If accessing them in the likelihood (the noise terms), those have to be updated.

TTitscher commented 3 years ago

For now, I have no problem with that. But I thought -- referring to our brief meeting yesterday -- that we wanted to treat "model error parameters (me_prm)" and "noise parameters (noise_prm)" differently anyways.

Imagine a common

def model_error(me_prm):
   return something_ordered_by_noise_groups

that is now plugged into a vb_wrapper that defines a noise pattern based on the noise groups (I know, debatable) and requires a separate Gamma noise prior for VB. And there is also a loglike_wrapper that needs the noise scalars as additional arguments to the loglikefunction. In both cases, they are not direct arguments to the model_error. But that may be more suitable for a separate issue.