Modifyng CAMB with Cobaya
-
- Posts: 17
- Joined: October 05 2021
- Affiliation: UCI
Modifyng CAMB with Cobaya
I wanted to run cobaya with EDE modifying the .ini file that the CAMB that cobaya uses reads. How can I make cobaya read a modified .ini file for CAMB?
Thank you!
Thank you!
-
- Posts: 1852
- Joined: September 23 2004
- Affiliation: University of Sussex
- Contact:
Re: Modifyng CAMB with Cobaya
You need to pass the relevant parameters via the Cobaya input yaml file.
-
- Posts: 17
- Joined: October 05 2021
- Affiliation: UCI
Re: Modifyng CAMB with Cobaya
That is what I did! I followed the instructions if the documentation. I added the extra parameters of modified CAMB in the theory block and in the params block (I paste the modified part of the .yaml file at the end of this message). But when I run cobaya I get the following error:
cobaya.log.LoggedError: Could not find anything to use input parameter(s) {'extra_param_1', 'extra_param_2'}.
I want to modify the dark energy model, if I was running CAMB I would input a different .ini file (setting dark_energy_model = 'EarlyQuintessence' ), but I don't know how to do this with cobaya. Do you know how can I get cobaya to identify the extra input parameters?
Thank you in advance!
cobaya.log.LoggedError: Could not find anything to use input parameter(s) {'extra_param_1', 'extra_param_2'}.
I want to modify the dark energy model, if I was running CAMB I would input a different .ini file (setting dark_energy_model = 'EarlyQuintessence' ), but I don't know how to do this with cobaya. Do you know how can I get cobaya to identify the extra input parameters?
Thank you in advance!
Code: Select all
theory:
camb:
extra_args:
extra_param_1:
extra_param_2:
params:
extra_param_1:
prior:
min: 0
max: 1
ref:
dist: norm
loc: 0.5
scale: 0.1
proposal: 0.05
latex: '{\rm{extra_param_1}}'
extra_param_2:
prior:
min: 0
max: 1
ref:
dist: norm
loc: 0.5
scale: 0.1
proposal: 0.05
latex: '{\rm{extra_param_2}}'
-
- Posts: 1852
- Joined: September 23 2004
- Affiliation: University of Sussex
- Contact:
Re: Modifyng CAMB with Cobaya
There's no parameter called "extra_param_1" in the supplied CAMB.
you need to set dark_energy_model in the extra_args input, and use the actual parameter names when sampling (not in extra_args).
you need to set dark_energy_model in the extra_args input, and use the actual parameter names when sampling (not in extra_args).
-
- Posts: 17
- Joined: October 05 2021
- Affiliation: UCI
Re: Modifyng CAMB with Cobaya
Thank you so much! I got it running now, but I still have an issue when using the minimizer. I get this error
calc_zc_fde: NO PEAK
[0 : minimize] *ERROR* Cannot reproduce log minimum to within 0.01. Maybe your likelihood is stochastic or large numerical error? Recomputed min: -inf (was -1.79769e+308) at array([3.05057809e+00, 9.69716464e-01, 1.04123281e+00, 2.22220221e-02,..])
Do you know what can be wrong?
Here is my .yaml file
calc_zc_fde: NO PEAK
[0 : minimize] *ERROR* Cannot reproduce log minimum to within 0.01. Maybe your likelihood is stochastic or large numerical error? Recomputed min: -inf (was -1.79769e+308) at array([3.05057809e+00, 9.69716464e-01, 1.04123281e+00, 2.22220221e-02,..])
Do you know what can be wrong?
Here is my .yaml file
Code: Select all
theory:
camb:
extra_args:
halofit_version: mead
bbn_predictor: PArthENoPE_880.2_standard.dat
lens_potential_accuracy: 1
num_massive_neutrinos: 1
nnu: 3.046
theta_H0_range:
- 20
- 100
dark_energy_model: EarlyQuintessence
n: 3
likelihood:
planck_2018_lowl.TT: null
planck_2018_lowl.EE: null
planck_2018_highl_plik.TTTEEE: null
bao.sdss_dr16_baoplus_lrg: null
bao.sdss_dr16_baoplus_lyauto: null
bao.sdss_dr16_baoplus_lyxqso: null
bao.sdss_dr16_baoplus_qso: null
params:
logA:
prior:
min: 1.61
max: 3.91
ref:
dist: norm
loc: 3.05
scale: 0.001
proposal: 0.001
latex: \log(10^{10} A_\mathrm{s})
drop: true
As:
value: 'lambda logA: 1e-10*np.exp(logA)'
latex: A_\mathrm{s}
ns:
prior:
min: 0.8
max: 1.2
ref:
dist: norm
loc: 0.965
scale: 0.004
proposal: 0.002
latex: n_\mathrm{s}
theta_MC_100:
prior:
min: 0.5
max: 10
ref:
dist: norm
loc: 1.04109
scale: 0.0004
proposal: 0.0002
latex: 100\theta_\mathrm{MC}
drop: true
renames: theta
cosmomc_theta:
value: 'lambda theta_MC_100: 1.e-2*theta_MC_100'
derived: false
H0:
latex: H_0
min: 20
max: 100
ombh2:
prior:
min: 0.005
max: 0.1
ref:
dist: norm
loc: 0.0224
scale: 0.0001
proposal: 0.0001
latex: \Omega_\mathrm{b} h^2
omch2:
prior:
min: 0.001
max: 0.99
ref:
dist: norm
loc: 0.12
scale: 0.001
proposal: 0.0005
latex: \Omega_\mathrm{c} h^2
omegam:
latex: \Omega_\mathrm{m}
omegamh2:
derived: 'lambda omegam, H0: omegam*(H0/100)**2'
latex: \Omega_\mathrm{m} h^2
mnu: 0.06
YHe:
latex: Y_\mathrm{P}
Y_p:
latex: Y_P^\mathrm{BBN}
DHBBN:
derived: 'lambda DH: 10**5*DH'
latex: 10^5 \mathrm{D}/\mathrm{H}
tau:
prior:
min: 0.01
max: 0.8
ref:
dist: norm
loc: 0.055
scale: 0.006
proposal: 0.003
latex: \tau_\mathrm{reio}
zre:
latex: z_\mathrm{re}
sigma8:
latex: \sigma_8
s8h5:
derived: 'lambda sigma8, H0: sigma8*(H0*1e-2)**(-0.5)'
latex: \sigma_8/h^{0.5}
s8omegamp5:
derived: 'lambda sigma8, omegam: sigma8*omegam**0.5'
latex: \sigma_8 \Omega_\mathrm{m}^{0.5}
s8omegamp25:
derived: 'lambda sigma8, omegam: sigma8*omegam**0.25'
latex: \sigma_8 \Omega_\mathrm{m}^{0.25}
A:
derived: 'lambda As: 1e9*As'
latex: 10^9 A_\mathrm{s}
clamp:
derived: 'lambda As, tau: 1e9*As*np.exp(-2*tau)'
latex: 10^9 A_\mathrm{s} e^{-2\tau}
age:
latex: '{\rm{Age}}/\mathrm{Gyr}'
rdrag:
latex: r_\mathrm{drag}
fde_zc:
prior:
min: 0
max: 0.5
ref:
dist: norm
loc: 0.1
scale: 0.01
proposal: 0.005
latex: '{\rm{fde_zc}}'
zc:
prior:
min: 0
max: 100000
ref:
dist: norm
loc: 10000
scale: 0.1
proposal: 0.05
latex: '{\rm{criticalz}}'
sampler:
minimize:
method: bobyqa
ignore_prior: False
max_evals: 1e6d
best_of: 2
confidence_for_unbounded: 0.9999995
output: /volumes/data2/cobaya/
debug: true