tick.hawkes.HawkesEM

class tick.hawkes.HawkesEM(kernel_support=None, kernel_size=10, kernel_discretization=None, tol=1e-05, max_iter=100, print_every=10, record_every=10, verbose=False, n_threads=1)[source]

This class is used for performing non parametric estimation of multi-dimensional Hawkes processes based on expectation maximization algorithm.

Hawkes processes are point processes defined by the intensity:

\[\forall i \in [1 \dots D], \quad \lambda_i = \mu_i + \sum_{j=1}^D \int \phi_{ij} dN_j\]

where

  • \(D\) is the number of nodes

  • \(\mu_i\) are the baseline intensities

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

Parameters:

kernel_support : float, default=`None`

The support size common to all the kernels. Might be None if kernel_discretization is set

kernel_size : int, default=10

Number of discretizations of the kernel

kernel_discretization : np.ndarray, default=None

Explicit discretization of the kernel. If set, it will override kernel_support and kernel_size values.

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_iter iterations

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 of print_every

record_every : int, default=10

Record history information when n_iter (iteration number) is a multiple of record_every

n_threads : int, default=1

Number of threads used for parallel computation.

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

  • otherwise the desired number of threads

Attributes:

n_nodes : int

Number of nodes of the estimated Hawkes process

n_realizations : int

Number of given realizations

kernel : np.array shape=(n_nodes, n_nodes, kernel_size)

The estimated kernels

baseline : np.array shape=(n_nodes)

The estimated baseline

References

Lewis, E., & Mohler, G. (2011). A nonparametric EM algorithm for multiscale Hawkes processes. preprint, 1-16.

The n-dimensional extension of this algorithm can be found in the latex documentation.

Examples using tick.hawkes.HawkesEM