Skip to content

Commit

Permalink
add back compute_bayes_factor test
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmoMatt committed May 1, 2024
1 parent 46ed2a5 commit fa51681
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_evidence.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,16 @@ def test_compute_bayes_factors():
assert bf12 == pytest.approx(np.exp(ln_bf12))
assert bf12_std == pytest.approx(np.exp(ln_bf12_std))

# Test bayes factor reduces to single evidence calculation.
ev2 = cbe.Evidence(nchains, sphere)
ev2.ln_evidence_inv = 0
ev2.ln_evidence_inv_var = -np.inf
ev2.chains_added = True
(bf12, bf12_std) = cbe.compute_bayes_factor(ev1, ev2)

(evidence, evidence_std) = ev1.compute_evidence()
assert bf12 == pytest.approx(evidence)
assert bf12_std == pytest.approx(evidence_std)

@pytest.mark.parametrize("model", models_to_test_2)
def test_serialization(model):
Expand Down

0 comments on commit fa51681

Please sign in to comment.