Skip to content

MultiHawkes is a project for simulating multivariate Hawkes processes using C++ 17 and Python 3.

Notifications You must be signed in to change notification settings

ZakariaBensaid/MultiHawkes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MultiHawkes

MultiHawkes is a project for simulating multivariate Hawkes processes using C++ 17 and Python 3.

Installation in Windows

  1. Clone the repository:

    git clone https://github.com/ZakariaBensaid/MultiHawkes.git
    cd MultiHawkes
  2. Download and install Visual Studio for C++ :

    • Download and install Visual Studio with the "Desktop development with C++" workload.
  3. Install requirements: (cmake, pybind11, numpy, matplotlib, tensorflow)

    pip install -r requirements.txt
  4. Build the project using CMake :

    mkdir build
    cd build
    cmake ..
    cmake --build .

Installation in Linux/MacosX

  1. Clone the repository:

    git clone https://github.com/ZakariaBensaid/MultiHawkes.git
    cd MultiHawkes
  2. Install requirements: (cmake, pybind11, numpy, matplotlib, tensorflow)

    pip install -r requirements.txt
  3. Build the project using Cmake :

    mkdir build
    cd build
    cmake ..
    make

Test

  1. 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)

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

About

MultiHawkes is a project for simulating multivariate Hawkes processes using C++ 17 and Python 3.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published