MultiHawkes is a project for simulating multivariate Hawkes processes using C++ 17 and Python 3.
-
Clone the repository:
git clone https://github.com/ZakariaBensaid/MultiHawkes.git cd MultiHawkes
-
Download and install Visual Studio for C++ :
- Download and install Visual Studio with the "Desktop development with C++" workload.
-
Install requirements: (cmake, pybind11, numpy, matplotlib, tensorflow)
pip install -r requirements.txt
-
Build the project using CMake :
mkdir build cd build cmake .. cmake --build .
-
Clone the repository:
git clone https://github.com/ZakariaBensaid/MultiHawkes.git cd MultiHawkes
-
Install requirements: (cmake, pybind11, numpy, matplotlib, tensorflow)
pip install -r requirements.txt
-
Build the project using Cmake :
mkdir build cd build cmake .. make
-
Run the following code : (Notice: if you don't have the build folder it won't run)
#Set the path to the hawkes library import os import sys script_dir = os.path.dirname(os.path.realpath(__file__)) module_dir = os.path.join(script_dir, 'build') # path to the hawkes library and sometimes it's 'build/Debug' or 'build/Release' for windows (look for .pyd file) sys.path.insert(0, 'build/') import hawkes mu = [0.1, 0.2] alpha = [[0.5, 0.1], [0.1, 0.5]] beta = [[1.0, 1.0], [1.0, 1.0]] T = 10.0 nbSimulations = 100 nbThreads = 4 results, jump_times = hawkes.simulate_hawkes(nbSimulations, nbThreads, mu, alpha, beta, T) print(results) print(jump_times)
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License.