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

Please add parameter 'end_times' for tick.hawkes.HawkesExpKern.fit() #446

Open yaowang74 opened 4 years ago

yaowang74 commented 4 years ago

In tick/tick/hawkes/model/base/model_hawkes.py, lines 91 to 94, we have

91 end_times = self._end_times 92 if end_times is None: 93 non_empty_events = [[r for r in e if len(r) > 0] for e in events] 94 end_times = np.array([max(map(max, e)) for e in non_empty_events])

if non_empty_events list is also empty, line 94 will spit an error on using max function on empty list.

In practice, it would be great if we can have an option to manually specify the 'end_times' for .fit() method. Thank you.