CIR Zero-Coupon Bond Pricing and Parameter Calibration
Summary
The document discusses pricing a zero-coupon bond under the Cox-Ingersoll-Ross short-rate model and asks how to choose its long-run rate, mean-reversion speed, and volatility. One response expresses bond value as the expected discount factor over the bond’s life. It notes that CIR has known transition distributions and argues that exact sampling can be used in Monte Carlo instead of approximating rates with Euler–Maruyama steps. The supplied code, by contrast, uses a discretized rate process and a closed-form CIR bond-pricing expression.
For calibration, the responses suggest fitting the model to market zero-coupon bond prices, with volatility informed by swaption prices. They do not provide a full calibration procedure or resolve which rate series should define the long-run mean. The claim that the terminal rate distribution directly gives the integrated short rate is not generally a valid shortcut; pricing requires the accumulated rate or the model’s bond-pricing formula. The discussion is therefore an introduction to pricing and calibration considerations, rather than a complete implementation guide.
Key ideas
- A zero-coupon bond’s value can be represented as the expected discount factor through maturity.
- CIR bond prices have a closed-form expression based on model parameters and the current short rate.
- The CIR transition distribution can support exact Monte Carlo sampling instead of Euler–Maruyama approximation.
- The responses recommend fitting mean-reversion parameters to market bond prices and using swaption prices to inform volatility.
- The document does not specify a complete calibration method or settle the choice of long-run rate series.
Tags
Full text
# How do I pricing a ZCB using CIR (Cox-Ingersoll-Ross) model
# How do I pricing a ZCB using CIR (Cox-Ingersoll-Ross) model
Please see the codes below
My question is about input parameters (a, b and sigma)and their calculation.
For the long term mean "b", do we use effective Fed Fund rates? or 3m T-bills?
Also, how do I calculate the mean reversion speed 'a'?
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import math
import timeit
start = timeit.default_timer()
def inst_to_ann(r):
return np.expm1(r)
def ann_to_inst(r):
return np.log1p(r)
def cir(n_years = 1, n_scenarios=1, a=0.05, b=0.03, sigma=0.05, steps_per_year=52, r_0=None):
if r_0 is None: r_0 = b
r_0 = ann_to_inst(r_0)
dt = 1/ steps_per_year
num_steps = int(n_years * steps_per_year) + 1 # because n_years might be a float
I = np.random.normal(0, scale=np.sqrt(dt), size=(num_steps, n_scenarios))
rates = np.empty_like(I)
rates[0] = r_0
## For Price Generation
h = math.sqrt(a ** 2 + 2 * sigma ** 2)
prices = np.empty_like(I)
def price(ttm, r):
_A = ((2 * h * math.exp((h + a) * ttm / 2)) / (2 * h + (h + a) * (math.exp(h * ttm) - 1))) ** (
2 * a * b / sigma ** 2)
_B = (2 * (math.exp(h * ttm) - 1)) / (2 * h + (h + a) * (math.exp(h * ttm) - 1))
_P = _A * np.exp(-_B * r)
return _P
prices[0] = price(n_years, r_0)
for step in range(1, num_steps):
r_t = rates[step - 1]
d_r_t = a * (b - r_t) * dt + sigma * np.sqrt(r_t) * I[step]
rates[step] = abs(r_t + d_r_t)
# generate prices at time t as well ...
prices[step] = price(n_years - step * dt, rates[step])
rates = pd.DataFrame(data=inst_to_ann(rates), index=range(num_steps))
### for prices
prices = pd.DataFrame(data=prices, index=range(num_steps))
return rates, prices
dfrates,dfprices = cir(n_scenarios=1000)
dfprices.plot()
plt.show()
print(dfprices)
stop = timeit.default_timer()
print('Time: ', stop - start)
```
## Answer by oliversm (score 1)
https://quant.stackexchange.com/a/57873
## Monte Carlo simulation for pricing a zero coupon bond
To assess the value $V_t$ of a zero coupon bond $B_{T, t}$ issued today at time $t$ with expiry at time $T$, you can do so using the formula $$ V_t = \mathbb{E}\left(\exp\left(-\int_t^T r_s \mathrm{d}s\right)\underbrace{B_{T, T}}_{=1}\right). $$ Now if you're using the CIR model the nice thing is that the distribution of $r_T$ given $r_t$ is known (it's a non-central $\chi^2$), and hence you can use the relation $$ r_T = r_s + \int_t^T r_s \mathrm{d}s, $$ and re-arrange this to know the distribution of $\int_t^T r_s \mathrm{d}s$.
#### Don't use the Euler-Maruyama scheme if you know the exact distribution
As we know the exact distribution of $\int_t^T r_s \mathrm{d}s$, there is no-need to use the Euler-Maruyama scheme to approximate a sample from this, as an exact sample can be drawn. This then makes using Monte Carlo to compute the expectation much easier (albeit the non-central $\chi^2$ is not cheap!), and thus pricing a zero coupon bond easy.
## Calibrating the model
You ask how to find the values for $a$, and what to use for $b$. The best way to do this is to calibrate your model, which is a trickier question, which I will let other answers address.
## Answer by rvignolo (score 0)
https://quant.stackexchange.com/a/57872
> For the long term mean "b", do we use effective Fed Fund rates? or 3m T-bills?
I don't think so. For this particular short rate model, you have to provide 3 input parameters, namely: $a$, $b$ and $\sigma$ (using your notation).
I believe that $a$ and $b$ are obtained by fitting the current term structure of zero coupon bonds $P^M(0,T)$ present in the market and $\sigma$ comes from swaption prices.
For example, the Gaussian Short Rate model (GSR) has an analytical expression for $b(t)$, that depends on derivatives of $P^M(0,T)$, by means of the forward instantaneous rate $f(0, T)$ and its derivative. On the other hand, the CIR model does not have such analytical result.
Constructing $P(0, T)$ and $f(0, T)$ is a whole subject itself (commonly referred as bootstrapping the yield curve). I can elaborate on this if it is desired.
Hope it helps! Thanks!Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.