Skip to content

Commit c405c8d

Browse files
Fix flaky ODE test by setting an initval (#4827)
The width of the priors was just too extreme for randomly sampled initial values to be numerically stable with float32.
1 parent ef97da3 commit c405c8d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

pymc3/tests/test_ode.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,6 @@ def system(y, t, p):
331331
assert idata.posterior["y0"].shape == (1, 100)
332332
assert idata.posterior["sigma"].shape == (1, 100)
333333

334-
@pytest.mark.xfail(
335-
condition=IS_WINDOWS, reason="https://github.com/pymc-devs/aesara/issues/390"
336-
)
337334
def test_vector_ode_1_param(self):
338335
"""Test running model for a vector ODE with 1 parameter"""
339336

@@ -363,8 +360,8 @@ def system(y, t, p):
363360
ode_model = DifferentialEquation(func=system, t0=0, times=times, n_states=2, n_theta=1)
364361

365362
with pm.Model() as model:
366-
R = pm.Lognormal("R", 1, 5)
367-
sigma = pm.HalfCauchy("sigma", 1, shape=2)
363+
R = pm.Lognormal("R", 1, 5, initval=1)
364+
sigma = pm.HalfCauchy("sigma", 1, shape=2, initval=[0.5, 0.5])
368365
forward = ode_model(theta=[R], y0=[0.99, 0.01])
369366
y = pm.Lognormal("y", mu=pm.math.log(forward), sd=sigma, observed=yobs)
370367

0 commit comments

Comments
 (0)