Skip to content

Commit

Permalink
issue #102: adding more maths for HW calibration
Browse files Browse the repository at this point in the history
  • Loading branch information
ccjeremylo committed Nov 22, 2023
1 parent acd28a2 commit abe9a3c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/python/Lecture6/hull_white_model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -189,18 +189,18 @@
"& \\;\\;\\;\\;\\;\\;\\; + \\underbrace{\\frac{1}{2} \\int_t^T \\sigma^2(u) \\, G^2(u,T) \\, du + G(t,T) \\int_0^t \\sigma^2(u) \\, G(u,t) \\, \\partial_t G(u,t) \\, du + \\frac{1}{2} G^2(t,T) \\int_0^t \\sigma^2(u) \\, \\partial_t G^2(u,t) \\, du}_{\\text{from ($\\color{blue}{\\text{B}}$)}} \\\\\n",
"&= -f(0,t) G(t,T) \n",
"+ r_0 \\big(G(0,T) - G(0,t)\\big)\n",
"-\\underbrace{\\int_t^T \\tilde{\\theta}(u) G(u,T) \\, du}_{\\text{what we want}}\n",
"+ \\frac{1}{2} \\int_t^T \\sigma^2(u) \\, G^2(u,T) \\, du\n",
"-\\underbrace{\\int_t^T \\tilde{\\theta}(u) G(u,T) \\, du}_{\\text{what we want}} \\\\\n",
"& \\;\\;\\;\\;\\;\\; + \\frac{1}{2} \\int_t^T \\sigma^2(u) \\, G^2(u,T) \\, du\n",
"+ \\frac{1}{2} G^2(t,T) \\int_0^t \\sigma^2(u) \\, \\partial_t G^2(u,t) \\, du\n",
"\\end{align}\n",
"Rearranging, we now have an analytical expression of the integral $\\int_t^T \\tilde{\\theta}(u) G(u,T) \\, du$ in terms of day-0 market quantities:\n",
"\\begin{align}\n",
"\\implies\n",
"\\underbrace{\\int_t^T \\tilde{\\theta}(u) G(u,T) \\, du}_{\\text{what we want}}\n",
"= -\\ln \\frac{B(0,T)}{B(0,t)}\n",
"&= -\\ln \\frac{B(0,T)}{B(0,t)}\n",
"-f(0,t) G(t,T) \n",
"+ r_0 \\big(G(0,T) - G(0,t)\\big)\n",
"+ \\frac{1}{2} \\int_t^T \\sigma^2(u) \\, G^2(u,T) \\, du\n",
"+ r_0 \\big(G(0,T) - G(0,t)\\big) \\\\\n",
"& \\;\\;\\;\\;\\;\\;\\; + \\frac{1}{2} \\int_t^T \\sigma^2(u) \\, G^2(u,T) \\, du\n",
"+ \\frac{1}{2} G^2(t,T) \\int_0^t \\sigma^2(u) \\, \\partial_t G^2(u,t) \\, du \n",
"\\end{align}"
]
Expand All @@ -210,9 +210,9 @@
"id": "3aac081d-5c31-456b-8749-b5a03f22efa7",
"metadata": {},
"source": [
"Putting everything back into our HW ZCB equation:\n",
"Substituting the integral back into our HW ZCB equation:\n",
"\\begin{align}\n",
"B(t,T) = \\exp \\bigg( -r_t \\, G(t,T) - \\int_t^T \\tilde{\\theta}(u) \\, G(u,T) \\, du + \\frac{1}{2} \\int_t^T \\sigma^2(u) \\, G^2(u,T) \\, du \\bigg)\n",
"B(t,T) = \\exp \\bigg( -r_t \\, G(t,T) - \\underbrace{\\int_t^T \\tilde{\\theta}(u) \\, G(u,T) \\, du}_{\\text{substitude here}} + \\frac{1}{2} \\int_t^T \\sigma^2(u) \\, G^2(u,T) \\, du \\bigg)\n",
"\\end{align}\n",
"We now have\n",
"\\begin{align}\n",
Expand Down

0 comments on commit abe9a3c

Please sign in to comment.