camb version variance

Use of Healpix, camb, CLASS, cosmomc, compilers, etc.
Post Reply
Angela Chen
Posts: 18
Joined: January 11 2019
Affiliation: University of Michigan

camb version variance

Post by Angela Chen » July 11 2019

Hi all,

I was writing a wrapper for camb-1.0.3, and in the test comparing to previous wrapper for camb-Jan15, there was a ~5% difference in pk at high k>10^-2 regime. Is this expected as version variance or it's possibly due to some parameter setting difference?

Thanks,
Angela

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

Re: camb version variance

Post by Antony Lewis » July 12 2019

Sounds high, more likely a parameter difference (e.g. different Halofit version).

Angela Chen
Posts: 18
Joined: January 11 2019
Affiliation: University of Michigan

Re: camb version variance

Post by Angela Chen » July 12 2019

Antony Lewis wrote:
July 12 2019
Sounds high, more likely a parameter difference (e.g. different Halofit version).
it was the linear power spectrum difference. Linear power difference transited around k~0.1 from 0 to 5%

Angela Chen
Posts: 18
Joined: January 11 2019
Affiliation: University of Michigan

Re: camb version variance

Post by Angela Chen » July 12 2019

Antony Lewis wrote:
July 12 2019
Sounds high, more likely a parameter difference (e.g. different Halofit version).
One thing I was concerned about is that in the older version of the wrapper, transfer_redshift was set by hand, while in newer version transfer_redshifts are treated as cambdata and calculated by pk_redshifts inputs. could that be the cause of the difference?

Angela Chen
Posts: 18
Joined: January 11 2019
Affiliation: University of Michigan

Re: camb version variance

Post by Angela Chen » July 13 2019

it seems that the difference is correlated to massive neutrino. when setting omnuh2=0 the difference is <0.2%. Could it due to the evolution of camb's treatment for massive nu?

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

Re: camb version variance

Post by Antony Lewis » July 14 2019

Is this a linear effect, or nonlinear? Check settings are the same, and if so please give full reproducing settings.

Angela Chen
Posts: 18
Joined: January 11 2019
Affiliation: University of Michigan

Re: camb version variance

Post by Angela Chen » July 19 2019

Antony Lewis wrote:
July 14 2019
Is this a linear effect, or nonlinear? Check settings are the same, and if so please give full reproducing settings.
after some debugging now the difference goes down to ~1.2%, still raising only higher than k/h~0.01. Also, this difference is correlated with massive neutrino, when fixing omnuh2=0 the difference is only 0.2%. Does it sound normal now?

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

Re: camb version variance

Post by Antony Lewis » July 21 2019

Sounds quite large, what are your settings? Do you get exactly the same background quantities? (zstar, rdrag etc)

Angela Chen
Posts: 18
Joined: January 11 2019
Affiliation: University of Michigan

Re: camb version variance

Post by Angela Chen » July 22 2019

Antony Lewis wrote:
July 21 2019
Sounds quite large, what are your settings? Do you get exactly the same background quantities? (zstar, rdrag etc)
Is there a subroutine to print the settings out when not running from a ini file? just asking to save potentially wasted time to write a new one, I only found the subroutine that writes out the ini objects so far.

background quantities output:

camb_1.0.3

Reion redshift = 10.129
Om_b h^2 = 0.02215894
Om_c h^2 = 0.11690264
Om_nu h^2 = 0.00061550
Om_darkenergy = 0.70494777
Om_K = 0.00000000
Om_m (inc Om_u) = 0.29500000
100 theta (CosmoMC) = 1.04220342
N_eff (total) = 3.046000
3 nu, g= 3.0460 m_nu*c^2/k_B/T_nu0= 113.33 (m_nu= 0.019 eV)
Reion opt depth = 0.0800
Age of universe/GYr = 13.760
zstar = 1089.91
r_s(zstar)/Mpc = 145.41
100*theta = 1.042433
DA(zstar)/Gpc = 13.94891
zdrag = 1059.22
r_s(zdrag)/Mpc = 148.16
k_D(zstar) Mpc = 0.1396
100*theta_D = 0.161359
z_EQ (if v_nu=1) = 3323.12
k_EQ Mpc (if v_nu=1) = 0.010142
100*theta_EQ = 0.828116
100*theta_rs_EQ = 0.457323
tau_recomb/Mpc = 282.43 tau_now/Mpc = 14231.1

camb_jan15

Reion redshift = 10.130
Om_b h^2 = 0.022159
Om_c h^2 = 0.116903
Om_nu h^2 = 0.000616
Om_Lambda = 0.705000
Om_K = 0.000000
Om_m (1-Om_K-Om_L) = 0.295000
100 theta (CosmoMC) = 1.042209
N_eff (total) = 3.046000
3 nu, g= 3.0460 m_nu*c^2/k_B/T_nu0= 113.39 (m_nu= 0.019 eV)
Reion opt depth = 0.0800
Age of universe/GYr = 13.760
zstar = 1089.91
r_s(zstar)/Mpc = 145.41
100*theta = 1.042418
DA(zstar)/Gpc = 13.94883
zdrag = 1059.21
r_s(zdrag)/Mpc = 148.16
k_D(zstar) Mpc = 0.1396
100*theta_D = 0.161356
z_EQ (if v_nu=1) = 3323.12
k_EQ Mpc (if v_nu=1) = 0.010142
100*theta_EQ = 0.828121
100*theta_rs_EQ = 0.457308
tau_recomb/Mpc = 282.43 tau_now/Mpc = 14231.0

Angela Chen
Posts: 18
Joined: January 11 2019
Affiliation: University of Michigan

Re: camb version variance

Post by Angela Chen » July 23 2019

Here are the cosmological parameters

[cosmological_parameters]
omega_m = 0.3
h0 = 0.7
omega_b = 0.05
n_s = 0.95
A_s = 2.3e-09
omnuh2 = 0.0006
w = -1.0
massive_nu = 1
massless_nu = 2.046
omega_k = 0.0
tau = 0.08
wa = 0.0

;Helium mass fraction. Needed for Planck
yhe = 0.25

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

Re: camb version variance

Post by Antony Lewis » July 23 2019

Cosmologies look consistent then. In python you can just do print(params). Which variable (or combination) are you calculating P(k) spectrum for?

Angela Chen
Posts: 18
Joined: January 11 2019
Affiliation: University of Michigan

Re: camb version variance

Post by Angela Chen » July 23 2019

Antony Lewis wrote:
July 23 2019
Cosmologies look consistent then. In python you can just do print(params). Which variable (or combination) are you calculating P(k) spectrum for?
cold dark matter only. the difference showed a positive correlation with omnuh2, so I'm looking into the neutrino settings now. Could you tell me if there's any change in the massive neutrino related parameter definitions since Jan 2015?

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

Re: camb version variance

Post by Antony Lewis » July 31 2019

I don't recall the exact situation in 2015. I would check both spectra actually are cold dark matter only.
The neutrino settings certainly look odd, with mnu=0.02eV rather than one with 0.06eV.

Angela Chen
Posts: 18
Joined: January 11 2019
Affiliation: University of Michigan

Re: camb version variance

Post by Angela Chen » July 31 2019

Antony Lewis wrote:
July 31 2019
I don't recall the exact situation in 2015. I would check both spectra actually are cold dark matter only.
The neutrino settings certainly look odd, with mnu=0.02eV rather than one with 0.06eV.
Hi Antony, you were right, I made mistake on transfer variable settings. now they agree at level ~0.1%. Thank you so much! and sorry for bugging you so long for this trivial mistake.

Post Reply