225ae82fa59eebcb13d322a4f7642afdbc534fd5,pymc3/tests/test_ode.py,,test_logp_scalar_ode,#,184
Before Change
y0 = 0.0
times = np.arange(0.5, 8, 0.5)
yobs = np.array(
[
0.30,
0.56,
0.51,
0.55,
0.47,
0.42,
0.38,
0.30,
0.26,
0.21,
0.22,
0.13,
0.13,
0.09,
0.09,
]
).reshape(-1, 1)
ode_model = DifferentialEquation(
func=system_1, t0=0, times=times, n_odeparams=1, n_states=1
)
integrated_solution, *_ = ode_model._simulate([alpha, y0])
manual_logp = norm.logpdf(
x=np.ravel(yobs), loc=np.ravel(integrated_solution), scale=1
).sum()
with pm.Model() as model_1:
forward = ode_model(odeparams=[alpha], y0=[y0]).reshape(yobs.shape)
y = pm.Normal("y", mu=forward, sd=1, observed=yobs)
pymc3_logp = model_1.logp()
np.testing.assert_allclose(manual_logp, pymc3_logp)
After Change
scale=1
).sum()
with pm.Model() as model_1:
forward = ode_model(theta=[alpha], y0=[y0])
y = pm.Normal("y", mu=forward, sd=1, observed=yobs)
pymc3_logp = model_1.logp()
np.testing.assert_allclose(manual_logp, pymc3_logp)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: pymc-devs/pymc3
Commit Name: 225ae82fa59eebcb13d322a4f7642afdbc534fd5
Time: 2019-11-03
Author: thecakedev@hotmail.com
File Name: pymc3/tests/test_ode.py
Class Name:
Method Name: test_logp_scalar_ode
Project Name: pymc-devs/pymc3
Commit Name: 225ae82fa59eebcb13d322a4f7642afdbc534fd5
Time: 2019-11-03
Author: thecakedev@hotmail.com
File Name: pymc3/tests/test_ode.py
Class Name: TestDiffEqModel
Method Name: test_scalar_ode_1_param
Project Name: pymc-devs/pymc3
Commit Name: 225ae82fa59eebcb13d322a4f7642afdbc534fd5
Time: 2019-11-03
Author: thecakedev@hotmail.com
File Name: pymc3/tests/test_ode.py
Class Name: TestDiffEqModel
Method Name: test_scalar_ode_2_param