## [CosmoMC Nov 2016] Selective sampling off CosmoMC likelihood calculator

Use of Healpix, camb, CLASS, cosmomc, compilers, etc.
Luke Hart
Posts: 47
Joined: July 13 2015
Affiliation: University of Manchester

### [CosmoMC Nov 2016] Selective sampling off CosmoMC likelihood

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

Antony Lewis
Posts: 1484
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

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

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.

Luke Hart
Posts: 47
Joined: July 13 2015
Affiliation: University of Manchester

### [CosmoMC Nov 2016] Selective sampling off CosmoMC likelihood

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&#40;BAO.ini&#41;
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

Antony Lewis
Posts: 1484
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

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

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.

Luke Hart
Posts: 47
Joined: July 13 2015
Affiliation: University of Manchester

### [CosmoMC Nov 2016] Selective sampling off CosmoMC likelihood

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