{"categories":["Fixed Income"],"contentHtml":"<h2>Calibration</h2>\n<p>We’ll look specifically at Vasicek and CIR. Then we will make some remarks on the Hull-White two factor model, then some more complex model.</p>\n<p>The code for this in a package in R.</p>\n<h3>Vasicek</h3>\n<p>First we will simulate, then look at parameters.</p>\n<p>$$\ndr_t = a(b - r_t) dt + \\sigma dW_t\n$$</p>\n<p>We will use the Euler discretization scheme.</p>\n<p>$$\nr_{t + \\Delta t} - r_t = a(b - r_t) \\Delta + \\epsilon_{t + \\Delta}\n$$</p>\n<p>Then we will make a Binomial tree that uses such discretization.</p>\n<p>where</p>\n<p>$$\n\\epsilon_{t+\\Delta} \\sim N(0, \\sigma^2 \\Delta)\n$$</p>\n<p>Then in general,</p>\n<p>$$\nr_{i\\Delta} = r_{(i - 1)\\Delta} + a(b - r_t) \\Delta + \\epsilon_{t + \\Delta}\n$$</p>\n<h3>Cox-Ingersoll-Ross</h3>\n<p>$$\ndr_t = a(b - r_t) dt + \\sigma \\sqrt{r_t} dW_t\n$$</p>\n<p>Then do the same thing.</p>\n<h3>Two-Factor</h3>\n<p>Then the two factor Vasicek model can be defined with correlated factors.</p>\n<p>There’s a short rate and long rate factor.</p>\n<p>One such method of calibration is the <strong>maximum likelihood estimator</strong> (MLE)</p>\n<p>For Vasicek with real world data, consider</p>\n<p>sample short rates \\(r_0, r_{\\Delta}, r_{2\\Delta}\\),</p>\n<p>for Vasicek \\(f(r_{t+s} |r_t)\\) normal density</p>\n<p>with \\(\\mathbb{E}[r_{t+s}|r_t] = b + (r_t - b)e^{-as}\\)</p>\n<p>and</p>\n<p>$$\n\\mathbb{V}[r_{t+s}|r_t] = \\frac{\\sigma^2}{2a} (1 - e^{-2as})\n$$</p>\n<p>Then the MLE method determines this for the distribution.</p>\n<p>It’s a function of parameters given the</p>\n<p>Typically you take the ln of the likelihood and determine the maximum given the function.</p>\n<p>$$\n\\alpha^{*} = (1 - e^{-2a\\Delta}) b\n$$</p>\n<p>$$\n\\beta^{*} = e^{-a\\Delta}\n$$</p>\n<p>$$\n\\sigma^{*} = \\sqrt{\\tfrac{\\sigma^2}{2a} (1 - e^{-2a\\Delta})}\n$$</p>\n<p>$$\n\\mathbb{E}[r_{i\\Delta} \\mid r_{(i-1)\\Delta}] = \\alpha^{*} + \\beta^{*} r_{(i-1)\\Delta}\n$$</p>\n<p>$$\n\\mathbb{V}[r_{i\\Delta} \\mid r_{(i-1)\\Delta}] = (\\sigma^{*})^2\n$$</p>\n<p>Then we take the natural log of the likelihood for the normal density plugging in these parameters.</p>\n<p>MLE estimates</p>\n<p>$$\na = -\\frac{\\ln(\\hat{\\beta}^{*})}{\\Delta}\n$$</p>\n<p>$$\nb = \\frac{\\hat{a}^{*}}{1 - \\hat{\\beta}^{*}}\n$$</p>\n<h2>Risk-Neutral Calibration</h2>\n<p>Assume that we have ZCB prices/discount factors (same thing).</p>\n<p>The price of a ZCB under the Vasicek model is</p>\n<p>$$\nP(t, T) = e^{A(t, T) - B(t, T) r}\n$$</p>\n<p>where</p>\n<p>$$\nB(t, T) = \\frac{1}{a^{*}} (1 - e^{-a^{*}(T-t)})\n$$</p>\n<p>$$\nA(t, T) = (B(t, T) - (T - t)) (b^{*} - \\frac{\\sigma^2}{2(a^{*})^2}) \\ldots\n$$</p>\n<p>for the calibration, you would want to minimize for n bonds</p>\n<p>$$\n\\sum_{i=1}^n (P_{\\text{Vasicek}} - P_{\\text{market}})^2\n$$</p>\n<p>You might use a nonlinear optimizer.</p>\n<h2>Hull White Two Factor</h2>\n<p>$$\ndr = [\\theta(t) + u  - ar] dt + \\sigma_1 dW_1\n$$</p>\n<p>$$\ndu = -bu + \\sigma^2 dW_2\n$$</p>\n<p>where we have another process u, and two volatilities/brownian motions.</p>\n<p>u in this context is a random mean reversion level.</p>\n<p>The previous model fits the term structure at time 0 and defines such mean reverting level, which is subject to some randomness. We have some historical data for htis.</p>\n<p>You also have ρ the correlation between dW_1 and dW_2, and the rest are constants.</p>\n<p>Spot rate volatility structure for Hull-White two-factor model.</p>\n<p>$$\n\\sigma_R(t, T) = \\frac{1}{T-t} \\sqrt{[B(t, T)^2 \\sigma_1]^2 + [C(t, T)\\sigma_2]^2 + w\\rho\\sigma_1\\sigma_2B(t, T)C(t, T)}\n$$</p>\n<p>Here is an example:</p>\n<p>Price a 5 year zero coupon bond after one year i.e. four years remaining to maturity.</p>\n<p>It has the following parameters:</p>\n<p>t = 1, T = 5, r(1) = 0.05, u(1) = 0.01.</p>\n<p>In order to calculate, all the implementation is in the PDF.</p>\n<p>First calculate</p>\n<p>B(1, 5)</p>\n<p>B(0, 5)</p>\n<p>B(0, 1)</p>\n<p>C(1, 5)</p>\n<p>C(0, 5)</p>\n<p>C(0, 1)</p>\n<p>ln A(1, 5)</p>\n<p>P(1, 5)</p>\n<p>Then you can construct the term structure will fit at time 0, and the evolution of this structure.</p>\n<p>Then in this case, we have an analytical solution for σ = 0.0110</p>\n<p>10 year and 15 year interest rates will have a lot of correlations, you can graph correlations against interest rate times and get the term structure.</p>\n<h2>Limitations of One-Factor or Two-Factor Models</h2>\n<p>Most involve only one factor of uncertainty.</p>\n<p>The models do not give the freedom in choosing the volatility structure.</p>\n<p>Looking at a simple example of rates, we can see that we have different volatilities for maturities, and these tend to be correlated.</p>\n<p>Based on these considerations, we need a more general approach in specifying the volatility environment and allow multiple factors</p>\n<p>This is the HJM Model (Heath Jarrow, and Marton Model)</p>\n<p>In the previous short rate models, we had a single source of randomness, Brownian motion, and the instantaneous correlation between forward rates and maturities is equal to 1.</p>\n<p>We will consider some notation.</p>\n<p>P(t, T) is the price of ZCB of $1 at time t maturing at T.</p>\n<p>Ω will be the vector of past and present values of interest rates and bond prices at time t that are relevant for determining bond price volatility at that time, basically describes the information set.</p>\n<p>Then</p>\n<p>ν(t, T, Ω) this is nu, the volatility of P(t, T)</p>\n<p>The process for P(t, T) looks like</p>\n<p>$$\ndP(t, T) = r(t) P(t, T) dt + \\nu (t, T, \\Omega_t) P(t, T) dW(t)\n$$</p>\n<p>Then we have some characteristics at maturity.</p>\n<p>The forward rate is determined by the derivative with respect to the ln change in ZCB over time.</p>\n<p>The dynamics of the forward curve (ZCB) are only dependent on the volatility.\nThen we can say this is a risk-neutral process for the forward f that depends only on ν.</p>\n<p>Then we have a process for the instantaneous forward dF which is only determined by the volatility structure. So if we have ν, then we have the term structure</p>\n<p>There is a link between the dirft and the standard deviation of the instantaneous forward rate.</p>\n<p>But the extension to several factors with the market is expressed int erms of the instantaneous forward rate, which is not directly observable, and it’s difficult to calibrate. And also the process for the short rate in HJM model is non-Markovian.</p>\n<p>What is the connection between the HJM model and the previous short rate models?</p>\n<p>We look just at the single factor model.</p>\n<p>If you integrate the instantaneous forward rate, this is the actual short rate.</p>\n<p>And generally you can see how the terms depend on each part of the ν expression. That’s why r is non-Markovian, a non-recombining tree.</p>","contentMarkdown":"## Calibration\n\nWe’ll look specifically at Vasicek and CIR. Then we will make some remarks on the Hull-White two factor model, then some more complex model.\n\nThe code for this in a package in R.\n\n### Vasicek\n\nFirst we will simulate, then look at parameters.\n\n$$\ndr_t = a(b - r_t) dt + \\\\sigma dW_t\n$$\n\nWe will use the Euler discretization scheme.\n\n$$\nr_{t + \\\\Delta t} - r_t = a(b - r_t) \\\\Delta + \\\\epsilon_{t + \\\\Delta}\n$$\n\nThen we will make a Binomial tree that uses such discretization.\n\nwhere\n\n$$\n\\\\epsilon_{t+\\\\Delta} \\\\sim N(0, \\\\sigma^2 \\\\Delta)\n$$\n\nThen in general,\n\n$$\nr_{i\\\\Delta} = r_{(i - 1)\\\\Delta} + a(b - r_t) \\\\Delta + \\\\epsilon_{t + \\\\Delta}\n$$\n\n### Cox-Ingersoll-Ross\n\n$$\ndr_t = a(b - r_t) dt + \\\\sigma \\\\sqrt{r_t} dW_t\n$$\n\nThen do the same thing.\n\n### Two-Factor\n\nThen the two factor Vasicek model can be defined with correlated factors.\n\nThere’s a short rate and long rate factor.\n\n\n\nOne such method of calibration is the **maximum likelihood estimator** (MLE)\n\nFor Vasicek with real world data, consider\n\n\n\nsample short rates \\\\(r_0, r_{\\\\Delta}, r_{2\\\\Delta}\\\\),\n\nfor Vasicek \\\\(f(r_{t+s} |r_t)\\\\) normal density\n\nwith \\\\(\\\\mathbb{E}[r_{t+s}|r_t] = b + (r_t - b)e^{-as}\\\\)\n\nand\n\n$$\n\\\\mathbb{V}[r_{t+s}|r_t] = \\\\frac{\\\\sigma^2}{2a} (1 - e^{-2as})\n$$\n\nThen the MLE method determines this for the distribution.\n\nIt’s a function of parameters given the\n\nTypically you take the ln of the likelihood and determine the maximum given the function.\n\n$$\n\\\\alpha^{*} = (1 - e^{-2a\\\\Delta}) b\n$$\n\n$$\n\\\\beta^{*} = e^{-a\\\\Delta}\n$$\n\n$$\n\\\\sigma^{*} = \\\\sqrt{\\\\tfrac{\\\\sigma^2}{2a} (1 - e^{-2a\\\\Delta})}\n$$\n\n$$\n\\\\mathbb{E}[r_{i\\\\Delta} \\\\mid r_{(i-1)\\\\Delta}] = \\\\alpha^{*} + \\\\beta^{*} r_{(i-1)\\\\Delta}\n$$\n\n$$\n\\\\mathbb{V}[r_{i\\\\Delta} \\\\mid r_{(i-1)\\\\Delta}] = (\\\\sigma^{*})^2\n$$\n\nThen we take the natural log of the likelihood for the normal density plugging in these parameters.\n\nMLE estimates\n\n$$\na = -\\\\frac{\\\\ln(\\\\hat{\\\\beta}^{*})}{\\\\Delta}\n$$\n\n$$\nb = \\\\frac{\\\\hat{a}^{*}}{1 - \\\\hat{\\\\beta}^{*}}\n$$\n\n\n\n## Risk-Neutral Calibration\n\nAssume that we have ZCB prices/discount factors (same thing).\n\nThe price of a ZCB under the Vasicek model is\n\n$$\nP(t, T) = e^{A(t, T) - B(t, T) r}\n$$\n\nwhere\n\n$$\nB(t, T) = \\\\frac{1}{a^{*}} (1 - e^{-a^{*}(T-t)})\n$$\n\n$$\nA(t, T) = (B(t, T) - (T - t)) (b^{*} - \\\\frac{\\\\sigma^2}{2(a^{*})^2}) \\\\ldots\n$$\n\nfor the calibration, you would want to minimize for n bonds\n\n$$\n\\\\sum_{i=1}^n (P_{\\\\text{Vasicek}} - P_{\\\\text{market}})^2\n$$\n\nYou might use a nonlinear optimizer.\n\n## Hull White Two Factor\n\n$$\ndr = [\\\\theta(t) + u  - ar] dt + \\\\sigma_1 dW_1\n$$\n\n$$\ndu = -bu + \\\\sigma^2 dW_2\n$$\n\nwhere we have another process u, and two volatilities/brownian motions.\n\nu in this context is a random mean reversion level.\n\nThe previous model fits the term structure at time 0 and defines such mean reverting level, which is subject to some randomness. We have some historical data for htis.\n\nYou also have ρ the correlation between dW\\_1 and dW\\_2, and the rest are constants.\n\n\n\nSpot rate volatility structure for Hull-White two-factor model.\n\n$$\n\\\\sigma_R(t, T) = \\\\frac{1}{T-t} \\\\sqrt{[B(t, T)^2 \\\\sigma_1]^2 + [C(t, T)\\\\sigma_2]^2 + w\\\\rho\\\\sigma_1\\\\sigma_2B(t, T)C(t, T)}\n$$\n\nHere is an example:\n\n\n\nPrice a 5 year zero coupon bond after one year i.e. four years remaining to maturity.\n\nIt has the following parameters:\n\n\n\nt \\= 1, T \\= 5, r(1) \\= 0.05, u(1) \\= 0.01.\n\nIn order to calculate, all the implementation is in the PDF.\n\nFirst calculate\n\nB(1, 5\\)\n\nB(0, 5\\)\n\nB(0, 1\\)\n\nC(1, 5\\)\n\nC(0, 5\\)\n\nC(0, 1\\)\n\nln A(1, 5\\)\n\nP(1, 5\\)\n\nThen you can construct the term structure will fit at time 0, and the evolution of this structure.\n\nThen in this case, we have an analytical solution for σ \\= 0.0110\n\n10 year and 15 year interest rates will have a lot of correlations, you can graph correlations against interest rate times and get the term structure.\n\n## Limitations of One-Factor or Two-Factor Models\n\nMost involve only one factor of uncertainty.\n\nThe models do not give the freedom in choosing the volatility structure.\n\nLooking at a simple example of rates, we can see that we have different volatilities for maturities, and these tend to be correlated.\n\nBased on these considerations, we need a more general approach in specifying the volatility environment and allow multiple factors\n\n\n\nThis is the HJM Model (Heath Jarrow, and Marton Model)\n\nIn the previous short rate models, we had a single source of randomness, Brownian motion, and the instantaneous correlation between forward rates and maturities is equal to 1\\.\n\nWe will consider some notation.\n\nP(t, T) is the price of ZCB of $1 at time t maturing at T.\n\nΩ will be the vector of past and present values of interest rates and bond prices at time t that are relevant for determining bond price volatility at that time, basically describes the information set.\n\nThen\n\nν(t, T, Ω) this is nu, the volatility of P(t, T)\n\n\n\nThe process for P(t, T) looks like\n\n$$\ndP(t, T) = r(t) P(t, T) dt + \\\\nu (t, T, \\\\Omega_t) P(t, T) dW(t)\n$$\n\nThen we have some characteristics at maturity.\n\nThe forward rate is determined by the derivative with respect to the ln change in ZCB over time.\n\n\n\nThe dynamics of the forward curve (ZCB) are only dependent on the volatility.\nThen we can say this is a risk-neutral process for the forward f that depends only on ν.\n\nThen we have a process for the instantaneous forward dF which is only determined by the volatility structure. So if we have ν, then we have the term structure\n\nThere is a link between the dirft and the standard deviation of the instantaneous forward rate.\n\n\n\nBut the extension to several factors with the market is expressed int erms of the instantaneous forward rate, which is not directly observable, and it’s difficult to calibrate. And also the process for the short rate in HJM model is non-Markovian.\n\n\n\nWhat is the connection between the HJM model and the previous short rate models?\n\nWe look just at the single factor model.\n\n\n\nIf you integrate the instantaneous forward rate, this is the actual short rate.\n\nAnd generally you can see how the terms depend on each part of the ν expression. That’s why r is non-Markovian, a non-recombining tree.","dataUrl":"https://sharifhsn.dev/api/posts/advanced-derivatives-week-07.json","date":"2025-03-13","datePublished":"2025-03-13","description":"We’ll look specifically at Vasicek and CIR. Then we will make some remarks on the Hull-White two factor model, then some more complex model.","site":"https://sharifhsn.dev","slug":"advanced-derivatives-week-07","source":"Advanced Derivatives","sourceUrl":null,"tags":["Fixed Income","Calibration","Vasicek","Cox-Ingersoll-Ross","Hull-White","HJM"],"title":"Short-Rate Calibration and HJM","url":"https://sharifhsn.dev/blog/advanced-derivatives-week-07/","version":"1","wordCount":1023}