# rakeshks7/hawkes-process-hft-microstructure architecture

> Architecture diagram of the GitHub repository rakeshks7/hawkes-process-hft-microstructure, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rakeshks7/hawkes-process-hft-microstructure
- Repository: https://github.com/rakeshks7/hawkes-process-hft-microstructure

## Overview

This is a research tool for modeling high-frequency trade arrivals with a univariate Hawkes process. Its principal workflow generates synthetic order-flow timestamps, fits model parameters, calculates the branching ratio, then reports criticality and plots estimated intensity. The model also exposes simulation directly, and the README identifies Ogata thinning, recursive maximum-likelihood estimation, and stability metrics as product capabilities. The graph reflects the shown calls; it does not infer additional integrations or workflows from unsampled code.

Main entry points: [`main.py`](https://github.com/rakeshks7/hawkes-process-hft-microstructure/blob/main/main.py) (Workflow entry), [`src/model.py`](https://github.com/rakeshks7/hawkes-process-hft-microstructure/blob/main/src/model.py) (Hawkes model), [`src/data_gen.py`](https://github.com/rakeshks7/hawkes-process-hft-microstructure/blob/main/src/data_gen.py) (Synthetic flow), [`src/analytics.py`](https://github.com/rakeshks7/hawkes-process-hft-microstructure/blob/main/src/analytics.py) (Criticality report)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Workflow"]
  node_entry["Workflow entry<br/>[main.py]"]
  node_synthetic["Synthetic flow<br/>[data_gen.py]"]
end

subgraph group_modeling["Hawkes modeling"]
  node_hawkes["Hawkes model<br/>[model.py]"]
end

subgraph group_analysis["Analysis and reporting"]
  node_criticality["Criticality report<br/>[analytics.py]"]
  node_intensity["Intensity plot<br/>[analytics.py]"]
end

node_user(("Research user"))

node_user -->|"runs"| node_entry
node_entry -->|"generates timestamps"| node_synthetic
node_synthetic -->|"simulates flow"| node_hawkes
node_entry -->|"fits model"| node_hawkes
node_entry -->|"gets branching ratio"| node_hawkes
node_entry -->|"reports criticality"| node_criticality
node_entry -->|"plots intensity"| node_intensity

click node_entry "https://github.com/rakeshks7/hawkes-process-hft-microstructure/blob/main/main.py"
click node_synthetic "https://github.com/rakeshks7/hawkes-process-hft-microstructure/blob/main/src/data_gen.py"
click node_hawkes "https://github.com/rakeshks7/hawkes-process-hft-microstructure/blob/main/src/model.py"
click node_criticality "https://github.com/rakeshks7/hawkes-process-hft-microstructure/blob/main/src/analytics.py"
click node_intensity "https://github.com/rakeshks7/hawkes-process-hft-microstructure/blob/main/src/analytics.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_synthetic,node_user toneBlue
class node_hawkes toneAmber
class node_criticality,node_intensity toneMint
```

## Components

### Workflow

- [Workflow entry](https://github.com/rakeshks7/hawkes-process-hft-microstructure/blob/main/main.py): `main.py`
- [Synthetic flow](https://github.com/rakeshks7/hawkes-process-hft-microstructure/blob/main/src/data_gen.py): `src/data_gen.py`

### Hawkes modeling

- [Hawkes model](https://github.com/rakeshks7/hawkes-process-hft-microstructure/blob/main/src/model.py): `src/model.py`

### Analysis and reporting

- [Criticality report](https://github.com/rakeshks7/hawkes-process-hft-microstructure/blob/main/src/analytics.py): `src/analytics.py`
- [Intensity plot](https://github.com/rakeshks7/hawkes-process-hft-microstructure/blob/main/src/analytics.py): `src/analytics.py`

### Other components

- **Research user**

## Connections

- Research user → Workflow entry: runs (evidence: `main.py`)
- Workflow entry → Synthetic flow: generates timestamps (evidence: `main.py`)
- Synthetic flow → Hawkes model: simulates flow (evidence: `src/data_gen.py`)
- Workflow entry → Hawkes model: fits model (evidence: `main.py`)
- Workflow entry → Hawkes model: gets branching ratio (evidence: `main.py`)
- Workflow entry → Criticality report: reports criticality (evidence: `main.py`)
- Workflow entry → Intensity plot: plots intensity (evidence: `main.py`)
