tick.hawkes.ModelHawkesSumExpKernLogLik

class tick.hawkes.ModelHawkesSumExpKernLogLik(decays: ndarray, n_threads: int = 1)[source]

Hawkes process model for sum of exponential kernels with fixed and given decays. It is modeled with (opposite) log likelihood loss:

\[\sum_{i=1}^{D} \left( \int_0^T \lambda_i(t) dt - \int_0^T \log \lambda_i(t) dN_i(t) \right)\]

where \(\lambda_i\) is the intensity:

\[\forall i \in [1 \dots D], \quad \lambda_i(t) = \mu_i + \sum_{j=1}^D \sum_{t_k^j < t} \phi_{ij}(t - t_k^j)\]

where

  • \(D\) is the number of nodes

  • \(\mu_i\) are the baseline intensities

  • \(\phi_{ij}\) are the kernels

  • \(t_k^j\) are the timestamps of all events of node \(j\)

and with a sum-exponential parametrisation of the kernels

\[\phi_{ij}(t) = \sum_{u=1}^{U} \alpha^u_{ij} \beta^u \exp (- \beta^u t) 1_{t > 0}\]

In our implementation we denote:

  • Integer \(D\) by the attribute n_nodes

  • Integer \(U\) by the attribute n_decays

  • Vector \(\beta \in \mathbb{R}^{U}\) by the parameter decays. This parameter is given to the model

Parameters:

decays : numpy.ndarray, shape=(n_decays, )

An array giving the different decays of the exponentials kernels.

n_threads : int, default=1

Number of threads used for parallel computation.

  • if int <= 0: the number of threads available on the CPU

  • otherwise the desired number of threads

Attributes:

n_nodes : int (read-only)

Number of components, or dimension of the Hawkes model

n_decays : int (read-only)

Number of decays used in the sum-exponential kernel

data : list of numpy.array (read-only)

The events given to the model through fit method. Note that data given through incremental_fit is not stored