bd-j / prospector

Python code for Stellar Population Inference from Spectra and SEDs
http://prospect.readthedocs.io
MIT License
153 stars 71 forks source link

IMF slope parameters as free parameters #294

Closed jiadonglee closed 9 months ago

jiadonglee commented 11 months ago

I'm trying to include the IMF slope parameters (imf2/imf3 in FSPS) as free parameters in my SED fitting problem. Currently, I directly add them to the model_params dictionary like:

"imf3":{"N": 1, "isfree": True, "init": 2.3, "prior": priors.TopHat(mini=1, maxi=5)}

However, it does not seem to work. Is there a specific way these IMF slope parameters need to be added as free parameters to ensure they are properly used during model creation and fitting?

Any suggestions for how to get the IMF slopes as free parameters in the fits would be greatly appreciated!

jrleja commented 11 months ago

Hi Jiadong,

While this should work in principle, it will be impossibly slow - every model evaluation needs to rebuild the SSPs, which is a ~several-minute process. In this setup a single-core fit should take ~years, so unless we completely rework the core of the code fitting directly for the IMF is not feasible at the moment. You can get halfway there by running multiple fits with different fixed IMF parameters. Alternatively, you can check out ALF - this is a more niche code in the sense that it's really best suited for quiescent objects, but has powerful IMF (and other) capabilities.

Best, Joel

jiadonglee commented 11 months ago

Hi Joel,

Thank you for your prompt and expedient response!