Implementation:Avhz RustQuant HoLee
| Knowledge Sources | |
|---|---|
| Domains | Stochastic_Processes, Quantitative_Finance |
| Last Updated | 2026-02-07 19:00 GMT |
Overview
Concrete implementation of the Ho-Lee short-rate model provided by the RustQuant library.
Description
The Ho-Lee model is a no-arbitrage short-rate model defined by the SDE:
dX(t) = theta(t) dt + sigma(t) dW(t)
where theta(t) is a non-negative time-varying drift function calibrated to match the current term structure, and sigma(t) is the non-negative time-varying volatility. The Ho-Lee model is the simplest no-arbitrage term structure model and is essentially an Arithmetic Brownian Motion with a time-dependent drift.
Key parameters:
- sigma (ModelParameter) -- Instantaneous volatility (must be non-negative)
- theta (ModelParameter) -- Time-dependent mean reversion function (must be non-negative)
Usage
Use this process for modeling short rates when you need a simple no-arbitrage model that can be calibrated to the current yield curve. The Ho-Lee model allows rates to become negative. It is suitable for educational purposes and for cases where analytical tractability is valued over realism.
Code Reference
Source Location
- Repository: RustQuant
- File: crates/RustQuant_stochastics/src/ho_lee.rs
- Lines: 1-96
Signature
pub struct HoLee {
pub sigma: ModelParameter,
pub theta: ModelParameter,
}
impl HoLee {
pub fn new(sigma: impl Into<ModelParameter>, theta: impl Into<ModelParameter>) -> Self
}
impl StochasticProcess for HoLee {
fn drift(&self, _x: f64, t: f64) -> f64
fn diffusion(&self, _x: f64, t: f64) -> f64
fn jump(&self, _x: f64, _t: f64) -> Option<f64>
fn parameters(&self) -> Vec<f64>
}
Import
use RustQuant::stochastics::HoLee;
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| sigma | impl Into<ModelParameter> | Yes | Instantaneous volatility (must be non-negative) |
| theta | impl Into<ModelParameter> | Yes | Time-dependent drift function (must be non-negative) |
Outputs
| Name | Type | Description |
|---|---|---|
| drift() | f64 | Returns theta(t) -- the drift at time t |
| diffusion() | f64 | Returns sigma(t) -- the diffusion at time t |
| jump() | Option<f64> | Always returns None (no jump component) |
| parameters() | Vec<f64> | Returns [sigma(0), theta(0)] |
Usage Examples
use RustQuant::stochastics::HoLee;
use RustQuant::stochastics::{StochasticProcessConfig, StochasticScheme};
// Create a Ho-Lee process with sigma=1.6 and theta=2.0
let hl = HoLee::new(1.6, 2.0);
// Configure simulation: x0=10.0, t_start=0.0, t_end=1.0, n_steps=125, 1000 paths
let config = StochasticProcessConfig::new(
10.0, 0.0, 1.0, 125, StochasticScheme::EulerMaruyama, 1000, false, None
);
let output = hl.generate(&config);
// Access simulated paths
let paths = &output.paths;