baudren / montepython_public

Public repository for the Monte Python Code
MIT License
65 stars 114 forks source link

Flat Priors #144

Closed mehdi163 closed 3 years ago

mehdi163 commented 3 years ago

I am working on my master project that depends heavily on Monte Python and just had a few questions I was hoping I could run by you. I am having a hard time understanding how the priors in the .param file work.

So, from my understanding of the code is that the default setting is set to flat, and we need to explicitly pass instructions to make it gaussian? One thing I don't fully understand is why is there a need for a mean and a standard deviation if the default prior is set to flat? I am using an external power spectrum and trying to constrain features that I don't really know much about, besides the maximum and minimum.

ThomasTram commented 3 years ago

Hi

Yes, all priors are flat. If you want something else, you just create likelihoods with the prior of your choice and add them to the list of likelihoods - have a look at the hst likelihood which you can consider as a Gaussian prior on H0. Technically, there is really no difference between a likelihood and a prior, they are on equal footing.

The Metropolis-Hastings algorithm require a proposal density for choosing the next step in the chain, and this proposal density is (an estimate of) the Gaussian approximation to the posterior in the bestfit point. Thus, for new parameters or if an existing covariance matrix is not passed on input, MontePython will create the proposal density based on the mean and standard-deviations. (Thus, it is often better to make the standard-deviation somewhat smaller than expected for the final posterior, because it will make it easier for MontePython to figure out the proper covariance matrix.)

Cheers, Thomas