maho3 / ltu-ili

Robust ML in Astro
https://ltu-ili.readthedocs.io/en/latest/
46 stars 9 forks source link

104 add an accuracy based metric #106

Closed maho3 closed 11 months ago

maho3 commented 12 months ago

Adding a validation metric to the PosteriorCoverage object which calculates the total log probability of our test data $(x_i, \theta_i)$ under our model posterior $q(\theta|x)$. This is a metric of constraining power.

It works by taking the posterior samples already calculated in PosteriorCoverage, using a Gaussian KDE as a variational distribution to derive a normalized $p(\theta)$, and calculating $p(\theta_o)$ at every observed test parameter. This fails if:

This is just a hacky solution to have an accuracy-like metric for now. It is used in other works (e.g. https://arxiv.org/abs/1805.07226) and is better than e.g. calculating scatter of true vs. predicted parameters, but not as good or robust as SOTA metrics. However, as Table 1 of https://arxiv.org/abs/2101.04653 shows, further SOTA metrics often require access to either the true posterior or fast simulators.