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

right way to seed simulate() for reproducible results #436

Closed dionman closed 4 years ago

dionman commented 4 years ago

From a bash script, I'm calling twice a python script where following line gets identically instantiated

hawkes_exp_kernels = SimuHawkesExpKernels(adjacency=adjacency, decays=1.,
                                          baseline=baseline, end_time=T,
                                          verbose=False, seed=np.random.seed(ID))

I end up getting simulations of (similar but) different length. What's the right way to call hawkes_exp_kernels.simulate() with fixed seed in order to get reproducible simulations?

PhilipDeegan commented 4 years ago

I think the seed needs to be a constant.

try seed=1337

dionman commented 4 years ago

thanks, this works