brinckmann / montepython_public

Public repository for the Monte Python Code
MIT License
93 stars 80 forks source link

Problems with PlanckTTTEEE+Pantheon #363

Closed JaelssonLima closed 7 months ago

JaelssonLima commented 7 months ago

Hi,

So, recently I've been trying to use PlanckTTTEEE+Pantheon. But there is an error when processing the likelihoods...

How would be a PlanckTTTEEE+Pantheon.param file for it to work correctly? Best regards, Jaelsson Lima.

#------Experiments to test (separated with commas)-----

data.experiments=['Planck_highl_TTTEEE', 'Planck_lowl_EE', 'Planck_lowl_TT', 'Pantheon']

#------ Settings for the over-sampling.
# The first element will always be set to 1, for it is the sampling of the
# cosmological parameters. The other numbers describe the over sampling of the
# nuisance parameter space. This array must have the same dimension as the
# number of blocks in your run (so, 1 for cosmological parameters, and then 1
# for each experiment with varying nuisance parameters).
# Note that when using Planck likelihoods, you definitely want to use [1, 4],
# to oversample as much as possible the 14 nuisance parameters.
# Remember to order manually the experiments from slowest to fastest (putting
# Planck as the first set of experiments should be a safe bet, except if you
# also have LSS experiments).
# If you have experiments without nuisance, you do not need to specify an
# additional entry in the over_sampling list (notice for instance that, out of
# the three Planck likelihoods used, only Planck_highl requires nuisance
# parameters, therefore over_sampling has a length of two (cosmology, plus one
# set of nuisance).
data.over_sampling=[1, 5]

#------ Parameter list -------

# data.parameters[class name] = [mean, min, max, 1-sigma, scale, role]
# - if min max irrelevant, put to None
# - if fixed, put 1-sigma to 0
# - if scale irrelevant, put to 1, otherwise to the appropriate factor
# - role is either 'cosmo', 'nuisance' or 'derived'. You should put the derived
# parameters at the end, and in case you are using the `-j fast` Cholesky
# decomposition, you should order your nuisance parameters from slowest to
# fastest.

# Cosmological parameters list

data.parameters['gamma_lam']    = [0.00,  None, None, 0.001, 1, 'cosmo']
##data.parameters['Omega_cdm'] = [0.2562,  None, None, 0.008,  1, 'cosmo']
#data.parameters['H0'] = [69, None, None, 0.005, 1, 'cosmo']
#data.parameters['w0_fld'] =[ -1.000, None, None, 0.05, 1, 'cosmo']

data.parameters['omega_b']      = [  2.2377,   None, None,      0.015, 0.01, 'cosmo']
data.parameters['omega_cdm']    = [ 0.12010,   None, None,     0.0013,    1, 'cosmo']
data.parameters['100*theta_s']  = [ 1.04110,   None, None,    0.00030,    1, 'cosmo']
data.parameters['ln10^{10}A_s'] = [  3.0447,   None, None,      0.015,    1, 'cosmo']
data.parameters['n_s']          = [  0.9659,   None, None,     0.0042,    1, 'cosmo']
data.parameters['tau_reio']     = [  0.0543,  0.004, None,      0.008,    1, 'cosmo']

# Nuisance parameter list, same call, except the name does not have to be a class name

data.parameters['A_cib_217']         = [    47.2,     0,   200,     6.2593,     1, 'nuisance']
data.parameters['cib_index']         = [    -1.3,  -1.3,  -1.3,          0,     1, 'nuisance']
data.parameters['xi_sz_cib']         = [    0.42,     0,     1,       0.33,     1, 'nuisance']
data.parameters['A_sz']              = [    7.23,     0,    10,     1.4689,     1, 'nuisance']
data.parameters['ps_A_100_100']      = [   251.0,     0,   400,     29.438,     1, 'nuisance']
data.parameters['ps_A_143_143']      = [    47.4,     0,   400,     9.9484,     1, 'nuisance']
data.parameters['ps_A_143_217']      = [    47.3,     0,   400,     11.356,     1, 'nuisance']
data.parameters['ps_A_217_217']      = [   119.8,     0,   400,     10.256,     1, 'nuisance']
data.parameters['ksz_norm']          = [    0.01,     0,    10,     2.7468,     1, 'nuisance']
data.parameters['gal545_A_100']      = [    8.86,     0,    50,     1.8928,     1, 'nuisance']
data.parameters['gal545_A_143']      = [   11.10,     0,    50,     1.8663,     1, 'nuisance']
data.parameters['gal545_A_143_217']  = [    19.8,     0,   100,     3.8796,     1, 'nuisance']
data.parameters['gal545_A_217']      = [    95.1,     0,   400,     6.9759,     1, 'nuisance']
data.parameters['galf_EE_A_100']     = [   0.055, 0.055, 0.055,          0,     1, 'nuisance']
data.parameters['galf_EE_A_100_143'] = [   0.040, 0.040, 0.040,          0,     1, 'nuisance']
data.parameters['galf_EE_A_100_217'] = [   0.094, 0.094, 0.094,          0,     1, 'nuisance']
data.parameters['galf_EE_A_143']     = [   0.086, 0.086, 0.086,          0,     1, 'nuisance']
data.parameters['galf_EE_A_143_217'] = [    0.21,  0.21,  0.21,          0,     1, 'nuisance']
data.parameters['galf_EE_A_217']     = [    0.70,  0.70,  0.70,          0,     1, 'nuisance']
data.parameters['galf_EE_index']     = [    -2.4,  -2.4,  -2.4,          0,     1, 'nuisance']
data.parameters['galf_TE_A_100']     = [   0.114,     0,    10,   0.038762,     1, 'nuisance']
data.parameters['galf_TE_A_100_143'] = [   0.134,     0,    10,   0.030096,     1, 'nuisance']
data.parameters['galf_TE_A_100_217'] = [   0.482,     0,    10,   0.086185,     1, 'nuisance']
data.parameters['galf_TE_A_143']     = [   0.224,     0,    10,   0.055126,     1, 'nuisance']
data.parameters['galf_TE_A_143_217'] = [   0.664,     0,    10,   0.082349,     1, 'nuisance']
data.parameters['galf_TE_A_217']     = [    2.08,     0,    10,    0.27175,     1, 'nuisance']
data.parameters['galf_TE_index']     = [    -2.4,  -2.4,  -2.4,          0,     1, 'nuisance']
data.parameters['calib_100T']        = [  999.69,     0,  3000,    0.61251, 0.001, 'nuisance']
data.parameters['calib_217T']        = [  998.16,     0,  3000,    0.63584, 0.001, 'nuisance']
data.parameters['calib_100P']        = [   1.021, 1.021, 1.021,          0,     1, 'nuisance']
data.parameters['calib_143P']        = [   0.966, 0.966, 0.966,          0,     1, 'nuisance']
data.parameters['calib_217P']        = [   1.040, 1.040, 1.040,          0,     1, 'nuisance']
data.parameters['A_cnoise_e2e_100_100_EE'] = [ 1,     1,     1,          0,     1, 'nuisance']
data.parameters['A_cnoise_e2e_143_143_EE'] = [ 1,     1,     1,          0,     1, 'nuisance']
data.parameters['A_cnoise_e2e_217_217_EE'] = [ 1,     1,     1,          0,     1, 'nuisance']
data.parameters['A_sbpx_100_100_TT'] = [       1,     1,     1,          0,     1, 'nuisance']
data.parameters['A_sbpx_143_143_TT'] = [       1,     1,     1,          0,     1, 'nuisance']
data.parameters['A_sbpx_143_217_TT'] = [       1,     1,     1,          0,     1, 'nuisance']
data.parameters['A_sbpx_217_217_TT'] = [       1,     1,     1,          0,     1, 'nuisance']
data.parameters['A_sbpx_100_100_EE'] = [       1,     1,     1,          0,     1, 'nuisance']
data.parameters['A_sbpx_100_143_EE'] = [       1,     1,     1,          0,     1, 'nuisance']
data.parameters['A_sbpx_100_217_EE'] = [       1,     1,     1,          0,     1, 'nuisance']
data.parameters['A_sbpx_143_143_EE'] = [       1,     1,     1,          0,     1, 'nuisance']
data.parameters['A_sbpx_143_217_EE'] = [       1,     1,     1,          0,     1, 'nuisance']
data.parameters['A_sbpx_217_217_EE'] = [       1,     1,     1,          0,     1, 'nuisance']
data.parameters['A_planck']          = [ 1.00061,   0.9,   1.1,     0.0025,     1, 'nuisance']
data.parameters['A_pol']             = [       1,     1,     1,          0,     1, 'nuisance']

# Nuisance Pantheon
#data.parameters['alpha']   = [0.15 ,  None, None, 0.001, 1, 'nuisance']
#data.parameters['beta']    = [3.559,  None, None, 0.02,  1, 'nuisance']
data.parameters['M']       = [-19.02, None, None, 0.004,  1, 'nuisance']
#data.parameters['Delta_M'] = [-0.10,  None, None, 0.004,  1, 'nuisance']

# Derived parameters

data.parameters['z_reio']          = [1, None, None, 0,     1,   'derived']
#data.parameters['Omega_Lambda']    = [1, None, None, 0,     1,   'derived']
data.parameters['YHe']             = [1, None, None, 0,     1,   'derived']
data.parameters['H0']              = [0, None, None, 0,     1,   'derived']
data.parameters['A_s']             = [0, None, None, 0,  1e-9,   'derived']
data.parameters['sigma8']          = [0, None, None, 0,     1,   'derived']
######
data.parameters['Omega_m']         = [0,    -1, -1, 0,1,  'derived']

# Other cosmo parameters (fixed parameters, precision parameters, etc.)

data.cosmo_arguments['sBBN file'] = data.path['cosmo']+'/external/bbn/sBBN.dat'
# BBN file path is automatically set to match CLASS version if 'sBBN file' is requested
# You can force the code to use the exact BBN file passed above with flag
#data.custom_bbn_file = True

data.cosmo_arguments['k_pivot'] = 0.05

# The base model features two massless
# and one massive neutrino with m=0.06eV.
# The settings below ensures that Neff=3.046
# and m/omega = 93.14 eV
data.cosmo_arguments['N_ur'] = 2.0328
data.cosmo_arguments['N_ncdm'] = 1
data.cosmo_arguments['m_ncdm'] = 0.06
data.cosmo_arguments['T_ncdm'] = 0.71611

# These two are required to get sigma8 as a derived parameter
# (class must compute the P(k) until sufficient k)
data.cosmo_arguments['output'] = 'mPk'
data.cosmo_arguments['P_k_max_h/Mpc'] = 1.

data.cosmo_arguments['w0_fld'] =-1.00
#data.cosmo_arguments['Omega_b'] = 0.05
data.cosmo_arguments['Omega_Lambda']=0
data.cosmo_arguments['model']=2

#------ Mcmc parameters ----

data.N=10
data.write_step=5
JaelssonLima commented 7 months ago

Now it worked by doing: data.over_sampling=[1, 5, 1]. J.

brinckmann commented 6 months ago

Hi Jaelsson,

You might want to use oversampling=[1, 5, 5] instead of [1, 5, 1], this way you're oversampling the nuisance parameters of both likelihoods. I think with the other setup the nuisance parameter 'M' would not get oversampled and it would probably be faster to do so, as the Pantheon likelihood is fast to run, if I remember correctly. On the other hand, if you find your setup works well then don't worry about it.

For clarity, the 1 refers to the sampling rate of the cosmological parameters (normally set to 1), the second entry refers to the oversampling rate of the nuisance parameters in the first likelihood with nuisance parameters in your likelihood list, in this case Planck, and the third refers to the oversampling rate of the nuisance parameters in the second likelihood with nuisance parameters, in this case Pantheon.

Best, Thejs

JaelssonLima commented 6 months ago

thank you very much Att, J.