Open trouleau opened 3 years ago
I have noticed this problem too.
Edit: Having looked into this a bit more, there seems to be no lower limit on amplitude, and you can end up with very large negative amplitudes in the estimated intensity functions. This isn't reasonable mathematically, so I would say this is definitely a bug.
Hello,
I believe there is a bug in the implementation of the algorithm
HawkesSumGaussians
. In the paper defining the algorithm, the amplitudes of the kernel bases are defined to be non-negative (See Equation 4). However, theamplitudes
attributes of a fittedHawkesSumGaussians
can be negative.Here is a minimal example to reproduce the issue (tested on the current version
tick==0.7.0.1
):I believe the issue comes from the definition of the soft-thresholding function
soft_thres
. In the code, the sign function is defined on {-1, 1}, but I think it should be defined on {0, 1}, i.e., it should be zero if the input is negative (not -1).If you agree that this is indeed a bug, then I guess the fix should be as easy as replacing the
soft_thres
function into