Hawkes process learner for sum-exponential kernels with fixed and given decays, with many choices of penalization and solvers.
Hawkes processes are point processes defined by the intensity:
where
\(D\) is the number of nodes
\(\mu_i(t)\) are the baseline intensities
\(\phi_{ij}\) are the kernels
\(t_k^j\) are the timestamps of all events of node \(j\)
and with an sum-exponential parametrisation of the kernels
In our implementation we denote:
Integer \(D\) by the attribute n_nodes
Integer \(U\) by the attribute n_decays
Vector \(\mu \in \mathbb{R}^{D}\) by the attribute
baseline
Matrix \(A = (\alpha^u_{ij})_{ij} \in \mathbb{R}^{D \times D
\times U}\) by the attribute adjacency
Vector \(\beta \in \mathbb{R}^{U}\) by the
parameter decays. This parameter is given to the model
decays : np.ndarray, shape=(n_decays, )
The decays used in the exponential kernels.
n_baselines : int, default=1
In this hawkes learner baseline is supposed to be either constant or piecewise constant. If
n_baseline > 1then piecewise constant setting is enabled. In this case \(\mu_i(t)\) is piecewise constant on intervals of sizeperiod_length / n_baselinesand periodic.
period_length : float, default=None
In piecewise constant setting this denotes the period of the piecewise constant baseline function.
C : float, default=1e3
Level of penalization
penalty : {‘l1’, ‘l2’, ‘elasticnet’, ‘none’} default=’l2’
The penalization to use. Default is ridge penalization.
solver : {‘gd’, ‘agd’, ‘bfgs’, ‘svrg’}, default=’agd’
The name of the solver to use
step : float, default=None
Initial step size used for learning. Used in ‘gd’, ‘agd’, ‘sgd’ and ‘svrg’ solvers
tol : float, default=1e-5
The tolerance of the solver (iterations stop when the stopping criterion is below it). If not reached the solver does
max_iteriterations
max_iter : int, default=100
Maximum number of iterations of the solver
verbose : bool, default=False
If
True, we verbose things, otherwise the solver does not print anything (but records information in history anyway)
print_every : int, default=10
Print history information when
n_iter(iteration number) is a multiple ofprint_every
record_every : int, default=10
Record history information when
n_iter(iteration number) is a multiple ofrecord_every
elastic_net_ratio : float, default=0.95
Ratio of elastic net mixing parameter with 0 <= ratio <= 1.
For ratio = 0 this is ridge (L2 squared) regularization.
For ratio = 1 this is lasso (L1) regularization.
For 0 < ratio < 1, the regularization is a linear combination of L1 and L2.
Used in ‘elasticnet’ penalty
random_state : int seed, or None (default)
The seed that will be used by stochastic solvers. If
None, a random seed will be used (based on timestamp and other physical metrics). Used in ‘sgd’, and ‘svrg’ solvers
n_nodes : int
Number of nodes / components in the Hawkes model
baseline : np.array, shape=(n_nodes,)
Inferred baseline of each component’s intensity
adjacency : np.ndarray, shape=(n_nodes, n_nodes, n_decays)
Inferred adjacency matrix
coeffs : np.array, shape=(n_nodes + n_nodes * n_nodes * n_decays, )
Raw coefficients of the model. Row stack of
self.baselineandself.adjacency
tick.hawkes.HawkesSumExpKern¶