Skip to content

Commit

Permalink
Also ensure that posterior std is lower than prior
Browse files Browse the repository at this point in the history
  • Loading branch information
victor committed Jul 15, 2024
1 parent 87dd240 commit ec7f9bb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_sts.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,12 @@ def numpyro_model(n, y_):
mcmc.run(key, y.shape[0], y_=y)

samples = mcmc.get_samples()
quantiles = np.quantile(samples["std"], [0.001, 0.999])
low, high = np.quantile(samples["std"], [0.001, 0.999])

assert (quantiles[0] <= true_model.std <= quantiles[1]).all()
assert (low <= true_model.std <= high).all()

# NB: this should be fetched from the predictive distribution rather...
assert samples["std"].std() <= 1.0


@pt.mark.parametrize("shape", [(), (10,)])
Expand Down

0 comments on commit ec7f9bb

Please sign in to comment.