pip install tick==0.5.0.0
, the linux binaries should be provided there.
HawkesExpKern
is for higher level usage, if you want to fine tune the optimization part I would suggest you to use the optimization API (see https://x-datainitiative.github.io/tick/modules/solver.html). Anyway, something like hawkes_exp_kern.solver_obj.linesearch = False
and hawkes_exp_kern.solver_obj.step = 0.01
might be a hacky way of doing this.
HawkesExpKern
maximum likelihood parametric estimation and sometimes I meet this runtime error: The sum of the influence on someone cannot be negative. Maybe did you forget to add a positive constraint to your proximal operator
. Can you help explaining me how can I add positive constraint to the proximal operator? Thank you very much.
Sorry, I missed you message, the previous suggestion does not work ?
HawkesExpKern
is for higher level usage, if you want to fine tune the optimization part I would suggest you to use the optimization API (see https://x-datainitiative.github.io/tick/modules/solver.html). Anyway, something likehawkes_exp_kern.solver_obj.linesearch = False
andhawkes_exp_kern.solver_obj.step = 0.01
might be a hacky way of doing this.
Hello,
I have not played much with R so I will rather give you a Python example. I guess you can transcribe it with rpy2 afterwards.
The main thing is that we have no learner able to retrieve all these parameters, especially the beta one. But you can try several values of beta and look for the learner with the best likelihood as in the following example:
import numpy as np import itertools from tick.dataset import fetch_hawkes_bund_data from tick.hawkes import HawkesSumExpKern from tick.plot import plot_hawkes_kernel_norms timestamps_list = fetch_hawkes_bund_data() best_score = -1e100 decay_candidates = np.logspace(0, 6, 6) for i, decays in enumerate(itertools.combinations(decay_candidates, 3)): decays = np.array(decays) hawkes_learner = HawkesSumExpKern(decays, verbose=False, max_iter=10000, tol=1e-10) hawkes_learner._prox_obj.positive = False hawkes_learner.fit(timestamps_list) hawkes_score = hawkes_learner.score() if hawkes_score > best_score: print('obtained {}\n with {}\n' .format(hawkes_score, decays)) best_hawkes = hawkes_learner best_score = hawkes_score plot_hawkes_kernel_norms(best_hawkes, show=True)
This has been discussed earlier in the gitter thread if you want more info or in this issue https://github.com/X-DataInitiative/tick/issues/133#issuecomment-495999841.
I want to use HawkesExpKern, to get the estimated parameters of your exponential kernel based on real data shown below. I will then like to simulate a Hawkes Process using hawkes.SimuHawkes.
My challenge is
(1) How do I get decays , and adjacency for the HawkesExpKern
(2) For t_values = date column in my data , and for y_values = the corresponding values in Activity1 and Activity2 in Data shown below
I have two interdependent activities that I want to model using Tick’s Hawkes. My data is in the form of
ID# Date Activity 1 Activity 2
0 8/26/2006 1 0
1 3/31/2007 5 1
2 5/20/2007 1 1
3 5/25/2007 1 2
4 6/3/2007 1 6
5 6/18/2007 1 3
6 6/19/2007 1 10
7 7/11/2007 1 1
8 7/19/2007 1 0
9 7/26/2007 1 2
10 7/31/2007 1 1
11 8/4/2007 1 2
12 8/8/2007 1 1
Any advice , input , guidance on the above