IteraLabs / atelier

A Computational Framework/Engine for Market Microstructure High Frequency Modeling, Synthetic Simulation and Historical Market Reconstruction/Replay
https://www.iteralabs.ai
3 stars 2 forks source link

Create Hawkes Process Generator #27

Closed IFFranciscoME closed 2 months ago

IFFranciscoME commented 2 months ago

Context

Order book modeling include both Limit Orders and Markets Orders arrival time simulation, one particular orientation is to perform such simulation in either continuous time, as seen more frequently in literature, in discrete time as discrete, or point process.

Problem

The atelier library does not currently support other solution rather a sampling process from a poisson distribution, which does provide a discrete event simulation with a decay factor, but there is a growing need to expand this capacity to include a clustering effect, along to a self exciting behavior.

Solution

Implement the simplest form of a Hawkes Process in order to use it for both Limit Order and Market Order arrival times simulation. The first implementation case is the univariate self-exciting with exponential decay.

$$ \begin{equation} \phi{ij}(t) = \alpha{ij} e^{-\beta_{ij} t} \end{equation} $$

Acceptance Criteria

There exists a gen_hawkess.rs file with a detailed example on how to use such functionality, as well its corresponding unit test in the tests/test_generators.rs file