alidenewade's picture
Update README.md
c455090 verified

A newer version of the Gradio SDK is available: 5.45.0

Upgrade
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.

Open in Spaces

🎯 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+ΟƒdWdr(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

# 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