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) andmoment_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.
To install this package, make sure you have an up-to-date version of pip.
python3 -m pip install --upgrade pipIn a dedicated Python env, run:
pip install FaDIngit clone https://github.com/mind-inria/FaDIn.git
cd FaDInIn 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 installA 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 asplot_univariate_fadinbut 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.
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}
}