nmdickson / GCfit

Multimass (LIMEPY) globular cluster equilibrium models and fitting them to observations
https://gcfit.readthedocs.io
MIT License
3 stars 1 forks source link

Hotfix/mf random likelihood #193

Closed nmdickson closed 10 months ago

nmdickson commented 10 months ago

Fixes the mass function likelihood calculation to increase the number of samples used to do the required Monte Carlo integration substantially. Using too small a number of samples, in the past, lead to a low precision on each mass function likelihood, and the randomness involved meant the likelihood values were difficult to reproduce. While this doesn't change most, if any, results, it will improve the reliability of the model fitting.

As the sampling in this integration is not very efficient, rather than re-sampling each time, this also restructures the valid_likelihoods of Observations to move this responsibility to the beginning, and re-use the samples for any likelihood calculation. This basically amounts to the use of a constant random seed, which is the right way to do this anyways.