brinckmann / montepython_public

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

S_8 prior #324

Closed SafaeCosmology closed 10 months ago

SafaeCosmology commented 1 year ago

Dear All, I wanted to add a prior on S8, the first step: I defined the S8 parameter in the Montepython/data.py file then I created a folder in MontePython/Likelihood/... as in the case of SH0ES, but when I run my MCMC I get the following error '' S8 = cosmo.S8() AttributeError: 'classy.Class' object has no attribute 'S8' '' Can someone help me to solve this problem? Thanks in advance, Best regards.

----------------------------------------------------------------------------------------------------------------

S8_data_py (1)

----------------------------------------------------------------------------------------------------------------

S8_init_py (1)

brinckmann commented 1 year ago

Hi Safae,

I can understand the confusion. data.py modifies cosmo_arguments on the MontePython side, which are passed to CLASS, while cosmo is the CLASS wrapper, i.e. what comes back from CLASS after it's called. So defining S8 in data.py gives you a way to sample S8 as a parameter and then pass omega_b, omega_cdm and sigma8 to CLASS, but it doesn't teach CLASS what S8 is, so S8 is still not available via cosmo. What you need to do is to define S8 based on sigma8 and Omega_m in your prior likelihood and then apply your prior as you do now.

Best, Thejs

SafaeCosmology commented 1 year ago

Dear Dr. Thejs Brinckmann, Thank you very much for your answer. I have made the following modifications

---------------------------------------------------------------------

1

---------------------------------------------------------------------

2

---------------------------------------------------------------------

Please let me know if this is correct or not. Best regards

---------------------------------------------------------------------

brinckmann commented 1 year ago

Hi Safae,

This is how I would have done it. Make sure your cosmo_arguments for P_k_max_h/Mpc or P_k_max_1/Mpc is large enough to accurately compute sigma8. I think about P_k_max_h/Mpc = 2.0 is enough.

Best, Thejs

SafaeCosmology commented 1 year ago

Ok, thank you very much, sir.