This is similar to #21 , although (I think) from different origin.
I've noticed that using single precision for time sometimes leads to incorrect results. For instance in DiffusionProcess1d.empirical_vector, as the total trajectory time is computed as the difference between tsample and t0:
x0 = 1.
t0 = 0. # <'float'>
dt=0.1
for tsample in [0.3, 0.5]:
T = tsample - t0
print("tsample = {}, T = {}".format(tsample, T))
t, x = model.trajectory(x0, t0, T=tsample-t0, dt=dt)
t0 = t[-1] # <'numpy.float32'>
x0 = x[-1]
leads to
tsample = 0.3, T = 0.3 # expected
tsample = 0.5, T = 0.19999998807907104 # expected T = 0.2
This leads to an incorrect discretisation of time, as
This is similar to #21 , although (I think) from different origin.
I've noticed that using single precision for time sometimes leads to incorrect results. For instance in
DiffusionProcess1d.empirical_vector
, as the total trajectory time is computed as the difference betweentsample
andt0
:leads to
This leads to an incorrect discretisation of time, as
will not give the expected number of time points.