Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available:
5.45.0
metadata
title: Hull-White Simulator
emoji: π
colorFrom: blue
colorTo: indigo
sdk: gradio
sdk_version: 5.31.0
app_file: app.py
pinned: false
license: mit
tags:
- actuarial
- finance
- stochastic-models
- monte-carlo
- interest-rates
- quantitative-finance
- gradio
- dashboard
- hull-white
- risk-management
short_description: Simulate Hull-White interest rate paths and dynamics.
π Hull-White Interest Rate Model Dashboard
An interactive web dashboard for exploring the Hull-White short rate model, designed specifically for actuaries and financial professionals.
π― Overview
The Hull-White model is a widely-used short rate model in quantitative finance, particularly valuable for:
- Interest rate derivatives pricing
- Risk management and ALM
- Solvency II capital calculations
- Insurance liability valuation
This dashboard provides an intuitive interface to explore the model's behavior through Monte Carlo simulations.
π Model Description
The Hull-White model follows the stochastic differential equation:
Where:
r(t)
= instantaneous short rate at time ta
= mean reversion speed parameterΟ
= volatility parameterΞΈ(t)
= time-dependent drift functiondW
= Wiener process increment
π Features
Interactive Visualizations
- π Short Rate Paths: Visualize multiple simulated interest rate trajectories
- π Mean Convergence: Compare Monte Carlo means against theoretical expectations
- π Variance Analysis: Examine variance convergence properties
- π° Discount Factors: Analyze zero-coupon bond pricing convergence
- π Parameter Sensitivity: Study the critical Ο/a ratio effects
- π Statistics Table: Summary statistics at key time points
Adjustable Parameters
Parameter | Range | Description |
---|---|---|
Scenarios | 100 - 10,000 | Number of Monte Carlo paths |
Time Horizon | 5 - 50 years | Simulation time length |
Time Steps | 100 - 500 | Discretization granularity |
Mean Reversion (a) | 0.01 - 0.5 | Speed of mean reversion |
Volatility (Ο) | 0.01 - 0.3 | Interest rate volatility |
Initial Rate (rβ) | 0.01 - 0.15 | Starting interest rate |
ποΈ How to Use
- Adjust Model Parameters: Use the sliders in the left panel to modify Hull-White parameters
- Explore Visualizations: Click through the tabs to see different aspects of the model
- Analyze Convergence: Pay special attention to the Ο/a ratio - values > 1 show poor convergence
- Compare Theory vs Practice: Observe how simulated results converge to theoretical expectations
- Generate Statistics: Review the summary table for quantitative analysis
π Key Insights
Convergence Properties
- Ο/a < 1: Good Monte Carlo convergence
- Ο/a β 1: Moderate convergence issues
- Ο/a > 1: Poor convergence, especially for discount factors
Practical Considerations
- More scenarios improve convergence but increase computation time
- Higher volatility requires more scenarios for stable results
- Longer time horizons show more pronounced convergence issues
π§ Technical Implementation
Model Features
- Gaussian Process: Exploits Hull-White's analytical properties
- Conditional Moments: Uses exact conditional mean and variance formulas
- Vector Operations: Efficient numpy-based simulations
- Reproducible Results: Fixed random seed for consistency
Performance Optimized
- Real-time parameter updates
- Efficient matrix operations
- Responsive visualization updates
- Memory-efficient data handling
π Educational Value
Perfect for:
- University Finance Courses: Teaching stochastic interest rate models
- Actuarial Training: Understanding ALM and risk management
- Professional Development: Exploring quantitative finance concepts
- Model Validation: Testing parameter sensitivity and convergence
π Theoretical Background
The implementation follows established literature:
- Brigo & Mercurio: Interest Rate Models - Theory and Practice
- Glasserman: Monte Carlo Methods in Financial Engineering
- Hull: Options, Futures, and Other Derivatives
Key Mathematical Properties
- Mean: E[r(t)|β±β] = r(s)e^(-a(t-s)) + Ξ±(t) - Ξ±(s)e^(-a(t-s))
- Variance: Var[r(t)|β±β] = (ΟΒ²/2a)(1 - e^(-2a(t-s)))
- Alpha Function: Ξ±(t) = f^M(0,t) + (ΟΒ²/2aΒ²)(1-e^(-at))Β²
π οΈ Installation & Deployment
Local Development
# Clone the repository
git clone https://github.com/alidenewade/hull-white-dashboard.git
cd hull-white-dashboard
# Install dependencies
pip install -r requirements.txt
# Run the application
python app.py