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.

[![Open in Spaces](https://huggingface.co/datasets/huggingface/badges/raw/main/open-in-hf-spaces-sm.svg)](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