Spaces:
Sleeping
Sleeping
File size: 4,939 Bytes
ef77b66 dc51c27 ef77b66 dc51c27 ef77b66 dc51c27 c455090 ef77b66 3c16e17 ef77b66 829e767 ef77b66 dc51c27 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
---
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.
[](https://huggingface.co/spaces/alidenewade/hull-white-simulator)
## π― 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:
$$dr(t) = (ΞΈ(t) - ar(t))dt + ΟdW$$
Where:
- `r(t)` = instantaneous short rate at time t
- `a` = mean reversion speed parameter
- `Ο` = volatility parameter
- `ΞΈ(t)` = time-dependent drift function
- `dW` = 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
1. **Adjust Model Parameters**: Use the sliders in the left panel to modify Hull-White parameters
2. **Explore Visualizations**: Click through the tabs to see different aspects of the model
3. **Analyze Convergence**: Pay special attention to the Ο/a ratio - values > 1 show poor convergence
4. **Compare Theory vs Practice**: Observe how simulated results converge to theoretical expectations
5. **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
```bash
# 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 |