prashjet / popkinmocks

Create mock IFU datacubes for stellar population and kinematic modelling.
https://popkinmocks.readthedocs.io/
MIT License
4 stars 1 forks source link

Simplify conditionals #21

Closed prashjet closed 2 years ago

prashjet commented 2 years ago

Compute conditionals as joint/marginal

Previously, individual conditional distributions had been individually hard coded. This had two shortcomings, e.g.

  1. generalizability. We can now compute any conditional, not just those hard-coded
  2. errors! e.g. previously we had coded up $p(v|x) = \int p(v|t,x) p(t) dt$. Though this naively looked right, it did not obey the assumed factorisation $p(t,v,x) = p(t) p(x|t) p(v|t,x)$. The correct expression (which is now used implicitly) is:

$$ p(v|x) = \frac{\int p(t) p(x|t) p(v|t,x) dt}{\int \int p(t) p(x|t) p(v|t,x) dt dv} $$

Note - this last now correct, but produces different results to the previous version.

Notes: