Skip to content

Commit 3d6adc8

Browse files
committed
Updated Examples
Updated LCDM Lite YAML to use correct priors, LCDM Lite example to use new YAML file and updated example notebook to include warmstart points
1 parent e2ccdf8 commit 3d6adc8

3 files changed

Lines changed: 75 additions & 60 deletions

File tree

‎examples/Example Notebook.ipynb‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,33 @@
661661
" )"
662662
]
663663
},
664+
{
665+
"cell_type": "markdown",
666+
"id": "c82252ba-8982-476f-91ec-c53ae21d1a8b",
667+
"metadata": {},
668+
"source": [
669+
"One can alternatively provide initialisation or 'warmstart' points to BOBE instead of using Cobaya initialisation samples. This is particularly useful for cases such as nested cosmological models but one must be careful to ensure the init_train_y are valid for the new likelihood"
670+
]
671+
},
672+
{
673+
"cell_type": "code",
674+
"execution_count": null,
675+
"id": "c01795ae-c26a-4b9b-804c-5217f867357a",
676+
"metadata": {},
677+
"outputs": [],
678+
"source": [
679+
"sampler = BOBE(\n",
680+
" loglikelihood='path/to/cobaya_input.yaml',\n",
681+
" likelihood_name='CobayaLikelihood',\n",
682+
" n_sobol_init=4,\n",
683+
" init_train_x=init_train_x,\n",
684+
" init_train_y=init_train_y,\n",
685+
" likelihood_name='quickstart_cobaya_example', # name for output files\n",
686+
" save_dir='./results',\n",
687+
" use_clf=True # recommended to enable classifiers for cosmological examples where likelihood can sometimes return -inf values\n",
688+
" )"
689+
]
690+
},
664691
{
665692
"cell_type": "markdown",
666693
"id": "81c3be5d-24be-49dc-850e-f7c035c8741f",

‎examples/Planck_lite_LCDM.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ def main():
3333
n_sobol_init=8,
3434
use_clf=True,
3535
clf_type='svm',
36-
#clf_nsigma_threshold=15,
3736
minus_inf=-1e5,
3837
seed=10,
3938
)

‎examples/cosmo_input/LCDM_lite.yaml‎

Lines changed: 48 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -9,98 +9,87 @@ theory:
99
nnu: 3.044
1010
dark_energy_model: 'fluid'
1111
likelihood:
12-
# one:
1312
planck_2018_lowl.TT: null
1413
planck_2018_lowl.EE: null
1514
planck_2018_highl_plik.TTTEEE_lite_native: null
1615
planck_2018_lensing.native: null
1716
params:
18-
w: -1.
19-
omk:
20-
value: 0
21-
renames:
22-
- omegak
2317
omch2:
24-
latex: \Omega_\mathrm{c} h^2
25-
prior:
26-
min: 0.1
27-
max: 0.14
28-
ref:
29-
dist: norm
30-
loc: 0.12
31-
scale: 0.001
32-
proposal: 0.0005
33-
renames:
34-
- omegach2
35-
ombh2:
36-
prior:
37-
min: 0.015
38-
max: 0.028
39-
ref:
40-
dist: norm
41-
loc: 0.0224
42-
scale: 0.0001
43-
proposal: 0.0001
44-
latex: \Omega_\mathrm{b} h^2
45-
renames:
46-
- omegabh2
18+
latex: \Omega_\mathrm{c} h^2
19+
prior:
20+
min: 0.11
21+
max: 0.13
22+
ref:
23+
dist: norm
24+
loc: 1.186384753e-01
25+
scale: 0.0005
26+
proposal: 0.0005
4727
logA:
4828
prior:
49-
min: 2.9
50-
max: 3.2
29+
min: 2.98
30+
max: 3.10
5131
ref:
5232
dist: norm
53-
loc: 3.05
33+
loc: 3.040776555e+00
5434
scale: 0.001
5535
proposal: 0.001
5636
latex: \log(10^{10} A_\mathrm{s})
37+
# drop: true
5738
As:
58-
value: 'lambda logA: 1e-10*np.exp(logA)'
59-
latex: A_\mathrm{s}
60-
derived: true
39+
value: 'lambda logA: 1e-10*np.exp(logA)'
40+
latex: A_\mathrm{s}
6141
ns:
6242
prior:
63-
min: 0.92
64-
max: 1.0
43+
min: 0.94
44+
max: 0.99
6545
ref:
6646
dist: norm
67-
loc: 0.965
68-
scale: 0.004
47+
loc: 9.652909209e-01
48+
scale: 0.002
6949
proposal: 0.002
7050
latex: n_\mathrm{s}
71-
H0:
51+
H0:
7252
latex: H_0
7353
prior:
74-
min: 62
54+
min: 64
7555
max: 72
7656
ref:
7757
dist: norm
78-
loc: 67.2
79-
scale: 0.1
80-
proposal: 0.05
58+
loc: 6.771234910e+01
59+
scale: 0.05
60+
proposal: 0.05
61+
ombh2:
62+
prior:
63+
min: 0.021
64+
max: 0.023
65+
ref:
66+
dist: norm
67+
loc: 2.224954976e-02
68+
scale: 0.0001
69+
proposal: 0.0001
70+
latex: \Omega_\mathrm{b} h^2
8171
tau:
8272
latex: \tau_\mathrm{reio}
8373
prior:
8474
min: 0.03
8575
max: 0.08
8676
ref:
8777
dist: norm
88-
loc: 0.055
89-
scale: 0.006
78+
loc: 5.546101493e-02
79+
scale: 0.003
9080
proposal: 0.003
9181
A_planck:
92-
latex: y_\mathrm{cal}
93-
renames: calPlanck
9482
value: 1.0
83+
9584
sampler:
96-
# polychord:
97-
# nlive: 10d
98-
# precision_criterion: 0.01
99-
mcmc:
100-
drag: False
101-
oversample_power: 0.4
102-
proposal_scale: 1.9
103-
covmat: auto
104-
Rminus1_stop: 0.01
105-
Rminus1_cl_stop: 0.2
106-
output: chains/Planck_lite_mcmc
85+
polychord:
86+
nlive: 30d
87+
precision_criterion: 0.01
88+
# mcmc:
89+
# drag: False
90+
# oversample_power: 0.4
91+
# proposal_scale: 1.9
92+
# covmat: auto
93+
# Rminus1_stop: 0.01
94+
# Rminus1_cl_stop: 0.2
95+
output: chains/Planck_lite_pchord

0 commit comments

Comments
 (0)