tick icon indicating copy to clipboard operation
tick copied to clipboard

Exponential-kernel hawkes process model without given decay?

Open liushengzhong1023 opened this issue 6 years ago • 6 comments

Hi there,

I am new to tick and point process model. I have been reading and trying the basic Hawkes process model with exponential kernel. It seems that all of them have to be given decay parameter in advance. Do you provide the model that can estimate the decay too(not the non-parametric model)?

Thanks, Shengzhong

liushengzhong1023 avatar Apr 12 '18 22:04 liushengzhong1023

Hi Shengzhong,

Having an unknown decay leads to a non-convex loss that is much harder to optimize. As most of the parametric models in tick rely on convex solvers we did not implement it (yet). Hence there is no direct way to estimate the decay.

Though you can try few things:

  • Roughly estimate you kernels with HawkesEM to determine an approximate value of the decay and then use it.
  • Use sum of exponential kernels and try multiple decays at once.
  • Fit the single exponential kernel Hawkes model for several decays and find which decay leads to the best loss (brute force).

Martin

Mbompr avatar Apr 13 '18 11:04 Mbompr

Okay, I see. Thank you very much. Hope you can also add this functionality in future version, that will be really helpful to me!

Shengzhong

liushengzhong1023 avatar Apr 13 '18 22:04 liushengzhong1023

Hello,

I have followed the instructions to test various decay values and compare the resultant scores. On my 4-D process, using data at the microsecond level (actually sub microsecond - I have many simultaneous timestamps which I needed to de-duplicate) I find score increases with decay, without bound. Is there an interpretation for why this happens?

Thank you

6Hhcy avatar Feb 10 '19 23:02 6Hhcy

Hello, The score is the log-likelihood that writes as following: screenshot 2019-02-11 16 52 47 where the intensity writes for a 1D hawkes process with exponential kernel: screenshot 2019-02-11 16 52 49

Hence, if the decay, beta, becomes very large, you will have approximatively screenshot 2019-02-11 16 55 58 while the integral part that is soustracted to the score will not be modified. Hence, after some threshold, increasing beta somehow means that your intensity behaves like a dirac at each event and this can only deteriorate the score.

Keep in mind that the score will promote intensities functions with high values at times when events occur and low at any other time.

Mbompr avatar Feb 11 '19 15:02 Mbompr

Thank you. I am passing a single decay value and it is being set for all dimensions. I know that one pair of intensities are much greater than the other pair. Is there any rule of thumb I can use for setting these manual estimates? Currently, the log likelihood is uniformly increasing over all values of one dimensional decay

6Hhcy avatar Feb 11 '19 22:02 6Hhcy

A simple way to find the best decay in the original question:

from scipy.optimize import minimize

def find_decay(timestamps, decays_init): def min_hawkes_sum_exp(decays_init): return -HawkesSumExpKern(decays_init, solver='bfgs')
.fit(timestamps).score() return minimize(min_hawkes_sum_exp, decays_init, method='Nelder-Mead', options={'disp': True})

Then running:

find_decay(data_frame_timestamps, np.array([[guess.]])).x

will give you the answer. You can also plot +HawkesSumExpKern(decays_init, solver='bfgs').fit(timestamps).score() to search for the region where the maximum is

MarcosCarreira avatar Jun 06 '20 00:06 MarcosCarreira