Skip to content

Commit

Permalink
Remove testing dependency on http download for radon dataset (#1717)
Browse files Browse the repository at this point in the history
  • Loading branch information
utkarsh-maheshwari authored Jun 7, 2021
1 parent 4d9caca commit d90c79d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions arviz/tests/base_tests/test_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,9 +605,16 @@ def test_loo_pit_multidim(multidim_models, args):


def test_loo_pit_multi_lik():
idata = load_arviz_data("radon")
idata.log_likelihood["by_county"] = (
idata.log_likelihood["y"].groupby(idata.constant_data["county_idx"]).sum()
rng = np.random.default_rng(0)
post_pred = rng.standard_normal(size=(4, 100, 10))
obs = np.quantile(post_pred, np.linspace(0, 1, 10))
obs[0] *= 0.9
obs[-1] *= 1.1
idata = from_dict(
posterior={"a": np.random.randn(4, 100)},
posterior_predictive={"y": post_pred},
observed_data={"y": obs},
log_likelihood={"y": -(post_pred ** 2), "decoy": np.zeros_like(post_pred)},
)
loo_pit_data = loo_pit(idata, y="y")
assert np.all((loo_pit_data >= 0) & (loo_pit_data <= 1))
Expand Down

0 comments on commit d90c79d

Please sign in to comment.