SERVING THE QUANTITATIVE FINANCE COMMUNITY

 
User avatar
DoubleTrouble
Topic Author
Posts: 83
Joined: November 9th, 2010, 9:46 pm

Hull & White [$]\vartheta[$] and numerical differentiation

December 14th, 2014, 6:49 pm

Hi,I'm trying to implement a Finite Difference solver for the Hull & White extended Vasicek model (following the notation of Brigo & Mercurio):[$]dr(t) = \left[ \vartheta(t) - a r(t) \right]dt + \sigma dW(t)[$]where [$]\vartheta[$] is chosen to be (in order to get a perfect fit of the yield curve)[$]\vartheta(t) = \frac{\partial f^M(0,t)}{\partial T} + af^M(0,t) + \frac{\sigma^2}{2a} \left(1-e^{-2 a t} \right) [$]where[$]f^M(0,T) = -\frac{\partial \ln(P^M(0,T))}{\partial T}[$]and [$]P^M(0,T)[$] denotes the market discount factor for the maturity [$]T[$].My problem is that given the following (fabricated) data for P^M at some time points (in years)P = [1, 0.99683,0.99408,0.99117,0.98188,0.96138,0.91579,0.86967,0.82420,0.77997,0.73713,0.69553,0.65629,0.61896,0.58383,0.55039]T = [0, 1/12,2/12,3/12,0.5,1,2,3,4,5,6,7,8,9,10,11]which I have to numerically differentiate once and twice in order to get [$]\vartheta[$]. I know that this is an ill-posed problem and that numerical differentiation is sort of a "noise amplifier". All (elementary) methods I have tried so far renders a [$]\vartheta[$] that suffers from severe oscillations in the early time points which disturbs the FD solution quite a lot!Is there some kind of industry standard for how to deal with this?Thanks in advance!
Last edited by DoubleTrouble on December 13th, 2014, 11:00 pm, edited 1 time in total.
 
User avatar
bearish
Posts: 5995
Joined: February 3rd, 2011, 2:19 pm

Hull & White [$]\vartheta[$] and numerical differentiation

December 14th, 2014, 11:03 pm

A general principle that works particularly well for simple Gaussian models (but is always worth considering) is to focus on the solution of the SDE rather than the SDE itself and to focus on zero coupon bond prices rather than short rates and/or forward rates. In this particular model, we know that the live (i.e. non-matured) zero coupon bond prices at each point in time will be lognormally distributed with a given mean function and a given covariance structure. Taking this as your starting point, you can avoid most of the troubles you describe, although you still have some interpolation to do. If you can work out the solution for the bond prices, you can always differentiate it to get forward rates and other such quantities.
 
User avatar
Cuchulainn
Posts: 63379
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Hull & White [$]\vartheta[$] and numerical differentiation

December 15th, 2014, 8:43 am

Artur Sepp has written something on this (a topic that I think bearish is referring to)Numerical Implementation ofHull-White Interest Rate Model:Hull-White Tree vs Finite DifferencesArtur SeppThere are anyways two nasty issues that cannot be swept under the carpet;1. Approximating derivatives by divided differences.2. Interpolating 'clumpy' date by polynomials. (which does not work).// Maybe rational or exponential interpolation is better here?(?)
Last edited by Cuchulainn on December 14th, 2014, 11:00 pm, edited 1 time in total.
My C++ Boost code gives
262537412640768743.999999999999250072597198185688879353856337336990862707537410378210647910118607313

http://www.datasimfinancial.com
http://www.datasim.nl
 
User avatar
spursfan
Posts: 893
Joined: October 7th, 2001, 3:43 pm

Hull & White [$]\vartheta[$] and numerical differentiation

December 15th, 2014, 9:07 am

Though it doesn't use FD, Grant and Vora show how to get an exact match for the term-structurehttp://janroman.dhis.org/finance/Hull%20&%20White/analytical-approximation-hull-and-white.pdf
 
User avatar
Engy
Posts: 34
Joined: February 21st, 2005, 9:19 pm

Hull & White [$]\vartheta[$] and numerical differentiation

December 16th, 2014, 12:16 pm

QuoteOriginally posted by: CuchulainnArtur Sepp has written something on this (a topic that I think bearish is referring to)Numerical Implementation ofHull-White Interest Rate Model:Hull-White Tree vs Finite DifferencesArtur SeppThere are anyways two nasty issues that cannot be swept under the carpet;1. Approximating derivatives by divided differences.2. Interpolating 'clumpy' date by polynomials. (which does not work).// Maybe rational or exponential interpolation is better here?(?)Here is the linkhttp://math.ut.ee/~spartak/papers/hwtree.pdf
 
User avatar
AlexEro
Posts: 203
Joined: November 25th, 2014, 4:27 pm
Location: Ukraine
Contact:

Hull & White [$]\vartheta[$] and numerical differentiation

December 17th, 2014, 4:07 am

Several "industrial engineering" methods of numerical differentiation are described here:"Smooth noise-robust differentiators"holoborodko pavel smooth low noise differentiators
Last edited by AlexEro on December 17th, 2014, 11:00 pm, edited 1 time in total.
 
User avatar
berndL
Posts: 171
Joined: August 22nd, 2007, 3:46 pm

Hull & White [$]\vartheta[$] and numerical differentiation

December 17th, 2014, 8:21 am

Hi Double Trouble,maybe you want to look at Pat Hagans "Evaluating And Hedging Exotic Swap Instruments via LGM". At Page 11 there is a comparison to the hull white model. He mentioned that the hull white formulation (requiering taking a second derivative) is noisy. He contrasted this with the LGM Formulation where the parameters can be read of the calibration instruments more directly.Unfortunatly i dont have the linke to the document any more.
 
User avatar
DoubleTrouble
Topic Author
Posts: 83
Joined: November 9th, 2010, 9:46 pm

Hull & White [$]\vartheta[$] and numerical differentiation

December 17th, 2014, 9:16 pm

QuoteOriginally posted by: EngyQuoteOriginally posted by: CuchulainnArtur Sepp has written something on this (a topic that I think bearish is referring to)Numerical Implementation ofHull-White Interest Rate Model:Hull-White Tree vs Finite DifferencesArtur SeppThere are anyways two nasty issues that cannot be swept under the carpet;1. Approximating derivatives by divided differences.2. Interpolating 'clumpy' date by polynomials. (which does not work).// Maybe rational or exponential interpolation is better here?(?)Here is the linkhttp://math.ut.ee/~spartak/papers/hwtree.pdfThanks for answering my question. However, I don't think Sepp proposes a solution but instead he's satisfied with the cubic spline interpolation even though it give rise to some oscillation. I have already tried this and the noise in the beginning <1Y is too much to get an accurate exlicit euler FD solution.I tried using Shape Language Modeling in Matlab which I must say was big success: http://se.mathworks.com/matlabcentral/f ... -modelingI get an incredibly smooth [$]\vartheta[$] using this!
 
User avatar
DoubleTrouble
Topic Author
Posts: 83
Joined: November 9th, 2010, 9:46 pm

Hull & White [$]\vartheta[$] and numerical differentiation

December 17th, 2014, 9:17 pm

QuoteOriginally posted by: AlexEroSeveral "industrial engineering" methods of numerical differentiation are described here:"Smooth noise-robust differentiators"http://www.holoborodko.com/pavel/numeri ... ators/That page looks very promising, I will have a read! Thank you!
 
User avatar
DoubleTrouble
Topic Author
Posts: 83
Joined: November 9th, 2010, 9:46 pm

Hull & White [$]\vartheta[$] and numerical differentiation

December 17th, 2014, 9:29 pm

QuoteOriginally posted by: bearishA general principle that works particularly well for simple Gaussian models (but is always worth considering) is to focus on the solution of the SDE rather than the SDE itself and to focus on zero coupon bond prices rather than short rates and/or forward rates. In this particular model, we know that the live (i.e. non-matured) zero coupon bond prices at each point in time will be lognormally distributed with a given mean function and a given covariance structure. Taking this as your starting point, you can avoid most of the troubles you describe, although you still have some interpolation to do. If you can work out the solution for the bond prices, you can always differentiate it to get forward rates and other such quantities.Thanks bearish! Just to make sure that I understand you correctly. Are you suggesting that I take the formula for the zero-coupon bond (I know it in the extended Vasicek model) and differentiate it once and twice to that I get an analytical formula for [$]\vartheta[$]. I guess that seems doable!
Last edited by DoubleTrouble on December 16th, 2014, 11:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Posts: 63379
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Hull & White [$]\vartheta[$] and numerical differentiation

December 18th, 2014, 1:07 pm

QuoteAll (elementary) methods I have tried so far renders a ϑ that suffers from severe oscillations in the early time points which disturbs the FD solution quite a lot!fair enough.So, cubic splines as well it seems now.
My C++ Boost code gives
262537412640768743.999999999999250072597198185688879353856337336990862707537410378210647910118607313

http://www.datasimfinancial.com
http://www.datasim.nl
ABOUT WILMOTT

PW by JB

Wilmott.com has been "Serving the Quantitative Finance Community" since 2001. Continued...


Twitter LinkedIn Instagram

JOBS BOARD

JOBS BOARD

Looking for a quant job, risk, algo trading,...? Browse jobs here...


GZIP: On