- DoubleTrouble
**Posts:**83**Joined:**

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.

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.

- Cuchulainn
**Posts:**63379**Joined:****Location:**Amsterdam-
**Contact:**

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

262537412640768743.999999999999250072597198185688879353856337336990862707537410378210647910118607313

http://www.datasimfinancial.com

http://www.datasim.nl

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

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

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.

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.

- DoubleTrouble
**Posts:**83**Joined:**

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!

- DoubleTrouble
**Posts:**83**Joined:**

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!

- DoubleTrouble
**Posts:**83**Joined:**

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.

- Cuchulainn
**Posts:**63379**Joined:****Location:**Amsterdam-
**Contact:**

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

262537412640768743.999999999999250072597198185688879353856337336990862707537410378210647910118607313

http://www.datasimfinancial.com

http://www.datasim.nl

GZIP: On