A Python project for exploring, implementing, and applying Stochastic Differential Equations (SDEs) for modeling financial asset dynamics.
git clone <repository-url>
cd sde_asset_modeling
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
pip install -e .
data/
: Directory for storing raw or processed datanotebooks/
: Jupyter notebooks for exploration and presentationsrc/sde_asset_modeling/
: Main source code
models/
: SDE model definitionssimulation/
: Simulation schemescalibration/
: Parameter estimation methodsutils/
: Utility functionstests/
: Unit testsThe project is organized as a series of Jupyter notebooks that demonstrate each aspect of SDE modeling:
01_GBM_Simulation.ipynb
: Basic simulation of GBM02_OU_Simulation.ipynb
: Basic simulation of OU process03_Milstein_Comparison.ipynb
: Comparison of simulation methods04_Calibration.ipynb
: Parameter estimation from real data05_Correlated_Simulation.ipynb
: Simulation of correlated assets06_Jump_Diffusion.ipynb
: Optional extension for jump diffusion modelingThis project is organized into the following structure to keep simulations, dashboards, and plots separate and well-organized.
sde_asset_modeling/
├── simulations/ # Simulation scripts for each model
│ ├── gbm_simulation.py # Geometric Brownian Motion
│ ├── ou_simulation.py # Ornstein-Uhlenbeck process
│ ├── jump_diffusion_simulation.py
│ ├── heston_simulation.py
│ ├── sabr_simulation.py
│ └── correlated_simulation.py
│
├── dashboards/ # Dashboard creation scripts
│ ├── gbm_dashboard.py
│ ├── ou_dashboard.py
│ ├── jump_diffusion_dashboard.py
│ ├── heston_dashboard.py
│ ├── sabr_dashboard.py
│ └── correlated_dashboard.py
│
├── plots/ # Generated plots organized by model
│ ├── gbm/ # GBM simulation plots
│ ├── ou/ # OU process plots
│ ├── jump_diffusion/ # Jump Diffusion model plots
│ ├── heston/ # Heston model plots
│ ├── sabr/ # SABR model plots
│ └── correlated/ # Correlated assets plots
│
├── src/ # Core implementation code
│ └── sde_asset_modeling/
│ ├── models/ # SDE model implementations
│ ├── simulation/ # Simulation engines and numerical methods
│ └── utils/ # Utility functions
│
├── notebooks/ # Jupyter notebooks for analysis
├── tests/ # Unit tests
└── data/ # Data files
To run a simulation for a specific model, use the corresponding script in the simulations/
directory:
python simulations/gbm_simulation.py # Run GBM simulation
To create a dashboard for a specific model, use the corresponding script in the dashboards/
directory:
python dashboards/gbm_dashboard.py # Create GBM dashboard
Each dashboard script will check if the required plots exist and run the simulation if needed.