X-DataInitiative / tick

Module for statistical learning, with a particular emphasis on time-dependent modelling
https://x-datainitiative.github.io/tick/
BSD 3-Clause "New" or "Revised" License
484 stars 105 forks source link

Issue with TimeFunction #470

Open tonygracious opened 3 years ago

tonygracious commented 3 years ago

t_values1 = np.array([0, 1, 1.5, 2., 3.5, 4], dtype=float) y_values1 = np.array([0, 0.2, 0, 0.1, 0.2, 0.3], dtype=float) tf1 = TimeFunction([t_values1, y_values1], inter_mode=TimeFunction.InterConstRight,\ dt=0.1) print(tf1.smapled_y)

gives following output

array([0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0.2, 0.2, 0.2, 0.2, 0.2, 0. , 0. , 0. , 0. , 0. , 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.2, 0.2, 0.2, 0.2, 0.2, 0.3, 0.2])

I think the last values should also be 0.3.