國立臺灣大學管理學院財務金融學系 碩士論文
Department of Finance College of Management National Taiwan University
Master Thesis
Vasicek 雙因子模型與卡爾曼濾波 Two-Factor Vasicek with Kalman Filter
譚景丞 Jing-Cheng Tan
指導教授:李賢源 博士 Advisor: Shyan-Yuan Lee, Ph.D.
中華民國108年7月
July, 2019
Acknowledgements
I would like to express my gratitude sincerely to my supervisor, Prof Shyan-Yuan Lee who gave me support, assistance and encouragement to complete this project. In addition, I would also like to deliver special thanks to all my examiners, other profes- sors, tutors, and my friends for their assistance and support during the process. To my loved ones, I am deeply grateful for the unrelenting support and encouragement.
中文摘要
此篇論文探討的是 Vasicek 雙因子模型的運用與如何用卡爾曼濾波器估計出多 因子利率模型的參數,並對 Libor 利率進行預測與檢測套利機會。過去的研究 大部分專注在如何推導公式及債券的定價模型理論。此篇論文將過去的利率模 型結合工程應用的卡爾曼濾波器,通過最小化預期誤差,推算出參數,從而利 用結果模型進一步預測市場利率的走勢。由於過去的研究鮮少提及模型的運用 和參數的運算,此篇論文的將會把詳細步驟一一列出介紹,並在附錄附上 R code 提供參考。利率走勢的預測不僅可讓交易者作為參考的指標,同時也供債 券持有金融機構等作為風險控制的一個工具。過去的風險管理工具不外乎 VaR, Expected Shortfall, 資本適足率等。此篇論文也將會探討 Vasicek 模型 如何與過 去風險管理工具結合並實踐到交易風險管理機制。
論文分為四個部分。第一部分介紹固定收益市場與利率曲線的變化。第二部分 講述過去的研究並介紹 Vasicek 多因子模型與卡爾曼濾波器。第三部分會討論如 何運用模型與工程將參數推算出來並探討市場套利空間。第四部分則結合過去 風險管理工具提供一個全新的風險控管方法與概念。
關鍵詞:固定收益,債券, Libor, 利率模型, 套利機會, Vasicek, 卡爾曼濾波器, 風險管理, VaR, Expected Shortfall
Abstract
This paper examines the application of mathematical models such as affine models in determining mispricing in yield curve, developing trading strategies and examining its profitability. Reliable yield curve models can be very useful in predicting and controlling risk in fixed income securities market. Most previous works focused on deriving the mathematical model and formula with little discussion about the detailed process in how to implementing the model. This paper presents a way to summarize the theoretical and practical knowledge in applying the affine models in exploring yield curve arbitrage, specifically combining Vasieck two-factor model with an engineering signal processing tool, Kalman filter, to calibrate using the real market rate data. The paper is organized as follows. The first section of this thesis discusses the major concepts of fixed income markets such as zero coupon yield curve, swap curve and arbitrage opportunities. The second section of this thesis introduces two factor Vasicek short rate models and its implications. The third section constructs trading methodology and examines its profitability. The fourth section applies the model in combining with the risk management tools such as Value at Risk and Expected Shortfall. The final section concludes this thesis.
Keywords: Fixed income, bonds, short rate, Libor, yield curve, arbitrage, Vasicek, Kalman filter, risk management, VaR, Expected Shortfall
Contents
1 Introduction 7
1.1 Fixed income securities . . . 7
1.2 Interest rate curves . . . 8
1.3 Interest rate models . . . 10
2 Short Rate Models 13 2.1 Bond Pricing Formula . . . 13
2.2 Vasicek Model of Short Rate . . . 14
2.3 Kalman Filter . . . 16
3 Calibration and Trading 19 3.1 Kalman Recursive Algorithm . . . 19
3.2 Calibration using historical data . . . 21
3.2.1 Example: The first 100 days . . . 21
3.2.2 Example: A ten-year period (Libor) . . . 26
3.2.3 Example: A ten-year period (Taibor) . . . 29
4 Application in Risk Management 32 4.1 Value at Risk and Expected Shortfall . . . 32
4.2 Term Structure Models with Jump . . . 33
5 Conclusion 35 6 Appendix 39 6.1 R code for parameters calibration . . . 39
List of Figures
1.1 Term structure of interest rates at a point in time (source: Bloomberg
Data) . . . 8
1.2 3-month Libor price movement (source: Bloomberg Data) . . . 9
1.3 Yield curve moves over time (source: Bloomberg Data) . . . 9
1.4 Various term-structure models . . . 11
1.5 Various calibration and estimation methods . . . 11
2.1 Kalman filter explanation flow chart . . . 17
3.1 Historical data of Libor 1, 3-month, 2010 Jan - 2010 May (100 days) . 21 3.2 Historical data of Libor 6, 12-month, 2010 Jan - 2010 May (100 days) 21 3.3 Statistical data of Libor 1, 3, 6, 12-month . . . 22
3.4 Price entered . . . 24
3.5 Profit . . . 24
3.6 Percentage of return . . . 25
3.7 Historical and fitted data of Libor 1, 3-month, 2010 Jan - 2019 Apr (100 days) . . . 26
3.8 Historical and fitted data of Libor 6, 12-month, 2010 Jan - 2019 Apr (100 days) . . . 26
3.9 1-month Libor . . . 27
3.10 3-month Libor . . . 27
3.11 6-month Libor . . . 28
3.12 12-month Libor . . . 28
3.13 Historical and fitted data of Taibor 1, 3-month, 2010 Jan - 2019 Apr
(100 days) . . . 29
3.14 Historical and fitted data of Taibor 6, 12-month, 2010 Jan - 2019 Apr (100 days) . . . 29
3.15 1-month Taibor . . . 30
3.16 3-month Taibor . . . 30
3.17 6-month Taibor . . . 30
3.18 12-month Taibor . . . 31
4.1 VaR formula under Vasicek model . . . 32
4.2 ES formula under Vasicek model . . . 33
4.3 ES and VaR driven by the Vasicek model . . . 33
List of Tables
3.1 Estimated parameters using Libor data . . . 22 3.2 Estimated rates using estimated parameters . . . 23
Chapter 1 Introduction
1.1 Fixed income securities
Fixed income market is a financial market where all the fixed income securities, range from simple products such as government and corporate bonds to complicated products such as inflation linked securities, are traded. The financial market has developed since few hundreds of years ago where all the people gather to borrow and lend money. Today, the market has become more and more complicated, and the products are getting sophisticated. The securities are affected by several types of risks, and investors or financial institutions are therefore always eager to develop a reliable model to control its portfolio risk.
Interest-rate risk is among many risk factors that would affect the price of a fixed income security. Interest rate determines the price of borrowing or lending.
If the interest rate increases, investors expect a higher rate of return while the borrowers expect a higher cost of borrowing. This tells us the opposite direction of the movement of price of bonds against the interest rate, i.e., the market prices fall while the interest rate increases and vice versa. A bond is a contract under which the borrower (the issuer) writes to promise to pay the bondholder interest payments (if any) periodically and principal (face value) on the maturity date. If there is no interest payments, the bond is said to be a zero-coupon bond.
There are some other important risks such as credit risk, liquidity risk,
and others. However, in this paper, we only study how the movement of interest rates affect the price of the securities. For simplicity, the financial instrument that we are going to demonstrate the calibration process and trading is the Libor (Lon- don Interbank Offered Rate). The Libor is the average zero rate at which leading banks borrow funds from other banks in the London market. The term ranges from overnight to as long as 12 months.
1.2 Interest rate curves
Interest rate curve describes the term structure of interest rates, which is the re- lationship between interest rates or bond yields and different terms or maturities.
Figure 1.1 below shows the line describing the relationship between the zero-coupon interest rate and its term to maturity - the zero coupon yield curve. However, the line does not stay stationary forever, and in fact, it changes all the time (see Figure 1.3). The zero coupon yield curve is only an instant snapshot of the term structure of interest rates at a time.
Figure 1.1: Term structure of interest rates at a point in time (source: Bloomberg Data)
Figure 1.2: 3-month Libor price movement (source: Bloomberg Data)
Figure 1.3: Yield curve moves over time (source: Bloomberg Data)
In traditional literature of fixed income securities, Interest rate has been assumed to be constant. Such assumption is acceptable when interest rate plays little role in determining the price movement of fixed income securities, and the term to maturity is short. However, with the advanced improvement, many securities nowadays are strongly linked to movement of interest rates such as swaps, and it is unrealistic to assume the interest rate to hold constant throughout the lifespan of a bond. In the construction of valuation models, it is important to study how interest rate curve moves over time. This is basically equal to the studies of the movement of stock prices over time. There are several factors affecting the price movement
of individual stocks such as price to earnings ratio, GDP growth and others. This goes the same for interest rates by asking how much premium is considered fair enough to be paid to the bond buyers? In this paper, we are exploring in a more mathematical method under Black-Scholes valuation framework, with the condition unlike stocks, that the bond price converges to par at maturity, affecting by the stochastic movement of instantaneous rate of return on the bond itself.
1.3 Interest rate models
Term structure models could be divided into static models and dynamic models. Un- der dynamic models, there are several generations of multi-factor models: 1. short rate models (Vasicek (1977) (Vasicek, 1977), CIR (1985) (Cox et al., 1985), etc.
), 2. Heath-Jattow-Morton models (Hull & White (1993) (Hull and White, 1993), Black-Derman-Toy (1990) (Black et al., 1990), etc.), and 3. Libor Market model (Brace-Musiela-Gatarek (1997) (Brace et al., 1997), etc. ). This paper adopts the most classic Vasicek short rate model which is a variation from its peer CIR short rate model. CIR model does not allow negative interest rates which actually hap- pens in some countries today. Empiricial studies of multi-factor models include Stambaugh (1988) (Stambaugh, 1988), Heston (1993) (Heston, 1993), Chen & Scott (1993) (Chen and Scott, 1993a), Duffie and Singleton (1999) (Duffie and Singleton, 1999). With cross-sectional interest rate data, one can calibrate the parameters of the model. The result could vary depending on the model specification, time pe- riod, and also calibration methods. The estimation and calibration methods include methods based on: 1. Moments, 2. Likelihood function, and 3. Statistics, etc. The aforementioned models and methods are summarized in tables below:
Figure 1.4: Various term-structure models
Figure 1.5: Various calibration and estimation methods
In addition, there are different interest rate instruments for us to apply the models and methods as mentioned. The popular products include swaps, swaptions, bonds and other more complicated derivatives. As we can see, different combinations could be formed between interest rate models and estimation methods in different markets. Most papers only discuss the derivation of the underlying mathematical theories, and sometimes it could be unrealistic or near impossible to be applied in daily application considering the complexity and assumptions. Fitting the yield curve is nevertheless the most common application of the model in the industry.
This paper, however, presents a step-by-step guideline from applying the theoreti- cal results, specifically Vasicek model, estimating the parameters using the famous Kalman filter method (Kalman, 1960), and predicting the movement of each term
rates. We will also discuss how yield curve modeling can be applied to risk manage- ment.
Chapter 2
Short Rate Models
In this section, we assume the known models of stochastic movement of interest rate called short rate models and derive the corresponding bond price formula. Short rates are instantaneous rates of return on the bond. After the bond is issued, the value of the bond changes over time until maturity. At every instant of time, changes on the value of the bond is affected by the instantaneous return on the bond. We denote the short rate as r(t), the yield that can be earned on a infinitesimally short investment at time t.
2.1 Bond Pricing Formula
As defined above, r(t) is the short rate function of t, for time t ∈ [0,T], where T is the maturity date of the bond. With known function of r(t), we can derive the function of bond price, which can be written in a simple first order linear ordinary differential equation as follows:
dP (t, T )
dt + k(t) = r(t)P (t, T ), t < T (2.1)
P (T, T ) = F (2.2)
where P (t, T ) is bond price, k(t) is instantaneous coupon rate, F = 1 is the par value.
Solving the O.D.E above which requires multiplication of integrating factor together
with the final condition (2.2), the bond price formula is given as follows:
P (t, T ) = e−R
T t r(s)ds
[F +
Z T t
k(u)eR
T u r(s)ds
du] (2.3)
The above equation can been seen as the discounted value of the final redemp- tion value of the bond plus the amount k(u)du received over the period, in which e−
RT t r(s)ds
is the discount factor. if k(t) = 0 for all t, the bond is called zero coupon bond.
Zero rate or Spot rate of a bond is the internal rate of return earned by an investor if he or she purchases the pure discount bond today and holds the bond until maturity. Here, we denote z(t, T ) as the zero rate when the investor buys the bond at time t and hold until maturity date T . Therefore,
z(t, T ) = − 1
T − t lnP (t, T ) (2.4)
Zero rate normally increases with longer maturity, which draws the upward sloping spot rate curve. However, there are some occasions when the curve is downward sloping.
2.2 Vasicek Model of Short Rate
The rate of return on actual short investment period changes quickly and could be unpredictable for most of the time. In one-factor short rate model setting, the in- stantaneous short rate’s dynamic movement can be described by a stochastic process in the following form:
dr(t) = µ(r, t)dt + σ(r, t)dZ(t) (2.5) where µ(r, t) is the instantaneous drift, σ(r, t) is the instantaneous variance of the process of r(t) and Z(t) is the standard Wiener process.
Particularly for Vasicek model in our paper (Vasicek, 1977),
dz(t) = κ(θ − z)dt + σdZ(t) (2.6)
magnitude proportional to its deviation from the long-term mean. This makes sense as rates tend to fluctuate around policy rate set by central bank.
Previous work has shown that the solution to the zero coupon bond price could be written in the following analytical form: (Heston, 1993)
P (τ, z) = eA(τ )−B(τ )z
(2.7) where τ is the term to maturity, and
A(τ ) = γ(B(τ ) − τ )
κ2 −σ2B2(τ )
4κ (2.8)
B(τ ) = 1
κ(1 − e−κτ) (2.9)
γ = κ2(θ − σλ κ ) −σ2
2 (2.10)
Moving forward to the two factor Vasicek model of short rate, we do the same as above by writing the stochastic process:
dz(t) = dX1(t) + dX2(t) (2.11)
dX1(t) = κ1(θ1− X1)dt + σ1dZ1(t) (2.12) dX2(t) = κ2(θ2− X2)dt + σ2dZ2(t) (2.13) Here, the short rate r(t) is divided in the sum of two parts, capturing the movement of short rate in a more detailed way. The solution to the zero coupon bond prices under Vasicek two-factor model can be written in the following analytical form:
(Corzo Santamaria and Schwartz, 2000)
P (τ, z) = eA(τ )−B1(τ )X1−B2(τ )X2 (2.14) A(τ ) =
2
X
i=1
(γi(Bi(τ ) − τ )
κ2i −σi2B2i(τ )
4κi )+ρσ1σ2
κ1κ2 (τ −B1(τ )−B2(τ )+ 1
κ1+ κ2(1−e−(κ1+κ2)(τ ))) (2.15) Bi(τ ) = 1
κi(1 − e−κ+iτ) (2.16)
γi = κ2i(θi− σiλi κi ) −σi2
2 (2.17)
2.3 Kalman Filter
In previous section, we have written out the Vasicek one and two factors model explicitly in terms of the parameters ( θ, κ, σ, λ, ρ). The relationship between the zero coupon bond prices and interest rate are linked to the parameters. However, the theory does not tell us anything about the parameter set and how we should determine the values. Parameter estimation is important because it can affect the credibility of the model. There are several ways to calibrate the parameters in the model, and we are going to introduce a methodology called Kalman filter to estimate the values (Babbs and Nowman, 1999). Kalman filter has long been a powerful tool especially in national defense or application such as GPS coordination to estimate the true value as accurately as possible.
Kalman filter is named after Hungarian ´emigr´e Rudolf E. K´alm´an. Kalman filter was initially introduced to be implemented in the navigation systems of U.S. armed forces system. Later, it had gained popularity in the affine term-structure litera- ture by Duan and Simonato (1995) (Duan and Simonato, 1993), Geyer, Kossmeier and Pichler (2004) (Geyer et al., 2004) and Babbs and Nowman (1999) (Babbs and Nowman, 1999). Kalman filter is an iterative mathematical process that uses a set of equations and consecutive data inputs to quickly estimate the true value of the object being measured when the measured values contain unpredicted or random error, uncertainty or variation.
Figure 2.1: Kalman filter explanation flow chart
Kalman State-space Formulation
To apply Kalman filter, we need to construct a state-space formulation to describe the relationship between observed values (zero coupon rate from the market) and predicted values (values predicted by theory). In fact, we already have the formula to show the transformation from the factor variables to zero coupon rate in previous section, and we only need to write them out in the form of linear state-space matrices.
Combining equation 2.4 and 2.14, we obtain:
z(t, T ) = − 1
T − t (A(τ ) − B1(τ )X1− B2(τ )X2) (2.18) Consider multiple zero coupon rates with different term to maturity, the equation could be written in the form of matrices:
z(ti, ti+ τ1) z(ti, ti+ τ2)
. . z(ti, ti+ τn)
=
−A(τ1) τ1
−A(τ2) τ2
. .
−A(τn) τn
+
−B1(τ1) τ1
−B2(τ1) τ1
−B1(τ2) τ2
−B2(τ2) τ2 .
.
−B1(τn) τn
−B2(τn) τn
x1(ti) x2(ti)
+
1(ti)
2(ti) . .
n(ti)
(2.19)
or equivalently,
z(ti) = D + Hx(ti) + (ti) (2.20) where:
(ti) ∼ N (0, R) (2.21)
R =
h2 0 ... 0 0 h2 ... 0 ...
0 0 ... h2
(2.22)
With our measurement system formulated, we now construct our transition system, equation 2.12 and 2.13, into form of matrices. The stochastic differential equations could be discretized by quite a few choices, and we use Euler scheme in this paper:
x1(ti) x2(ti)
=
θ1(1 − e−κ1δt) θ2(1 − e−κ2δt)
+
e−κ1δt 0 0 e−κ2δt
x1(ti−1) x2(ti−1)
+
η1(ti) η2(ti)
(2.23) where:
η(ti) ∼ N (0, Q) (2.24)
Q =
σ21
2κ1(1 − e2κ1(T −t)) ρσ1σ2
κ1+ κ2(1 − e(κ1+κ2)(T −t) ρσ1σ2
κ1+ κ2(1 − e(κ1+κ2)(T −t) σ22
2κ2(1 − e2κ2(T −t))
(2.25)
or equivalently,
x(ti) = C + Ex(ti−1) + η(ti) (2.26) Equations 2.19 and 2.23 together represent the state-space form of two-factor Vasicek model. N-factor can be constructed using a similar approach as shown above but we will not show here due to its complexity.
Chapter 3
Calibration and Trading
3.1 Kalman Recursive Algorithm
In this section, we will describe the steps to estimate the parameters. The idea is basically by first observing the historical real Libor rates data (the observed values) that are subject to noise error, for example bid-ask spreads or trading errors. The Kalman filter is responsible for filtering away the unwanted noise and get us closer to the true value. (Chen and Scott, 1993b)
Step 1: Setting the initial values
We initialize our state vector by setting the values to its unconditional mean:
E[x0] =
θ1 θ2
(3.1)
and initial process covariance matrix, P0:
P0 = var[x0] =
σ12 2κ1 0
0 σ21 2κ1
(3.2)
Step 2: Calculating predicted state and process covariance matrix (P
i)
xi = E[xi|i−1] = C + E ∗ E[xi−1] (3.3) Pkpi = E ∗ Pi−1∗ ET + Q (3.4)
Step 3: Calculating observed state
E[zi|i−1] = D + H ∗ E[xi|i−1] (3.5)
var[zi|i−1] = H ∗ Pkpi ∗ HT + R (3.6)
Step 3: Estimating prediction error, ς
iςi = zi− E[zi|i−1] (3.7)
Step 4: Calculating Kalman gain, K
iKi = Pkpi∗ HT ∗ var[zi|i−1]−1 (3.8)
Step 5: Updating state vector and process covariance matrix for next iteration
E[xi|i] = E[xi|i−1] + Ki∗ ςi (3.9)
Pi = (I − Ki∗ H) ∗ Pkpi (3.10)
Final step: Maximizing likelihood function
L = −nN ln(2π)
2 − 0.5
N
X
i=1
[ln(|var[zi|i−1]|) + ςiTvar[zi|i−1]−1ςi] (3.11)
;OR
Final step: Minimizing absolute prediction error
L =
N
X
i=1
|ςi| (3.12)
where n is the number of different term to maturity, N is the number of data of different dates for the iteration.
3.2 Calibration using historical data
In this section, we calibrate our preceding models by using the live rates from Libor market. (Duarte et al., 2006) The daily Libor rate data for this paper is from Bloomberg database (1-mon Libor: US0001M Index, 3-mon Libor: US0003M Index, 6-mon Libor: US0006M Index, 12-mon Libor: US0012M Index). Unlike bond prices, the data is available nice and neat, and therefore no effort is needed to clean the data.
I only consider 1-month 3-month 6-month and 12-month Libor to estimate the 10 parameters (θ1, κ1, σ1, λ1, θ2, κ2, σ2, λ2, ρ, h) of the model. The period for calibration will be 100 days, approximately 4 months, which is long enough to capture the movement of the parameters.
3.2.1 Example: The first 100 days
In our first example, the period is from 4 Jan 2010 to 21 May 2010. The summary statistics of the historical data is shown in Figure 3.3 below.
(a) 1-month Libor (b) 3-month Libor
Figure 3.1: Historical data of Libor 1, 3-month, 2010 Jan - 2010 May (100 days)
(a) 6-month Libor (b) 12-month Libor
Figure 3.2: Historical data of Libor 6, 12-month, 2010 Jan - 2010 May (100 days)
Parameters Values θ1 0.00973812621 κ1 0.03448272329 σ1 0.03976446814 λ1 -0.14186613442 θ2 -0.01165157362 κ2 0.69590183998 σ2 0.05292650073 λ2 -0.46350055017
ρ 0.00764029563 h -0.00003192243
Table 3.1: Estimated parameters using Libor data
Figure 3.3: Statistical data of Libor 1, 3, 6, 12-month
After iterating over parameter values until the global minimum of the sum of absolute errors is obtained, the resulting parameter estimates are shown in Table 3.1. With the parameter values, we again solve for the values of X1 and X2 by estimate using the Vasicek model and Kalman filter. The estimated rates are shown in Table 3.2. As we can see, our model shows us forward-looking results in a sense that the estimated rates capture the trend and direction of the rates, rather than just giving the mean or median of the sample period data (see Figure 3.3).
Term Rates 1-month 0.3305679%
3-month 0.5077538%
6-month 0.7493960%
12-month 1.1599853%
Table 3.2: Estimated rates using estimated parameters
Sample Trading and results
This paper also proposes one approach with a yield curve arbitrage strategy that examines the model’s ability to identify any latent mispricing. Following this intu- ition, we could develop a trading strategy based on the ”mispricing” by going short in the overvalued Libor rates (the Libor rates which are traded much higher than the estimated model rates) and going long in the undervalued Libor rates (the Libor rates which are traded much lower than the estimated model rates), or equivalently taking long position in the corresponding bonds and taking short position in the cor- responding bonds, respectively. The trading period is set 40 days after the 100-day calibration period. A new set of parameters are estimated again after the 40-day trading period.
During the 40-day trading period, we short any rates which are more than 5.5% away from the estimated rates. The percentage is calculated in such a way:
Distance = |T rue − Estimate|
T rue (3.13)
To close the outstanding position in our portfolio, we trade in a different direction when the rates are less than 3.5% away from the estimated rates. There is no strict rule to set the barrier levels to be 5.5% or 3.5%; however, one possible guideline here is that we could derive from the estimated volatility of the period that we are trading. Following the suggestion above, we could expect a return of approximately 2% for each closed transaction. We demonstrate our results in the below sections.
Portfolio:
The numbers are the price entered. Positive sign shows long position, negative sign shows short position. The rows are 1-mon, 3-mon, 6-mon, 12-mon Libor, and the column numbers are the nth day. The trading starts from the 101th day.
Figure 3.4: Price entered
Profit:
The numbers are the realized profits after the position is closed. The profit is calculated as:
Profit = Closing Price − Sum of price entered
number of transactions (3.14)
Percentage of return:
The number shows the percentage of return of each profit generated. The percentage of return is calculated as:
Percentage of return = Profit
Sum of price entered number of transactions
(3.15)
Figure 3.6: Percentage of return
To avoid confusion, take for example, on the 110th day, we make a profit from 12-mon Libor of 0.0002757, which is a 2.25% of return in only ten days. The result is quite amazing that the model has some ability to predict the movement of rates.
3.2.2 Example: A ten-year period (Libor)
The previous example shows the result for short period. In this example, we are testing the performance of the above calibration method and the fitting strategy for a longer period. The period we are testing is from January 2010 to April 2019.
Although we are looking into a longer period, the calibration period is still 100 days.
For the avoidance of doubt, the rates on the 101th day is based on the parameters derived from the 100 days immediately preceding the 101th day. We continue this process for the next day until April 2019 and plot the estimated rates together with the historical rates. The results are shown in the figures below:
(a) 1-month Libor (b) 3-month Libor
Figure 3.7: Historical and fitted data of Libor 1, 3-month, 2010 Jan - 2019 Apr (100 days)
(a) 6-month Libor (b) 12-month Libor
Figure 3.8: Historical and fitted data of Libor 6, 12-month, 2010 Jan - 2019 Apr (100 days)
To look into more details, we plot the difference between historical real and estimated data.
(a) 1-month Libor Historical minus Estimated (b) Summary stats (%)
Figure 3.9: 1-month Libor
(a) 3-month Libor Historical minus Estimated (b) Summary stats (%)
Figure 3.10: 3-month Libor
(a) 6-month Libor Historical minus Estimated (b) Summary stats (%)
Figure 3.11: 6-month Libor
(a) 12-month Libor Historical minus Estimated (b) Summary stats (%)
Figure 3.12: 12-month Libor
3.2.3 Example: A ten-year period (Taibor)
In our second example, we repeat the process in the previous example for the Taipei Interbank Offered Rate (Taibor). The period we are testing is from January 2010 to April 2019. The calibration period is 100 days. The results are shown in the figures below:
(a) 1-month Taibor (b) 3-month Taibor
Figure 3.13: Historical and fitted data of Taibor 1, 3-month, 2010 Jan - 2019 Apr (100 days)
(a) 6-month Taibor (b) 12-month Taibor
Figure 3.14: Historical and fitted data of Taibor 6, 12-month, 2010 Jan - 2019 Apr (100 days)
To look into more details, we plot the difference between historical real and estimated data.
(a) 1-month Taibor Historical minus Estimated (b) Summary stats (%)
Figure 3.15: 1-month Taibor
(a) 3-month Taibor Historical minus Estimated (b) Summary stats (%)
Figure 3.16: 3-month Taibor
(a) 6-month Taibor Historical minus Estimated (b) Summary stats (%)
(a) 12-month Taibor Historical minus Estimated (b) Summary stats (%)
Figure 3.18: 12-month Taibor
As we can see in the above plots, the difference between historical and fitted data could be huge when the rate started changing its direction (from station- ary to upward or downward). The reason could be explained by the reluctance of change in estimation because the model is designed to not to be affected much by the ”temporary” deviation of rates from the mean value. However, when interest rate policy changes, the change is no longer ”temporary”, and we should adjust accordingly. The model might only be good enough to use during the period when interest rate is stable. However, as in the case of Taibor, even during the period when the rate is relatively stable, there is still difference between real and estimated value. This is because the parameter set is calibrated using four rates at the same time, and therefore movement of rates could affect one another. Having said that, we could also adjust our error matrices and therefore Kalman gain in Kalman filter to put more weight on the real data when estimating the rates.
Chapter 4
Application in Risk Management
4.1 Value at Risk and Expected Shortfall
Yield curve risk management and risk measurement pertain to the practice of de- termining the sensitivity of a portfolio of fixed income securities to the change of yield curves. The purpose for predicting the movement of rates can be strategic or tactical, offensive or defensive, depending the underlying objectives. Different quan- titative risk measures have been proposed to provide a reliable approach to manage risk of portfolio such as value at risk (VaR) and expected shortfall.
Little effort has been devoted in the research of combination of short rate models and risk measures. Fortunately, in the paper of Song (2012) (Song et al., 2012), the author combines the price formula, as specified above in equation 2.14, with the definition of VaR, under defined probability space. Furthermore, the author also takes expectation beyond calculated VaR to derive expected shortfall formula.
Figure 4.1: VaR formula under Vasicek model
Figure 4.2: ES formula under Vasicek model
The numerical result is presented in a graph as shown in Figure 4.3 below.
The positive slope in the graph shows that higher risk evaluation corresponds to an increase in the confidence level. Due to its mean-reverting property, the model is a more conservative evaluation of risk, and thus any deviation from the mean or sudden jump in the rate could result a huge expected loss. Nevertheless, the idea allows portfolio managers especially managing fixed income securities to manage their risk expectation more efficiently by the help of the models. Similar approaches could also be applied to other short rate models.
Figure 4.3: ES and VaR driven by the Vasicek model
4.2 Term Structure Models with Jump
A jump process is introduced in our continuous model. The term structure models with jump allows the short rate to have discrete movements, called jumps, with random arrival times. This sometimes happens in country where the central bank suddenly announces interest rate hike to strengthen its weakening currency. Re-
search in this field has been carried out in several papers including Wu (2018) (Wu and Liang, 2018) and Park (2006) (Park et al., 2006). The model could be repre- sented in the following equation:
dr(t) = µ(r, t)dt + σ(r, t)dZ(t) + J dπ (4.1)
where jump size J is normal variable with its mean and standard deviation.
The model is time dependent. Factors such as conditions of economy, inflation rate expectations, monetary policies and expected trends in other macroe- conomic variables could affect the short rate movement. With jump factor in the model, the model is more correctly specify to reflect the real situation. Unlike in our case study of Taibor above, although the rate has been quite stable most of the time with little movement, a sudden deviation from the mean could affect the parameters and its predictability. Therefore, with an extra factor to capture the random arrival of jump could help to increase the accuracy of the model.
Chapter 5 Conclusion
As conclusion, this paper studies the yield curve arbitrage opportunities in the Libor market by means of constructing a trading strategy based on Vasicek two-factor model and Kalman filter. The first part of this paper focused on the theoretical development of the different class of term-structure models. We first introduce the single-factor model to describe the stochastic movement process of the short rate, and later the two-factor model. The multi-factor model can be generalized in a similar approach by Langetieg (1980) (Langetieg, 1980).
With the necessary model, we present the Kalman filter method to help estimate the parameters and interest rates. The technique was selected due to its flexibility to estimate true values between predicted and observed values, especially when the observed values keep changing. Having estimated the required parameter set and rates, we then apply it on the next pre-determined number of days to check if there is any arbitrage opportunity.
This paper presents an introductory point on the possibility of using the methodology proposed to manage risk or seek arbitrage profit from trading in the market. The details, including the trading period, barrier levels, or the error matri- ces in the model, could be tweaked accordingly to the underlying market sentiment.
Last but not least, it might worth further exploration of the possibilities of the application for interest rate risk management analysis.
Bibliography
Babbs, S. H. and Nowman, K. B. (1999). Kalman filtering of generalized va- sicek term structure models. Journal of Financial and Quantitative Analysis, 34(1):115–130.
Black, F., Derman, E., and Toy, W. (1990). A one-factor model of interest rates and its application to treasury bond options. Financial analysts journal, 46(1):33–
39.
Brace, A., G¸atarek, D., and Musiela, M. (1997). The market model of interest rate dynamics. Mathematical finance, 7(2):127–155.
Chen, R.-R. and Scott, L. (1993a). Maximum likelihood estimation for a multifactor equilibrium model of the term structure of interest rates. The Journal of Fixed Income, 3(3):14–31.
Chen, R. R. and Scott, L. (1993b). Multi-factor cox-ingersoll-ross models of the term structure: Estimates and tests from a state-space model using a kalman filter. Unpublished manuscript, University of Georgia.
Corzo Santamaria, T. and Schwartz, E. S. (2000). Convergence within the eu:
Evidence from interest rates. Economic Notes, 29(2):243–266.
Cox, J. C., Ingersoll Jr, J. E., and Ross, S. A. (1985). An intertemporal general equilibrium model of asset prices. Econometrica: Journal of the Econometric Society, pages 363–384.
hood factor analysis. Journal of Statistical Computation and Simulation, 47(1- 2):37–47.
Duarte, J., Longstaff, F. A., and Yu, F. (2006). Risk and Return in Fixed-Income Arbitrage: Nickels in Front of a Steamroller? The Review of Financial Studies, 20(3):769–811.
Duffie, J. D. and Singleton, K. J. (1999). Modeling term structures of defaultable bond. Review of Financial Studies, 12(3).
Geyer, A., Kossmeier, S., and Pichler, S. (2004). Measuring systematic risk in emu government yield spreads. Review of Finance, 8(2):171–197.
Heston, S. L. (1993). A closed-form solution for options with stochastic volatility with applications to bond and currency options. The review of financial studies, 6(2):327–343.
Hull, J. and White, A. (1993). One-factor interest-rate models and the valuation of interest-rate derivative securities. Journal of financial and quantitative analysis, 28(2):235–254.
Kalman, R. (1960). A new approach to linear filtering and prediction problems.
Journal of Basic Engineering (ASME), 82D:35–45.
Langetieg, T. C. (1980). A multivariate model of the term structure. The Journal of Finance, 35(1):71–97.
Park, K., Kim, M., and Kim, S. (2006). Stochastic simulation method for the term structure models with jump. In International Conference on Computational Science and Its Applications, pages 1054–1063. Springer.
Song, N., Siu, T. K., Fard, F. A., Ching, W.-K., and Fung, E. S. (2012). Risk measures and behaviors for bonds under stochastic interest rate models. Math- ematical and Computer Modelling, 56(9-10):204–217.
Stambaugh, R. F. (1988). The information in forward rates: Implications for models of the term structure. Journal of Financial Economics, 21(1):41–70.
Vasicek, O. (1977). An equilibrium characterization of the term structure. Journal of financial economics, 5(2):177–188.
Wu, Y. and Liang, X. (2018). Vasicek model with mixed-exponential jumps and its applications in finance and insurance. Advances in Difference Equations, 2018(1):138.
Chapter 6 Appendix
6.1 R code for parameters calibration
library(MASS)
#Calibration
parameter = rep(0,10) # initialize parameters to be estimated tau = c(1/12,3/12,6/12,1)
Ya = Libor_1_3_6_12
Y=Ya[,2:5]/100 #percentage to decimal
nocol = dim(Ya)[2] - 1 # exclude date column
para0 = c( 0.05, 0.06, 0.019, -0.189, 0.01, 0.7, 0.05, -0.504, -0.02, 0.001) # initial estimate
startrow = 1 norow=100
f = function(para) LLtwoVasicek(para,Y,tau,norow,nocol, startrow) result = optim(par = para0, fn = f) #minimizing function
parameter = result$par
LLtwoVasicek = {
function (para,Y, tau, norow, nocol, startrow) {
#Initialize the parameters for Vasicek model
theta1=para[1]
kappa1=para[2]
sigma1=para[3]
lambda1=para[4]
theta2=para[5]
kappa2=para[6]
sigma2=para[7]
lambda2=para[8]
rou = para[9]
h = para[10]
#initialize Error Variance to diagonal matrix R = diag(nocol)
for(i in 1:nocol) {
R[i,i] = hˆ2 }
dt = 1/360
#Predicted state Matrices Initialization, y = C + Ey + error
E = matrix( c(exp(-kappa1*dt),0 , 0,exp(-kappa2*dt)), nrow =2, ncol = 2, byrow = TRUE);
# Observation state affine Matrices Initialization, z = D + Hy + error
D = matrix( 0, nrow = nocol, ncol = 1, byrow = TRUE) H = matrix( 0, nrow = nocol, ncol = 2, byrow = TRUE)
for (i in 1:nocol) # System Matrices are made for each tau {
gamma1 = kappa1ˆ2 * (theta1 - sigma1*lambda1 / kappa1) - sigma1 ˆ2/2
gamma2 = kappa2ˆ2 * (theta2 - sigma2*lambda2 / kappa2) - sigma2 ˆ2/2
B1 = (1-exp(-kappa1 * tau[i])) / kappa1 B2 = (1-exp(-kappa2 * tau[i])) / kappa2
Aaa = gamma1*(B1 - tau[i]) / kappa1ˆ2 - sigma1ˆ2 * B1ˆ2/ (4*
kappa1)
Aab = gamma2*(B2 - tau[i]) / kappa2ˆ2 - sigma2ˆ2 * B2ˆ2/ (4*
kappa2)
Ab = rou * sigma1 * sigma2 * (tau[i] - B1 - B2 + (1-exp(-(
kappa1 + kappa2)*tau[i]))/(kappa1 + kappa2) ) / (kappa1*
kappa2)
A = Aaa + Aab + Ab
D[i,1]= -A / tau[i]
H[i,1]= -B1 / tau[i]
H[i,2]= -B2 / tau[i]
}
## Kalman filter
# Initialization
initx=matrix( c(theta1,theta2), nrow = 2, ncol =1, byrow = TRUE);
initV=matrix( c( (sigma1ˆ2)/(2*kappa1), (rou*sigma1*sigma2)/(
kappa1 + kappa2), (rou*sigma1*sigma2)/(kappa1 + kappa2), ( sigma2ˆ2)/(2*kappa2)), nrow =2, ncol =2, byrow = TRUE)
# Starting values AdjS=initx
VarS=initV
LL= matrix(0, nrow = (startrow + norow), ncol =1, byrow = TRUE) # minimizing function initialization
for(i in startrow:(startrow + norow)) {
PredS = C+E%*%AdjS
Q= matrix( c( sigma1ˆ2*(1-exp(-2*kappa1*dt))/(2*kappa1), (rou*
sigma1*sigma2*(1-exp(-(kappa1 + kappa2)*dt)))/(kappa1 + kappa2),
(rou*sigma1*sigma2*(1-exp(-(kappa1 + kappa2)*dt))) /(kappa1 + kappa2), sigma2ˆ2*(1-exp(-2*kappa2*
dt))/(2*kappa2) ), nrow =2, ncol=2, byrow = TRUE)
# Step 2
PredY=D+H%*%PredS VarY=H%*%VarS%*%t(H)+R
# Step 3
PredError=t(Y[i, ])-PredY # difference between predicted and observed
InvVarY=ginv(VarY)
KalmanGain=VarS%*%t(H)%*%InvVarY
AdjS=PredS+KalmanGain%*%PredError #update for the next iteration
#LL[i]=as.numeric(-(nocol/2)*log(2*pi)-0.5*log(det(VarY))-0.5*
t(PredError)%*%InvVarY%*%PredError) LL[i] = abs(mean(PredError))
VarS=(diag(2)-KalmanGain%*%H)%*%VarS #update for the next iteration
}
sumll= sum(LL) return(sumll) }
}