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

Noise group parameters as normal latent parameter #44

Closed TTitscher closed 2 years ago

TTitscher commented 3 years ago

VB has a clear distinction between model parameters and noise parameters. Also, due to the special restrictions of VB, the noise parameters (currently each noise model has a precision) is actually ignored and the noise is inferred anyways.

Especially regarding sampling algorithms, it would make much more sense to have the precision of the noise model as a latent parameter that gets its prior similar to the model parameters. Maybe:

problem = InferenceProblem()
...
noise_model_force = UncorrelatedSensorNoise(force_sensors)
problem.add_noise_model(noise_model_force)
problem.latent["noise_force"].add(noise_model_force.parameter_list, "precision")
problem.set_prior("noise_force", scipy.stats.gamma(...))

As stated above, however, VB needs a clear distinction between model parameters and noise parameters, which is not given right now.

According to #23 , the noise_model_force.parameter_list will somehow vanish and the line could read

problem.define_latent("noise_force",  noise_model_force, "precision")

and we could check, if noise_model_force is of type bayes.noise.NoiseModelInterface.

TTitscher commented 3 years ago

In the meantime, as I really want to continue working on interfaces to taralli, I plan to temporarily add a member like ParameterList.is_noise to distinguish that.

joergfunger commented 3 years ago

We recently had a discussion on howto structure a general inference problem. This is what we came up with ModelCalibration So we essentially have three sets of latent parameters, the ones that are our model parameters, the ones that eventually describe the prior of these model parameters (in our VB, the prior for the model parameters is deterministic and not describe by hyper parameters) and the hyperparameters related to the noise models. Could we group all these variables into a single latent list. The user would then add individual latent variables to the model errors, model parameter priors or noise models?

TTitscher commented 2 years ago

Now part of https://github.com/BAMresearch/probeye/