zblz / naima

Derivation of non-thermal particle distributions through MCMC spectral fitting
http://naima.readthedocs.io
BSD 3-Clause "New" or "Revised" License
43 stars 54 forks source link

Use 3ML for fitting of models #209

Open grburgess opened 3 years ago

grburgess commented 3 years ago

Hello! I was investigating updating your emcee interface as we call Naima in our fitting architecture and we right now have a conflict between emcee v2 and v3 when loading Naima. Upon investigating, I ran into this in the docs:

https://naima.readthedocs.io/en/latest/mcmc.html#overcoming-the-gaussian-error-assumption

And was curious if you would be interested in offloading the fitting part to 3ML. As we already wrap some of the models:

https://github.com/threeML/astromodels/blob/master/astromodels/functions/functions.py#L610

it would be simple to expand this interface to fully cover all of the naima models. With this, the ability to fit x-ray data with responses, Fermi LAT and HAWC data native (folded through their instrument software) would come for free. There is still the possiblty to fit flux points in 3ML (though we recommend against it) and this could still be done inside naima as well.

Additionally, it opens the naima models to several more Bayesian samplers and maximum likelihood algorithms.

Is this something that you would be interested in? We would be happy to help with the wrappers.