Page 1 of 1

[CosmoMC Nov 2016] Selective sampling off CosmoMC likelihood

Posted: January 18 2018
by Luke Hart
Dear Antony,

I'm currently thinking of using CosmoMC for the calculation of the likelihood for a given set of parameter lists, where I can set the parameter values that CosmoMC samples from.

Am I right in thinking this should be done in the GenericLikelihoodFunction part of the code because I'd assume that's reserved for calculating the likelihood in a different way, rather than just attaining a given likelihood for a given set of parameters.

Once again, apologies if this is obvious, my Fortran is a bit shaky so any help will be appreciated!

Luke

Re: [CosmoMC Nov 2016] Selective sampling off CosmoMC likeli

Posted: January 19 2018
by Antony Lewis
If you are using a custom function, rather than cosmology codes + likelihoods using them, you can use GenericLikelihoodFunction to use CosmoMC as a generic sampler.

[CosmoMC Nov 2016] Selective sampling off CosmoMC likelihood

Posted: January 19 2018
by Luke Hart
Sorry Antony I don’t think I was clear in what I needed.

I want specific samples from CosmoMC using the same infrastructure. Using the same datasets in the same way

Code: Select all

include(BAO.ini)
However, the sampling on the grid I want is just a set amount of samples around the fiducial model. Essentially just the best fit parameters and then each parameter plus or minus a small change, as necessary for the Fisher analysis.

I also need to vary one integer parameter that indexes certain changes to my code. So I believe it’s a little more complicated than just using estimate_propose_matrix.

Thanks
Luke

Re: [CosmoMC Nov 2016] Selective sampling off CosmoMC likeli

Posted: January 20 2018
by Antony Lewis
I guess you'd need to write your own code to call the likelihood functions. e.g. you can see how the minimize.f90 file does it for minimization.

[CosmoMC Nov 2016] Selective sampling off CosmoMC likelihood

Posted: February 07 2018
by Luke Hart
Dear Antony,

Thank you for your suggestions, I'm currently rooting around in CosmoMC now. The complication I'm finding is that I'm trying to make sure that nuisance parameters are marginalised over as well, so I'm struggling to see where I can pass these new samples over and how. The BOBYQA routines are giving me hints but I'm confused as to how they actually get a set list of samples.

Thanks

Luke