Deriving a Vasicek Yield Curve from Zero-Coupon Bond Prices
Summary
The document asks how to obtain a discount curve when the short rate follows a Vasicek model. It starts from the model’s analytical zero-coupon bond price, expressed using deterministic maturity-dependent functions and the current short rate. Applying the continuously compounded yield relation, the author derives a maturity yield as a linear expression in the short rate, with coefficients determined by those functions and time to maturity.
The example attempts to plot yields across maturities using R and reports that the resulting curve seems wrong. However, it supplies no answer diagnosing the implementation or clarifying the curve construction. In particular, the stated maturity sequence includes zero, where dividing by time to maturity is undefined; interpreting the plot also requires consistent time units and attention to the zero-maturity limit. The material is therefore useful for identifying the bond-price-to-yield relationship, but it does not validate the code or resolve the numerical issue.
Key ideas
- A Vasicek zero-coupon bond price can be converted to a continuously compounded yield using its maturity and logarithm.
- The resulting yield is affine in the current short rate under the stated bond-price form.
- The maturity-zero point makes the yield formula singular and needs a limiting treatment or exclusion.
- The example raises a plotting problem but gives no solution or empirical validation.
Tags
Full text
# How to obtain the discount curve under Vasicek interest rate for discounting cash flow?
# How to obtain the discount curve under Vasicek interest rate for discounting cash flow?
Suppose that the spot rate is governed by a Vasicek model. We know that there is an analytical solution for the zero-coupon bond.
I guess the discount curve is constructed by the Yield curve in which we have that
\begin{equation} y(t, T) = -\frac{lnP(t, T)}{(T-t)} \end{equation} where $P(t, T)$ represents the zero-coupon bond price with maturity time $T$. By the way, the solution for the zero-coupon bond price takes the following form: \begin{equation} P(t, T) = exp\{A(t, T)-B(t, T)r(t)\} \end{equation} where $A(.,.)$ and $B(.,.)$ are deterministic functions. We thus have \begin{equation} y(t, T) = -\frac{A(t, T)}{(T-t)} + \frac{B(t, T)}{(T-t)}r(t) \end{equation}
My problem is when I try to plot the yield curve for different maturity times it seems there is something wrong. Here are my R codes and the output. I do not know if I am thinking right about the discounting curve.
```
r0<- 0.03
theta<- 0.10546209
kappa<- 0.04802047
sigma<- 0.29051285
T<- seq(0, 1, by= 1/252 )
g<- function(kappa, theta, sigma, t, T){
B<- (1-exp(-kappa*(T-t)))/(kappa)
A<- (theta- ((sigma^2)/(2*kappa^2)) )*( B- T+t ) - ( (sigma^2)/(4*kappa) )*B^2
h<- -(A/(T-t))+(B/(T-t))*r0
return(h)
}
y<- numeric(length(T))
for(i in 1:length(y) ){
y[i]<- g(kappa, theta, sigma, 0, T[i])
}
plot(T,y, type="l")
```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.