From 201e5e262fb3950a40c2999099cc4d3e0894771e Mon Sep 17 00:00:00 2001 From: rstiskalek Date: Wed, 2 Oct 2024 18:04:51 +0100 Subject: [PATCH] Add 1 / r^2 prior on magnitude of the vector --- csiborgtools/flow/flow_model.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/csiborgtools/flow/flow_model.py b/csiborgtools/flow/flow_model.py index 4a7650d..c83fb0a 100644 --- a/csiborgtools/flow/flow_model.py +++ b/csiborgtools/flow/flow_model.py @@ -925,10 +925,17 @@ def PV_validation_model(models, distmod_hyperparams_per_model, inference_method : str Either `mike` or `bayes`. """ + ll = 0.0 + field_calibration_params = sample_calibration( **field_calibration_hyperparams) - ll = 0.0 + # We sample the components of Vext with a uniform prior, which means + # there is a |Vext|^2 prior, we correct for this so that the sampling + # is effecitvely uniformly in magnitude of Vext and angles. + if "Vext" in field_calibration_params: + ll -= jnp.log(jnp.sum(field_calibration_params["Vext"]**2)) + for n in range(len(models)): model = models[n] name = model.name