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 conditional distributions #9

Closed prashjet closed 2 years ago

prashjet commented 2 years ago

Currently, conditionals of p(x,v,t,z) are calculated in an unnecessarily complex way. In particular, it is different for light-weighted or mass-weighted options. The mass-weighted conditional is the mixture of component-wise conditionals, whereas the light-weighted conditional must calculate the marginal numerators and denominators.

We can simplify this by only explicitly hard-coding the light-weighted and mass-weighted marginals, then in both cases evaluate conditionals as quotients of joints.

Similarly, for each component, it only needs to have methods to evaluate its own marginals, while it's conditionals can be handled by the ABC.