Skip to content

Commit

Permalink
seed flaky GARCH11 test
Browse files Browse the repository at this point in the history
  • Loading branch information
Goose committed Mar 3, 2025
1 parent 07fc908 commit 71019cc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/distributions/test_timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,9 @@ def test_logp(self):
@pytest.mark.parametrize("explicit_shape", (True, False))
def test_batched_size(self, explicit_shape, batched_param):
steps, batch_size = 100, 5
param_val = np.square(np.random.randn(batch_size))
random_seed = 800
rng = np.random.default_rng(random_seed)
param_val = np.square(rng.random(batch_size))
init_kwargs = {
"omega": 1.25,
"alpha_1": 0.5,
Expand All @@ -801,7 +803,7 @@ def test_batched_size(self, explicit_shape, batched_param):
with Model() as t0:
y = GARCH11("y", **kwargs0)

y_eval = draw(y, draws=2, random_seed=800)
y_eval = draw(y, draws=2, random_seed=random_seed)
assert y_eval[0].shape == (batch_size, steps)
assert not np.any(np.isclose(y_eval[0], y_eval[1]))

Expand Down

0 comments on commit 71019cc

Please sign in to comment.