Working with the Cox-Ingersoll-Ross Modelrolf/teaching/ctff03/cir.pdf · May 2, 2003 Rolf Poulsen...

4
May 2, 2003 Rolf Poulsen AMS, IMF, KU [email protected] Working with the Cox-Ingersoll-Ross Model In this project we take a closer look at the Cox-Ingersoll-Ross (CIR) model given by the stochastic differential equation (SDE) dr(t)= κ(θ - r(t))dt + σ p r(t)dW (t). Modelling the short rate by such a process was suggested in Cox, Ingersoll & Ross (1985b). This was done to illustrate the workings of a general equilibrium model suggested by the same authors in Cox, Ingersoll & Ross (1985a). The general equilibrium model draws heavily on stochastic optimal control theory. Therefore the questions do not refer directly to the original articles. Moments Show that E(r(t)) = r(0)e -κt + θ(1 - e -κt )= m(r(0); t). Hint: Write the SDE on integral form, take mean & observe that what you have is just a linear ordinary differential equation (ODE). See example 3.13 in Bj¨ ork (1998). Show that Var(r(t)) = r(0) σ 2 κ (e -κt - e -2κt )+ θ σ 2 2κ (1 - e -κt ) 2 := v (r(0),t). Hint: Use the same technique as above on r(t) 2 . Use the solution too. Arrive at an ODE for the variance. Compare (numbers, graphs) the (true) moments to the Euler-type approxima- tions E(r(t)) r(0) + (θ - r(0)) and Var(r(t)) 2 r(0). The (extremely) energetic student continues this processes to find 3., 4. etc. order moments. Because r is a time-homogeneous Markov process conditional moments are given by m(r(s),t - s) and v (r(s),t - s). Estimation 1

Transcript of Working with the Cox-Ingersoll-Ross Modelrolf/teaching/ctff03/cir.pdf · May 2, 2003 Rolf Poulsen...

Page 1: Working with the Cox-Ingersoll-Ross Modelrolf/teaching/ctff03/cir.pdf · May 2, 2003 Rolf Poulsen AMS, IMF, KU rolf@math.ku.dk Working with the Cox-Ingersoll-Ross Model In this project

May 2, 2003Rolf PoulsenAMS, IMF, [email protected]

Working with the Cox-Ingersoll-Ross Model

In this project we take a closer look at the Cox-Ingersoll-Ross (CIR) modelgiven by the stochastic differential equation (SDE)

dr(t) = κ(θ − r(t))dt+ σ√

r(t)dW (t).

Modelling the short rate by such a process was suggested in Cox, Ingersoll &Ross (1985b). This was done to illustrate the workings of a general equilibriummodel suggested by the same authors in Cox, Ingersoll & Ross (1985a). Thegeneral equilibrium model draws heavily on stochastic optimal control theory.Therefore the questions do not refer directly to the original articles.

MomentsShow that

E(r(t)) = r(0)e−κt + θ(1 − e−κt) = m(r(0); t).

Hint: Write the SDE on integral form, take mean & observe that what youhave is just a linear ordinary differential equation (ODE). See example 3.13 inBjork (1998).

Show that

Var(r(t)) = r(0)σ2

κ(e−κt − e−2κt) + θ

σ2

2κ(1 − e−κt)2 := v(r(0), t).

Hint: Use the same technique as above on r(t)2. Use the solution too. Arriveat an ODE for the variance.

Compare (numbers, graphs) the (true) moments to the Euler-type approxima-tions

E(r(t)) ≈ r(0) + tκ(θ − r(0)) and Var(r(t)) ≈ tσ2r(0).

The (extremely) energetic student continues this processes to find 3., 4. etc.order moments.Because r is a time-homogeneous Markov process conditional moments aregiven by m(r(s), t− s) and v(r(s), t− s).

Estimation

1

Page 2: Working with the Cox-Ingersoll-Ross Modelrolf/teaching/ctff03/cir.pdf · May 2, 2003 Rolf Poulsen AMS, IMF, KU rolf@math.ku.dk Working with the Cox-Ingersoll-Ross Model In this project

Suppose we have equidistant observations (∆ apart) observations r0, r1, . . . , rn,where we write r∆i simply as ri.

The transition densities in the CIR model are not Gaussian. But if we havetime-points (say s and t) that are not too far apart it is natural to approximatethe distribution of r(t) by a normal distribution with mean m(r(s), t− s) andvariance v(r(s), t− s).It is then tempting to use the Gaussian (log)likelihood function

ln(ψ) =n

i=1

lnφ(ri;m(ri−1,∆ | ψ), v(ri−1,∆ | ψ),

where φ(y;m, v) = exp(−(y−m)2/(2v))/√

2πv denotes the mean-m, variance-v normal density, and the dependence on the unknown parameter, ψ = (θ, κ, σ),has been made notationally explicit.Write a program that calculates this function (given data and parameters).When we say “use the likelihood” we mean “use as estimator the parameter-value that maximizes it”. Get hold of some data. These can either be “reallife interest rates” or simulated data from the CIR process. For this you mayneed to look in Chapter 3 in Seydel (2002); be sure to make the scheme-discretization-stepsize considerably smaller than the time between observa-tions. Plug these into the Gaussian likelihood function. Estimate by max-imizing numerically. In R this can be done with the command optimize.

Consistency & the Gaussian ApproximationOne could be worried that the Gaussian approximation is bad (when is ∆small?) and the estimators are inconsistent. The last not true. Irrespectiveof the value of ∆, the estimator is consistent (ie. it converges to the trueparameter when the no. observations grows). You can take an importantstep in proving this by showing that the Gaussian likelihood function is amartingale, i.e.

En(ln+1(ψ)) = ln(ψ).

This ensures consistency; see Bibby & Sørensen (1995) for instance.The difference between the true CIR-density and the Gaussian density can beinvestigated by noting that transition densities solve parabolic partial differen-tial equations (PDEs); see the so-called Kolmogorov equations in Propositions4.10 and 4.12 in Bjork (1998). These are the kind of PDEs that we have grownaccustomed to solving in this course (Project 2, more specifically). Solve nu-merically for the CIR-density & compare. There are details in Section 3.2 ofPoulsen (1999).

2

Page 3: Working with the Cox-Ingersoll-Ross Modelrolf/teaching/ctff03/cir.pdf · May 2, 2003 Rolf Poulsen AMS, IMF, KU rolf@math.ku.dk Working with the Cox-Ingersoll-Ross Model In this project

Specification Test; CIR vs. VasicekLet F (·; x) denote the distribution function of r∆ given r0 = x. Put ui =F (ri; ri−1). These are called generalized residuals. Show that ui’s are uni-formly distributed on [0, 1] and independent. This can be used to create“goodness-of-fit”-tests. Get hold of some data. Estimate the CIR model. Es-timate the Vasicek model. Calculate generalized residuals for the two models.(Use the approximate Gaussian likelihood function; plug in estimates insteadof unknown true parameters whenever you need to). Compare residuals toU(0; 1)-variables. (Moments, autocorrelation, Q/Q-plots, maybe you’ve heardof Kolmogorov/Smirnov tests, . . .)The approach above is one way to compare CIR to Vasicek. But we would likea more direct way, ie. a general model that has as different special cases theCIR and Vasicek model. Such a model is given by the so-called CKLS (afterChan, Karolyi, Longstaff & Sanders (1992)) specification:

dr(t) = κ(θ − r(t))dt+ σr(t)γdW (t),

where the unknown parameter is now ψ = (θ, κ, σ, γ). Unfortunately, transi-tion densities or moments are not known for general γ, so consistent inferenceis difficult. But to get the show on the road we can use the Euler-type momentapproximations

E(r(t))) ≈ r(0) + tκ(θ − r(0)) and Var(r(t)) ≈ tσ2r(0)2γ

in conjunction with the Gaussian likelihood. Try to estimate the CKLS-specification on some real data. What is the γ-estimate?

(Small Sample) Behaviour of EstimatorsSimulate CIR data; say n observations ∆ apart. Find estimators. RepeatM times (for instance 100 or 500). How do estimators behave? Are theyunbiased? Try different n’s and ∆’s.

The Bond Price FormulaVerify the ZCB price formula for the CIR model given in Proposition 17.6in Bjork (1998) (and on page 58 in the Brigo & Mercurio hand-out.) Whatassumption is made about risk-premia?The verification can be done by “brute force” by differentiating and seeingthat the A and B functions solve their respective ODEs (Proposition 17.2 inBjork (1998)). However, the calculations get very messy. But afterward youcan walk around the finance community with a smug expression on your face.A more constructive hint is the following:The ODE for B reads

dB

dt= aB2 − bB − 1 = (B − c1)(B − c2)

3

Page 4: Working with the Cox-Ingersoll-Ross Modelrolf/teaching/ctff03/cir.pdf · May 2, 2003 Rolf Poulsen AMS, IMF, KU rolf@math.ku.dk Working with the Cox-Ingersoll-Ross Model In this project

for some appropriate constants (it’s your job to find them). This ODE is of aform you can use separation of variables on. Consult the differential equationsection of your 1. year math-book. The message is that you have to look at

dB

(B − c1)(B − c2)+ c =

dt,

where you “forget” that B is a function in the LHS integral. Any table willtell you that the LHS integral is

ln(B − c2)

c2 − c1+

ln(B − c1)

c1 − c2.

The RHS is just t. Determine the constant of integration, c, and solve for Bin terms of t.

References

Bibby, B. M. & Sørensen, M. (1995), ‘Martingale estimating functions fordiscretely observed diffusion processes’, Bernoulli 1, 17–39.

Bjork, T. (1998), Arbitrage Theory in Continuous Time, Oxford.

Chan, K. C., Karolyi, G. A., Longstaff, F. A. & Sanders, A. B. (1992), ‘AnEmpirical Comparison of Alternative Models of the Short-Term Interestrate’, Journal of Finance 47, 1209–1227.

Cox, J. C., Ingersoll, J. E. & Ross, S. A. (1985a), ‘A Theory of the TermStructure of Interest Rates’, Econometrica 53, 385–407.

Cox, J. C., Ingersoll, J. E. & Ross, S. A. (1985b), ‘An intertemporal generalequilibrium model of asset prices’, Econometrica 53, 363–384.

Poulsen, R. (1999), Approximate Maximum Likelihood Estimation of Dis-cretely Observed Diffusion Processes. Working paper no. 29, Centre forAnalytical Finance, University of Aarhus.

Seydel, R. (2002), Tools for Computational Finance, Springer.

4