prospector
prospector copied to clipboard
corner plot and run time with dynesty
Hi,
I am using dynesty and Dirichlet SFH for fitting both spectrum and photometries (GALEX + SDSS + WISE). Below are the settings for each parameter.
model parameters
Free Parameters: (name: prior)
-----------
logzsol: <class 'prospect.models.priors.TopHat'>(mini=-2,maxi=0.19)
dust2: <class 'prospect.models.priors.TopHat'>(mini=0.0,maxi=4.0)
z_fraction: <class 'prospect.models.priors.Beta'>(mini=0.0,maxi=1.0,alpha=[1. 1. 1. 1. 1. 1. 1. 1.],beta=[1. 1. 1. 1. 1. 1. 1. 1.])
total_mass: <class 'prospect.models.priors.LogUniform'>(mini=100000000.0,maxi=10000000000000.0)
sigma_smooth: <class 'prospect.models.priors.TopHat'>(mini=10,maxi=300)
Fixed Parameters: (name: value [, depends_on])
-----------
zred: [0.1]
mass: [1.] <function zfrac_to_masses at 0x7f45e7f3f6d0>
sfh: [3]
imf_type: [2]
dust_type: [0]
agebins: [[ 0. 7. ]
[ 7. 7.33333333]
[ 7.33333333 7.66666667]
[ 7.66666667 8. ]
[ 8. 8.33333333]
[ 8.33333333 8.66666667]
[ 8.66666667 9. ]
[ 9. 9.53650825]
[ 9.53650825 10.0730165 ]]
add_dust_emission: [ True]
duste_umin: [1.]
duste_qpah: [4.]
duste_gamma: [0.001]
add_neb_emission: [ True]
add_neb_continuum: [ True]
nebemlineinspec: [ True]
gas_logz: [0.] <function stellar_logzsol at 0x7f45eacd3910>
gas_logu: [-2.]
smoothtype: ['vel']
fftsmooth: [ True]
polyorder: [12]
dynesty parameters
'nested_bound': 'multi',
'nested_sample': 'rwalk',
'nested_nlive_init': 500,
'nested_nlive_batch': 500,
'nested_bootstrap': 0,
'nested_dlogz_init': 0.05,
'nested_weight_kwargs': {"pfrac": 1.0},
'nested_stop_kwargs': {"post_thresh": 0.1},
'walks': 25,
I have two questions.
- When I make a corner plot, I get
WARNING:root:Too few points to create valid contours
warning, and the plot result shows strongly restricted distribution like the below corner plot. I also checked a trace plot. I think this problem is caused related to too strong constraints in fitting with dynesty. Do you have any ideas for a solution?
- I run in an environment with a 48hr run-time limit, but the fitting often does not finish within this time limit. Related to #189 , I think I should change dynesty parameters or the number of free parameters. If you have any recommendations, could you please let me know?
Thanks, Takumi
Hi @TakumiSTanaka,
for the contour plot, you might look at prospect.plotting.corner.allcorner
(https://github.com/bd-j/prospector/blob/main/prospect/plotting/corner.py#L23). The issue with the typical corner plot is that when the posterior is much narrower than the prior, the range is set by the prior but there aren't enough bins by default to also resolve the posterior.
As far as the wall clock run time, you could try using MPI (https://prospect.readthedocs.io/en/latest/usage.html#using-mpi) or adjusting the dynesty stopping criteria (these have changed in recent versions of dynesty, check your dynesty version and the dynesty docs.) It looks like the parameters you have are extremely well constrained, so I would not advise decreasing the number of parameters. It might be that an outlier model or noise jitter term would be appropriate, if the model is trying very hard to fit specific outlier pixels.
Hi Takumi,
In addition to Ben's excellent suggestions, it also looks like many of the SFH parameters are pinned to the edge of the prior. This often suggests that the model cannot find an acceptable model to describe the data. I'd maybe take a look at the best-fitting SED and compare it to the photometry/spectra. Is the fit good? Are there specific bands or spectral regions that are not well-fit? For example, given that there's no freedom in the nebular parameters, I would not be surprised if emission lines would be poorly-fit (perhaps you mask them?).
Joel
Hi Ben and Joel,
Thank you for your helpful advice.
For the corner plot, I can plot with no problem using prospect.plotting.corner.allcorner
.
As @jrleja pointed out, FUV and WISE W3, W4 photometries sometimes don't fit well. However, these bands are relatively low S/N data, and dust emission parameters are of low priority in my purpose, so I think their mismatch is acceptable. I also consider that the model might have too little flexibility to fit well. I tested the model with many free parameters and found that some parameters, such as Umin, Q_PAH, and gas Z, are not restricted.
Finally, I decided to add some free parameters (such as gas logU) and introduce an outlier model. To reduce the wall time, I also changed the dynesty parameter, and I'm now measuring the effects. (I checked dynesty parallelization efficiency before, but since I have to fit large galaxy samples, I should fit on a single core)
Thanks to your advice, I have a good outlook now. Thank you very much.
Best, Takumi
Assuming this is resolved, but feel free to reopen if there are still issues to address!