Skip to content

Commit 71019cc

Browse files
author
Goose
committed
seed flaky GARCH11 test
1 parent 07fc908 commit 71019cc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/distributions/test_timeseries.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,9 @@ def test_logp(self):
785785
@pytest.mark.parametrize("explicit_shape", (True, False))
786786
def test_batched_size(self, explicit_shape, batched_param):
787787
steps, batch_size = 100, 5
788-
param_val = np.square(np.random.randn(batch_size))
788+
random_seed = 800
789+
rng = np.random.default_rng(random_seed)
790+
param_val = np.square(rng.random(batch_size))
789791
init_kwargs = {
790792
"omega": 1.25,
791793
"alpha_1": 0.5,
@@ -801,7 +803,7 @@ def test_batched_size(self, explicit_shape, batched_param):
801803
with Model() as t0:
802804
y = GARCH11("y", **kwargs0)
803805

804-
y_eval = draw(y, draws=2, random_seed=800)
806+
y_eval = draw(y, draws=2, random_seed=random_seed)
805807
assert y_eval[0].shape == (batch_size, steps)
806808
assert not np.any(np.isclose(y_eval[0], y_eval[1]))
807809

0 commit comments

Comments
 (0)