Skip to content

Commit

Permalink
Fix #1461: test for bridge sampling (#1473)
Browse files Browse the repository at this point in the history
* change test_bridge_sampling to laplace

* increase flaky

---------

Co-authored-by: Paul Jonas Jost <70631928+PaulJonasJost@users.noreply.github.com>
  • Loading branch information
arrjon and PaulJonasJost authored Sep 26, 2024
1 parent f92fc8b commit ab61c4a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/sample/test_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ def test_harmonic_mean_log_evidence():
)


@pytest.mark.flaky(reruns=2)
@pytest.mark.flaky(reruns=3)
def test_bridge_sampling():
tol = 2
# define problem
Expand Down Expand Up @@ -965,5 +965,7 @@ def test_bridge_sampling():

# compute the log evidence using harmonic mean
bridge_log_evidence = sample.evidence.bridge_sampling_log_evidence(result)
harmonic_evidence = sample.evidence.harmonic_mean_log_evidence(result)
assert np.isclose(bridge_log_evidence, harmonic_evidence, atol=tol)
laplace = sample.evidence.laplace_approximation_log_evidence(
problem, result.optimize_result.x[0]
)
assert np.isclose(bridge_log_evidence, laplace, atol=tol)

0 comments on commit ab61c4a

Please sign in to comment.