Skip to content

Commit d6f5741

Browse files
committed
add test for symmetric uncertainty measure in recovery
1 parent 217ea69 commit d6f5741

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

tests/test_diagnostics/test_diagnostics_plots.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,20 @@ def test_loss(history):
9292
assert out.axes[0].title._text == "Loss Trajectory"
9393

9494

95-
def test_recovery(random_estimates, random_targets):
95+
def test_recovery_bounds(random_estimates, random_targets):
9696
# basic functionality: automatic variable names
97-
out = bf.diagnostics.plots.recovery(random_estimates, random_targets, markersize=4)
97+
from bayesflow.utils.numpy_utils import credible_interval
98+
99+
out = bf.diagnostics.plots.recovery(
100+
random_estimates, random_targets, markersize=4, uncertainty_agg=credible_interval
101+
)
102+
assert len(out.axes) == num_variables(random_estimates)
103+
assert out.axes[2].title._text == "sigma"
104+
105+
106+
def test_recovery_symmetric(random_estimates, random_targets):
107+
# basic functionality: automatic variable names
108+
out = bf.diagnostics.plots.recovery(random_estimates, random_targets, markersize=4, uncertainty_agg=np.std)
98109
assert len(out.axes) == num_variables(random_estimates)
99110
assert out.axes[2].title._text == "sigma"
100111

0 commit comments

Comments
 (0)