Skip to content

Latest commit

 

History

History
83 lines (63 loc) · 3.39 KB

File metadata and controls

83 lines (63 loc) · 3.39 KB

FaDIn: Fast Discretized Inference For Hawkes Processes with General Parametric Kernels

UNHaP: Unmixing Noise from Hawkes Processes

build python version license code style

This package implements FaDIn and UNHaP. FaDIn and UNHaP are solvers for inference of Hawkes Processes with finite-support kernels on simulated or real data, with the following features:

  • Computation time is low compared to other methods.
  • Compatible in an univariate setting as well as a multivariate setting.
  • Classical kernels (exponential truncated gaussian, raised cosine) are implemented. The user can add their own kernel for inference.
  • Masking: if only a few Hawkes Parameters need to be inferred, the user can mask the other parameters.
  • Smart initialization of parameters before optimization: the user can choose between random (purely random), moment_matching_max (moment matching with maximum mode) and moment_matching_mean (moment matching with mean mode).

FaDIn does classical Hawkes inference with gradient descent. UNHaP does Hawkes inference where the Hawkes Process is marked and mixed with a noisy Poisson process.

Installation

To install this package, make sure you have an up-to-date version of pip.

python3 -m pip install --upgrade pip

From PyPI (coming soon)

In a dedicated Python env, run:

pip install FaDIn

From source

git clone https://github.com/mind-inria/FaDIn.git
cd FaDIn

In a dedicated Python env, run:

pip install -e .

Contributors should also install the development dependencies in order to test and automatically format their contributions.

pip install -e ".[dev]"
pre-commit install

Short examples

A few illustrative examples are provided in the examples folder of this repository:

  • plot_univariate_fadin: simulate an univariate unmarked Hawkes process, infer Hawkes Process parameters using FaDIn, and plot inferred kernel.
  • plot_multivariate_fadin: same as plot_univariate_fadin but in the multivariate case.
  • plot_unhap: simulate an univariate marked Hawkes process and a marked Poisson process, infer Hawkes Process parameters using UNHaP, ald plot inferred kernels.

Citing this work

If this package was useful to you, please cite it in your work:

@inproceedings{staerman2023fadin,
  title={Fadin: Fast discretized inference for hawkes processes with general parametric kernels},
  author={Staerman, Guillaume and Allain, C{\'e}dric and Gramfort, Alexandre and Moreau, Thomas},
  booktitle={International Conference on Machine Learning},
  pages={32575--32597},
  year={2023},
  organization={PMLR}
}

@improceedings{loison2025unhap,
title={UNHaP: Unmixing Noise from Hawkes Process},
author={Loison, Virginie and Staerman, Guillaume and Moreau, Thomas},
booktitle={International Conference on Artificial Intelligence and Statistics},
pages={1342--1350},
year={2025}
}