Bestfit Power Spectrum with action=2 in Cosmomc

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Omar Ruiz Macias
Posts: 10
Joined: February 15 2014
Affiliation: Cinvestav

Bestfit Power Spectrum with action=2 in Cosmomc

Post by Omar Ruiz Macias » August 29 2014

Hi everyone,

I'm trying to figure out where are the parameters that are used to generate the file "file_root.minimum.theory_cl" containing the bestfit data of the Power Spectrum.
Initially, I thought the bestfit parameters were those in "file_root.minimum", so I used them in CAMB expecting to obtain the same plot as with Cosmomc, but instead, I have found it doesn't match at all. The Cosmomc plot Is shifted upwards significantly compared to that generated by CAMB.

As an example, I am showing here the plot for the Grid PLA I have downloaded from: http://cosmologist.info/cosmomc/readme_planck.html, "base_planck_lowl_lowLike.bestfit_cl", and used those bestfit parameters in file "base_planck_lowl_lowLike.minimum" with CAMB (May 2014) and named this output "LCDM_scalCls.dat".

test6.jpg

My question is, is it possible to generate with CAMB the same plot as that obtained from the file "file_root.minimum.theory_cl" generated by Cosmomc?
If so, where I can find those parameters?

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

Re: Bestfit Power Spectrum with action=2 in Cosmomc

Post by Antony Lewis » August 29 2014

It is probably just an issue of setting consistent parameters. In cosmomc, there is a script python/bestFitCAMB.py for converting a .minimum file to a CAMB .ini file.

Omar Ruiz Macias
Posts: 10
Joined: February 15 2014
Affiliation: Cinvestav

Bestfit Power Spectrum with action=2 in Cosmomc

Post by Omar Ruiz Macias » September 03 2014

Thank you so much, Antony!
Inside the file (bestFitCAMB.py) comes exactly what I was looking for.

Best regards!

Lukas Hergt
Posts: 4
Joined: December 01 2017
Affiliation: Cambridge University
Contact:

Bestfit Power Spectrum with action=2 in Cosmomc

Post by Lukas Hergt » December 12 2017

Running extractBestFitCAMB.py to get a CAMB .ini file is very helpful. However, it does not provide a value for l_max_scalar. Which value does CosmoMC use by default (e.g. for a Planck TTlowP run), when generating the file file_root.minimum.theory_cl? It seems to use something higher than CAMB's default 2500...

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

Re: Bestfit Power Spectrum with action=2 in Cosmomc

Post by Antony Lewis » December 12 2017

It's probably the plik lmax + 150 (the +150 to make sure lensed CL are OK at lmax). CAMB python wrapper's set_for_lmax function should do the same thing.

Lukas Hergt
Posts: 4
Joined: December 01 2017
Affiliation: Cambridge University
Contact:

Bestfit Power Spectrum with action=2 in Cosmomc

Post by Lukas Hergt » December 13 2017

Thanks, Anthony.

Without specifying lmax in pycamb's set_for_lmax() it is set to lmax=2400+100 (kmax=5000). When comparing the CosmoMC .minimum.theory_cl output with the pycamb calculation I get a relative deviation of up to 0.5%.

By cranking up to lmax=4500+100 (kmax=11500) the relative deviation goes down to a maximum of 0.04%.

They are very close in both cases, but since they agree more with higher lmax/kmax I was wondering which lmax/kmax CosmoMC uses (since it doesn't seem to be the pycamb default).

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

Re: Bestfit Power Spectrum with action=2 in Cosmomc

Post by Antony Lewis » December 14 2017

You do need to use set_for_lmax to get something like Cosmomc.
CosmoMC also uses the non-linear lensing potential: use pycamb's lens_potential_accurac=1 option to set_for_lmax.

Lukas Hergt
Posts: 4
Joined: December 01 2017
Affiliation: Cambridge University
Contact:

Bestfit Power Spectrum with action=2 in Cosmomc

Post by Lukas Hergt » December 14 2017

set_for_lmax(lens_potential_accuracy=1) in pycamb indeed increases kmax to 18000 (it seems regardless of lmax) and, hence, explains the difference described above.

It seems cranking up kmax is actually all that lens_potential_accuracy=1 does. At least I get the exact same result when setting set_for_lmax(max_eta_k=18000, lens_potential_accuracy=0).

Thanks for the hint!

Post Reply