Skip to content

How to fix the redshift when using the prospector-beta prior #351

@Abrygzy

Description

@Abrygzy

Hi,

I want to use the prospector-beta priors (Wang, Leja, et al., 2023, ApJL.) with fixed redshift. Specifically, I want to use the 'PhiSFHfixZred' prior to fix the fitting at a given redshift. But I found the redshift (or the nzsfh_1 parameter) changes during the fit. Also, sometimes the fitting process returns some warnings and errors from the redshift-related calculation in astropy. I have tried these two methods to use this 'PhiSFHfixZred' prior (I only show some parameters related to SFH and redshift, basically shamelessly stolen from Dr. Bingjie Wang's great repo https://github.com/wangbingjie/prospector_catalog):

   model_params['nzsfh'] = {'N': 9,
                            'isfree': True,
                            'init': np.array([3, 11,0.0, 0,0,0,0,0,0]),
                            'prior': PZ.PhiSFHfixZred(zred=3.0,
                                              mass_mini=6.0, mass_maxi=12.5,
                                              z_mini=-1.98, z_maxi=0.19,
                                              logsfr_ratio_mini=-5.0, logsfr_ratio_maxi=5.0,
                                              logsfr_ratio_tscale=0.3, nbins_sfh=7,
                                              const_phi=True),
                            'init_disp': np.array([0.1, 0.5, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3])}
   model_params['zred'] = {'N': 1, 'isfree': False,
                           'depends_on': transforms.nzsfh_to_zred,
                           'init': 3.0}
   nbins_sfh = 7
   model_params["sfh"] = {'N': 1, 'isfree': False, 'init': 3}
   model_params['logsfr_ratios'] = {'N': nbins_sfh-1, 'isfree': False,
                                    'init': 0.0,
                                    'depends_on': transforms.nzsfh_to_logsfr_ratios,
                                    'prior': priors.StudentT(mean=np.full(nbins_sfh-1,0.0),
                                             scale=np.full(nbins_sfh-1,0.3),
                                             df=np.full(nbins_sfh-1,2))}

   model_params["mass"] = {'N': 7,
                           'isfree': False,
                           'init': 1e6,
                           'units': r'M$_\odot$',
                           'depends_on': logsfr_ratios_to_masses}

I also tried to fix the 'zred' without any dependence:

   model_params['zred'] = {'N': 1, 'isfree': False,
                            'init': 3.0}

Some of the related astropy errors look like this:

[/Users/abry/micromamba/envs/py312_mamba/lib/python3.12/site-packages/astropy/cosmology/flrw/base.py:1072](https://file+.vscode-resource.vscode-cdn.net/Users/abry/micromamba/envs/py312_mamba/lib/python3.12/site-packages/astropy/cosmology/flrw/base.py:1072): IntegrationWarning: The integral is probably divergent, or slowly convergent.
  return quad(self._lookback_time_integrand_scalar, z, inf)[0]

[/Users/abry/micromamba/envs/py312_mamba/lib/python3.12/site-packages/astropy/cosmology/flrw/base.py:1072](https://file+.vscode-resource.vscode-cdn.net/Users/abry/micromamba/envs/py312_mamba/lib/python3.12/site-packages/astropy/cosmology/flrw/base.py:1072): IntegrationWarning: The occurrence of roundoff error is detected, which prevents the requested tolerance from being achieved.  The error may be underestimated.  
return quad(self._lookback_time_integrand_scalar, z, inf)[0]

[/Users/abry/micromamba/envs/py312_mamba/lib/python3.12/site-packages/astropy/cosmology/flrw/base.py:1072](https://file+.vscode-resource.vscode-cdn.net/Users/abry/micromamba/envs/py312_mamba/lib/python3.12/site-packages/astropy/cosmology/flrw/base.py:1072): IntegrationWarning: The algorithm does not converge.  Roundoff error is detected in the extrapolation table.  It is assumed that the requested tolerance cannot be achieved, and that the returned result (if full_output = 1) is the best which can be obtained.
  return quad(self._lookback_time_integrand_scalar, z, inf)[0]

Here are my questions:

  1. How to properly fix the redshift with the 'PhiSFHfixZred' prior? Or should I just ignore these warnings?
  2. Are there other parameters I need to change when using these beta priors?
  3. Is it possible to parallelize the fitting when using the beta priors? I know I can use different cores for different logzsol sps models. But in the prospector-beta priors, the stellar metallicity is not a free parameter.

Thanks!
Zeyu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions