You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e2ccdf8
Browse filesBrowse the repository at this point in the historyBrowse files
BOBE (Bayesian Optimisation for Bayesian Evidence) is a high-performance package for performing Bayesian model comparison with expensive likelihood functions, developed for applications to cosmology. It uses Bayesian Optimization to train a Gaussian process surrogate for the expensive likelihood function and runs Nested sampling/MCMC on the surrogate instead of the underlying likelihood. Training the surrogate typically requires around ~100x fewer true likelihood evaluations compared to running Nested sampling/MCMC on the true likelihood, leading to significant speed-ups for slow likelihoods (t>1s). BOBE uses acquisition functions that minimise the integrated uncertainty of the surrogate, prioritising regions that matter the most for the evidence. The algorithm is explained in more detail in arxiv:2512.xxxxx. Code [documentation](https://BOBE.readthedocs.io/en/) is also available.
7
+
BOBE (Bayesian Optimisation for Bayesian Evidence) is a high-performance package for performing Bayesian model comparison with expensive likelihood functions, developed for applications to cosmology. It uses Bayesian Optimization to train a Gaussian process surrogate for the expensive likelihood function and runs Nested sampling/MCMC on the surrogate instead of the underlying likelihood. Training the surrogate typically requires around ~100x fewer true likelihood evaluations compared to running Nested sampling/MCMC on the true likelihood, leading to significant speed-ups for slow likelihoods (t>1s). BOBE uses acquisition functions that minimise the integrated uncertainty of the surrogate, prioritising regions that matter the most for the evidence. The algorithm is explained in more detail in arxiv:2512.xxxxx and code documentation is available at [https://BOBE.readthedocs.io](https://BOBE.readthedocs.io).
Copy file name to clipboardExpand all lines: docs/source/examples/cosmology.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -275,7 +275,7 @@ Expected Results
275
275
276
276
For standard ΛCDM with Planck lite:
277
277
278
-
- **Convergence**: Typically requires 100-200 evaluations with these settings. The logZ value should be approximately :math:`\log Z \approx -519.5` (exact value may vary slightly due to nested sampler stochasticity).
278
+
- **Convergence**: Typically requires 100-200 evaluations with these settings. The logZ value should be approximately :math:`\log Z \approx -520` (exact value may vary slightly due to nested sampler stochasticity).
Copy file name to clipboardExpand all lines: docs/source/examples/detailed_usage.rst
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,6 +101,7 @@ Configure and Run BOBE
101
101
102
102
103
103
Now let's set up the BOBE configuration and run the optimization. We'll use the default WIPStd (Weighted Integrated Posterior Standard Deviation) acquisition function which is a cheap and approximate measure of :math:`\Delta\log Z` (see our `paper <https://arxiv.org/abs/2512.xxxx>`_ for details).
104
+
When the value of this acquisition function drops below the provided logz_threshold, BOBE will start running nested sampling on the GP surrogate to get a precise estimate of the evidence and its uncertainty. If this uncertainty is below the threshold for a specified number of successive iterations, BOBE will declare convergence and stop.
104
105
105
106
.. code-block:: python
106
107
@@ -131,11 +132,43 @@ Now let's set up the BOBE configuration and run the optimization. We'll use the
131
132
num_hmc_warmup=256, # NUTS warmup steps
132
133
num_hmc_samples=512, # NUTS samples to draw per chain
133
134
mc_points_size=128, # Number of MC samples for acquisition function
135
+
num_chains=4, # Number of HMC chains
134
136
convergence_n_iters=1, # Number of successive iterations of \Delta\log Z < logz_threshold required to declare convergence
135
137
)
136
138
137
139
end = time.time()
138
140
141
+
Key Configuration Parameters
142
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
143
+
144
+
**BOBE Initialization Parameters**
145
+
146
+
- **loglikelihood**: The likelihood function
147
+
- **param_list**: List of parameter names (e.g., ``['x1', 'x2']``)
148
+
- **param_bounds**: Array of shape ``(2, ndim)`` with lower and upper bounds for each parameter
149
+
- **param_labels**: Optional LaTeX labels for parameters (used in plots)
150
+
- **likelihood_name**: Name used for output files
151
+
- **n_sobol_init**: Number of initial Sobol quasi-random points to sample (8 in this example)
152
+
- **seed**: Random seed for reproducibility
153
+
- **save_dir**: Directory for saving results
154
+
- **save**: Whether to save results periodically
155
+
156
+
**Run Parameters**
157
+
158
+
- **acq**: Acquisition function to use (``'wipstd'`` in this example and is the default). WIPStd is a fast approximation of evidence uncertainty and is suited for Bayesian evidence estimation.
159
+
- **min_evals**: Minimum number of likelihood evaluations before checking convergence (25 in this example, default is 200)
160
+
- **max_evals**: Maximum number of likelihood evaluations (250 in this example, default is 1500)
161
+
- **logz_threshold**: Convergence threshold for uncertainty in log evidence (0.01 in this example). Smaller values require tighter convergence. Can be relaxed to 0.5 to 1.0. for high dimensional problems.
162
+
- **fit_n_points**: Refit GP hyperparameters after adding this many new points (4 in this example, default is 10)
163
+
- **batch_size**: Number of points to acquire per iteration, 2 in this example, 1 is for standard sequential acquisition. Larger values enable batch acquisition and the likelihood evaluations can be parallelized. However, larger batch sizes (>10-20) can reduce acquisition efficiency since the GP state is not updated with the true likelihoods of all points in the batch. The update happens only after the entire batch is evaluated.
164
+
- **ns_n_points**: Run nested sampling after adding this many new points (4 in this example, default is 10)
165
+
- **num_hmc_warmup**: Number of NUTS warmup steps for sampling the GP surrogate (256 in this example, default is 512)
166
+
- **num_hmc_samples**: Number of NUTS samples to draw per chain (512 in this example), can be increased for higher dimensions but not more than a few thousand to avoid long runtimes
167
+
- **mc_points_size**: Number of Monte Carlo points for WIPStd acquisition function (128 in this example). Since this is the number of points used to estimate the acquisition function, larger values give more accurate estimates but increase computation time. For higher dimensions can be set to ~500 but not more since this slows down acquisition optimization.
168
+
- **num_chains**: Number of MCMC chains to run in parallel (default is 4)
169
+
- **convergence_n_iters**: Number of successive iterations meeting the threshold to declare convergence (1 in this example). Increase to avoid premature convergence in challenging problems.
0 commit comments