tick.hawkes.HawkesBasisKernels

class tick.hawkes.HawkesBasisKernels(kernel_support, n_basis=None, kernel_size=10, tol=1e-05, C=0.1, max_iter=100, verbose=False, print_every=10, record_every=10, n_threads=1, ode_max_iter=100, ode_tol=1e-05)[source]

This class is used for performing non parametric estimation of multi-dimensional Hawkes processes based on expectation maximization algorithm and the hypothesis that kernels are linear combinations of some basis kernels.

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

The basis kernel hypothesis translates to:

\[\phi_{ij}(t) = \sum_{u}^U a_{ij}^u g^u(t)\]

where

  • \(U\) is the number of basis kernels.

  • \(g^u\) is a basis kernel

  • \(a_{ij}^u\) is the amplitude of basis kernel \(u\) in kernel \(\phi_{ij}\)

Finally we also suppose that basis kernels \(g^u\) are piecewise constant on a given support and number of intervals.

Parameters:

kernel_support : float

The support size common to all the kernels.

n_basis : int, default=`None`

Number of non parametric basis kernels to be used. If None or 0, it will be set to n_nodes

kernel_size : int, default=10

Number of discretizations of the kernel

C : float, default=1e-1

The penalization parameter. It penalizes both the amplitudes squared values and the basis kernels smoothness through the integral of their squared derivative.

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`

baseline : np.array shape=(n_nodes)

The estimated baseline

amplitudes : np.array shape=(n_nodes, n_nodes, n_basis)

Amplitudes of all basis kernels for all kernels.

basis_kernels : np.array shape=(n_basis, kernel_size)

Estimated basis kernels

kernel_dt : float

Kernel discretization step. It is equal to kernel_support / kernel_size

kernel_discretization : np.ndarray, shape=(kernel_size + 1, )

Kernel discretizations points, denotes the interval on which basis kernels are piecewise constant.

References

Zhou, K., Zha, H. and Song, L., 2013, June. Learning Triggering Kernels for Multi-dimensional Hawkes Processes. In ICML (3) (pp. 1301-1309).

Some rewriting notes for implementing the algorithm can be found in the doc/tex directory.

Examples using tick.hawkes.HawkesBasisKernels