Calibratio of the Vasicek Model: A Step by Step Guide Victor Beral A. April, 06 victor.beral@mathmods.eu Abstract I this report we preset 3 methods for calibratig the OrsteiUhlebeck process to a data set. The model is described ad the sesitivity aalysis with respect to chages i the parameters is performed. I particular the Least Squares Method, the Maximum Likelihood Method ad the Log Term Quatile Method are preseted i detail. Itroductio The OrsteiUhlebeck process [3] amed after Leoard Orstei ad George Eugee Uhlebeck, is a stochastic process that, over time, teds to drift towards its log-term mea: such a process is called mearevertig. It ca also be cosidered as the cotiuous-time aalogue of the discrete-time AR process where there is a tedecy of the walk to move back towards a cetral locatio, with a greater attractio whe the process is further away from the ceter. Vasicek assumed that the istataeous spot Iterest Rate uder the real world measure evolves as a Orstei- Uhlebeck process with costat coeciets [5]. The most importat feature which this model exhibits is the mea reversio,which meas that if the iterest rate is bigger tha the log ru mea µ, the the coeciet λ makes the drift become egative so that the rate will be pulled dow i the directio of µ. Similarly, if the iterest rate is smaller tha the log ru mea. Therefore, the coeciet λ is the speed of adjustmet of the iterest rate towards its log ru level. This model is of particulaterest i ace because there are also compellig ecoomic argumets i favor of mea reversio. Whe the rates are high, the ecoomy teds to slow dow ad borrowers require less fuds. Furthermore, the rates pull back to its equilibrium value ad the rates declie. O the cotrary whe the rates are low, there teds to be high demad for fuds o the part of the borrowers ad rates ted to icrease. Oe ufortuate cosequece of a ormally distributed iterest rate is that it is possible for the iterest rate to become egative. I this article we start from the Euler Maruyaa discretizatio scheme for the Vasicek process ad the sesitivity aalysis, the we preset i detail 3 well kow methods Least squares Method, Maximum Likelihood Method ad the Log Term Quatile Method for calibratig the model's parameter to a data set. We also refer the reader to [4] where some of these techiques are applied but usig a dieret scheme. Euler Scheme ad Sesitivity Aalysis The stochastic dieretial equatio SDE for the Orstei-Uhlebeck process is give by dr t λ µ r t dt + σdw t. with λ the mea reversio rate, µ the mea, ad σ the volatility. The solutio of the model is ˆt r t r 0 exp λt + µ exp λt + σ 0 exp λt dw t. Here the iterest rates are ormally distributed ad the expectatio ad variace are give by
ad E o [r t ] r 0 exp λt + µ exp λt.3 V ar [r t ] σ exp λt.4 λ as t, the limit of expected rate ad variace, will coverge to µ ad σ λ respectively. The Euler Maruyaa Scheme for this models is r t+δt r t + λ µ r t δt + σ δtn 0,.5 the process ca go egative with probability P r t+δt 0 P r t + λ µ r t δt + σ δtn 0, 0 rt + λ µ r t δt P N 0, σ δt Φ r t + λ µ r t δt σ δt Some of the parameters play a big role i the pricig of a acial derivatives o the forecastig of a process, while some of them do ot aect them so much. Therefore, depedig o what we wat to price or forecast, it is importat to check the sesitivity of the models with respect to dieret parameters. The correspodig sesitivity aalysis is performed as preseted i [6]. Lets cosider a two outcomes of a process which dier exclusively i a perturbatio of oe of the parameters but they have the same stochastic realizatio N 0,, the for λ we have that so.6.7.8 r t+δt r t + [λ + λ] µ r t δt + σ δtn 0,.9 r t+δt r t+δt λ µ r t δt.0 whe λ is icreased the variace.4 decreases. So, the chage i the reversio coeciet will ot aect the short rate.3 i log term, just eect the time which is ecessary for the iterest rate to come back to the log term mea. Therefore, λ is importat i the pricig of the acial istrumets which are aected by the volatility.4, but are ot depedet o the log term expected value.3 of the simulated iterest rate. For µ is performed as so for σ is performed as r t+δt r t + λ [µ + µ] r t δt + σ δtn 0,. r t+δt r t+δt λ µ r t δt. so r t+δt r t + λ µ r t δt + [σ + σ] δtn 0,.3 r t+δt r t+δt σ δtn 0,.4 Because of the stadard Browia motio, i the log term, the eect of the chage i σ does ot aect the expected value of the iterest rate.3, but it icreases the variace.4. %% Euler Scheme Vasicek clc clear a l l close a l l %% Set t h e seed at 3
0.9 Vasicek Process 0.8 0.7 Iterest rate 0.6 0.5 0.4 0.3 0. 0. 0 0 40 60 80 00 time Figure.: Vasicek Process rg 3 %% Parameters o f t h e Model lambda 0.3;% Revertio c o e f f i c i e t N3; % Number o f s i m u l a t i o s mu0.7; % Log term Mea sigma 0.05; % V o l a t i l i t y delta_t ; % Time s t e p T00; % Time l e g h t c o l o r [ ' b ', ' r ', 'm' ] ; % c o l o r T. / delta_t ;% Number o f time s t e p s j ; %% Simulatig Vasicek Euler Scheme S0 0.; % S t a r t i g p o i t i ; SS0 ; % S t a r t i g p o i t while i<+ S i S i + lambda. mu S i delta_t + sigma. sqrt delta_t. rad ; ii +; ed Least Squares Calibratio The idea of least squares is that we choose parameter estimates that miimize the average squared dierece betwee observed ad predicted values. That is, we maximize the t of the model to the data by choosig the model that is closest, o average, to the data. Rewritig.5 we have r t+δt r t λδt + λµδt + σ δtn 0,. The relatioship betwee cosecutive observatios r t+δt ad r t is liear with a iid ormal radom term ɛ or where r t+δt ar t + b + ɛ. [r t+δt ] [ r t ] [ a b ] + ɛ.3 a λδt.4 3
Least Squares Fittig 0.9 0.8 0.7 + 0.6 0.5 0.4 0.3 0. 0. 0.4 0.5 0.6 0.7 0.8 0.9 Figure.: Least Squares Fittig b λµδt.5 ɛ σ δtn 0,.6 where usig a least squares ttig as described i the Appedix. + + â.7 ri ad ˆb + so we ca estimate the model's parameters as a.8 λ a δt µ b a σ V ar ɛ δt we refer the reader to the Appedix 4 where the derivatio ad the implemeted code is preseted..9.0. 3 Maximum Likelihood Calibratio I maximum likelihood estimatio, we search over all possible sets of parameter values for a specied model to d the set of values for which the observed sample was most likely. That is, we d the set of parameter values that, give a model, were most likely to have give us the data that we have i had. The distributio of r t+δt i the Euler scheme is give by so the log-likelihood f r t+δt r t, µ, λ, σ πσ δt exp [r t+δt r t + λ µ r t δt] σ δt 3. L l f, µ, λ, σ l f, µ, λ, σ 3. 4
Radom Noise 0. 0.08 0.06 0.04 Noise 0.0 0 0.0 0.04 0.06 0.08 Time Figure 3.: Noise Box Plot obtaiig [ ] l πσ δt exp [ + λ µ δt] 3.3 σ δt [ ] l πσ δt [ ] l πσ δt [r i + λ µ δt] σ δt [ + λ µ δt] σ δt 3.4 3.5 L l [ πσ δt ] [ + λ µ δt] σ δt 3.6 usig the procedure described i the Appedix 4 the parameters are estimated givig ˆµ [ ] ri λδt λδt 3.7 λ δt µ 3.8 µ σ [ + λ µ δt] δt 3.9 we refer the reader to the Appedix 4 where the derivatio ad the implemeted code is preseted. % Y B.X B Noise de_trededy B. X B figure 5 h i s t f i t de_treded, 3 figure 6 probplot ' ormal ', de_treded grid o 5
Probability plot for Normal distributio 0.995 0.99 0.95 0.9 Probability 0.75 0.5 0.5 0. 0.05 0.0 0.005 0. 0.05 0 0.05 0. Data 4 Log Term Quatile Method Figure 3.: Normal Plot The major assumptio i this model is that the quatiles from the historical data are represetative for quatiles i the future. Therefore, a 95% codece iterval is take from the historical data ad the parameters i the short iterest rate model are chose such that i 95% of the cases the geerated iterest rates will fall withi the codece iterval take from the historical data. r t N r 0 exp λt + µ exp λt, σ exp λt 4. λ The dierece betwee the log term stadard deviatio ad the deviatio at t is σ σ σ exp λt λ λ usig Taylor expasio for exp λt σ σ λ [ + ] exp λt so σ σ exp λt 4.4 the dierece betwee the log term mea ad the mea at t is so 4. 4.3 µ r 0 µ exp λt 4.5 µ µ r0 µ exp λt 4.6 The codece iterval is the oe such that P µ.96 σ lim r t µ +.96 σ 0.95 4.7 λ t λ callig q 0.95 µ +.96 σ 4.8 λ ad q 0.05 µ.96 σ 4.9 λ 6
we ca obtai the parameters as ad µ q 0.95 + q 0.05 4.0 σ.96 λ q 0.95 q 0.05 4. %% Motecarlo Simulatio j ; while j <0000 SS0 ; % S t a r t i g p o i t while i<+ S i S i + lambda. mu S i delta_t + sigma. sqrt delta_t. rad ; ii +; ed MC j ST ; jj +; ed figure 9 hh i s t f i t MC, t i t l e ' D i s t b u t i o o f the Vasicek p r o c e s s by Motecarlo Simulatio ' grid o the error associated with λ is l λ l.96 + l σ l x y 4. usig partial dieretiatio we have that the maximum percetual error for a detailed discussio o errors aalysis see [, ] is give by λ λ σ σ + q 0.95 + q 0.05 q 0.95 q 0.05 4.3 zq u a t i l e MC, 0. 9 5 yq u a t i l e MC, 0. 0 5 % Mu z+y. / % Lambda. 9 6. sigma / z y. ^ 7
500 Distributio of the Vasicek process by Motecarlo Simulatio 000 500 000 500 0 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 Figure 4.: Motecarlo Histogram Appedix Least Squares Fittig The residuals for the model are give by This method miimizes the sum of squared residuals, which is give by S Ri ; + + R i + a + b 4.4 a + b + a + b 4.5 The least squares estimators for the parameters ca the be foud by dieretiatig S with respect to these parameters ad settig these derivatives equal to zero. For b we have that For a we have that S b a + b + 4.6 a + b + 4.7 b + a 4.8 isolatig the usig 4.8 we have S a ari + a + b + 4.9 a + b + 4.0 ari + b + 4. + a + 4. 8
is equal to groupig ally ari a [ a ri a + ] + + + ri + + 4.3 + 4.4 4.5 %% C a l i b r a t i o usig Least Squares r e g r e s s i o % P l o t S_i vs S_i figure 3 Y S : ed ;% removig f i r s t p o i t XS : ed ;% removig t h e l a s t p o i t plot Y,X, '. ' l s l i e % l e a s t s q u a r e s l i e ylabel ' r_i+ ' xlabel ' r_i ' t i t l e ' Least Squares F i t t i g ' grid o %Rewrite t h e o f f s e t term o f f s e toes size S,,; ew_x[x', o f f s e t ] ; B ew_x\y' % S o l v e s i t h e Least Squares sese est_lambda B. / delta_t est_mu B./ B Maximum Likelihood Fittig A Estimator for µ A Estimator for L µ [ + λ µ δt] λµδt σ δt 4.6 [ λδt + λµδt] λµ σ 0 4.7 [ λδt + λµδt] 0 4.8 λµδt [ λδt] 4.9 ˆµ [ ] ri λδt λδt 4.30 9
A estimator for σ L λ [ + λ µ δt] µ δt σ δt 4.3 [ + λ µ δt] µ 4.3 σ [ ] µ λ µ δt σ 0 4.33 µ λ µ δt 4.34 λ δt µ 4.35 µ L σ 4πσ δt 4πσδt σ + σ σ [r i + λ µ δt] σ 3 δt 4.36 [ + λ µ δt] σ 3 0 4.37 δt [ + λ µ δt] σ 3 δt [ + λ µ δt] δt %% C a l i b r a t i o usig Maximum L i k e l i h o o d Estimators legth S ; Sx sum S : ed ; Sy sum S : ed ; Sxx sum S : ed.^ ; Sxy sum S : ed. S : ed ; Syy sum S : ed.^ ; 4.38 4.39 mu Sy Sxx Sx Sxy / Sxx Sxy Sx^ Sx Sy ; lambda Sxy mu Sx mu Sy + mu^ / Sxx mu Sx + mu^ / delta_t ; a lambda delta_t ; sigmah Syy a Sxy + a^ Sxx mu a Sy a Sx + mu^ a ^/ ; sigma sqrt sigmah lambda/ a ^ ; ed Ackowledgemets This work has bee doe uder the collaboratio of Ayli Chakaroglu, MSc. Societé Geeral RISQ/- MAR/RIM team who we wish to thak for the help i the revisio of this report. 0
Refereces [] Philip R Bevigto ad D Keith Robiso. Data reductio ad error aalysis. McGraw-Hill, 003. [] William Lichte. Data ad error aalysis i the itroductory physics laboratory. Ally & Baco, 988. [3] George E Uhlebeck ad Leoard S Orstei. O the theory of the browia motio. Physical review, 365:83, 930. [4] Emile Va Ele. Term structure forecastig, 00. [5] Oldrich Vasicek. A equilibrium characterizatio of the term structure. Joural of acial ecoomics, 5:7788, 977. [6] S Zeytu ad A Gupta. A Comparative Study of the Vasicek ad the CIR Model of the Short Rate. ITWM Kaiserslauter, Germay, 007.