Serving the Quantitative Finance Community

 
User avatar
MaxwellSheffield
Topic Author
Posts: 29
Joined: December 17th, 2013, 11:08 pm

Forward Dupire PDE/Normal volatility

March 28th, 2018, 8:56 pm

Hello,

I am playing with different local vol models and try to calibrate them using forward Dupire PDE.
Let F denotes a forward rate 
$$dF_t=\sigma(t,F_t)dW_t$$, and c  as $$c(t,K)=E[(F_t-K)^{+}]$$

The Dupire PDE gives :

$$\partial_{t}c(t,k)=\frac{1}{2}\sigma(t,F_t)^2\partial_{kk}c(t,k)$$

If I choose $$\sigma(t,F_t)=60bps$$, and a short maturity : 3months, by solving the pde , I should expect the implied vols of c(0.25,k) for differents strikes k to be 60bps.
I do not know where I am missing something , I cannot get what I expect : That is how I solve the pde :

For a given set of strikes $$\{k_0,...,k_0+n*\delta k\}$$
I have equations : 
$$c(0.25,k_l)-\frac{1}{2}*0.25*(60bps)^2*\frac{c(0.25,k_{l+1})-2c(0.25,k_l)+c(0.25,k_{l-1})}{\delta k^2}=max(F_0-k_l,0)  \\  with 1\leq l \leq n-1$$

I assume $$\partial_{kk}c(t,k_0)=\partial_{kk}c(t,k_n)=0$$

The left and right diagonals are $$\{0,-m,...,-m,0\}$$
the second(middle) diagonal is $$\{1,1+2m,...,1+2m,1\}$$
with $$m= \frac{1}{2 \delta_k^2}*0.25*(60bps)^2$$
Finally, to get the prices, I just use https://en.wikipedia.org/wiki/Tridiagon ... _algorithm

Any clue? thanks
 
User avatar
Cuchulainn
Posts: 20252
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: Forward Dupire PDE/Normal volatility

March 29th, 2018, 1:47 pm

Maybe I am missing something, but I am having difficulty in seeing how to get from PDE to the FD scheme. You are discretising in k(looks fine) but the t part os is not clear (Crank Nicolson??). And right hand side?


Here is our ADE aproach (no matrix inversion needed)

https://www.wilmott.com/wp-content/uplo ... 18_ade.pdf

BTW putting 2nd order derivative BCs at both ends... can you motivate pls? Does it lead to a unique solution?

//
This PhD thesis might also be relevant 

http://www.math.ku.dk/noter/filer/phd16lr.pdf
 
User avatar
MaxwellSheffield
Topic Author
Posts: 29
Joined: December 17th, 2013, 11:08 pm

Re: Forward Dupire PDE/Normal volatility

March 29th, 2018, 2:44 pm

Thanks for the answer. 
I use $$\partial_{t}c(t,k)=\frac{c(0.25,k)-c(0,k)}{0.25}$$ and we have $$c(0,k)=(F_0-k)^{+}$$
I used 0.25 because I felt the above expression would be a good proxy . I am just playing with this example to feel comfortable with this forward PDE Dupire, and eventually use it in my own local vol model . In my test, I used a large set of strikes so it will have less effect on prices around the ATMF,  my assumption is saying that for a very low strike(-10%) and  high strike (10%), the forward rate  density function at maturity is nil.
Furthermore, I just read a paper from Andersen and huge : volatility interpolation where they seem to use this approximation, even in more complex local vol structure(ZABR paper).
 
User avatar
Alan
Posts: 2958
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

Re: Forward Dupire PDE/Normal volatility

March 29th, 2018, 3:07 pm

Your example is trivial to solve exactly. Suggest you do so and compare to your 'fdm'. I'm pretty sure it will be terrible. Then, try Daniel's suggestion (ADE), or any of a zillion other elementary PDE schemes that are easily looked up. Roughly, for the simplest (explicit) schemes, you need multiple time steps, such that [$]\sigma^2 \delta t < C \delta k^2[$], where [$]C = O(1)[$].
Last edited by Alan on March 29th, 2018, 3:30 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Posts: 20252
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: Forward Dupire PDE/Normal volatility

March 29th, 2018, 3:26 pm

I see. You are using fully implicit Euler from t = 0 to t = 0.25 (So, dt = 0.25).
 
User avatar
MaxwellSheffield
Topic Author
Posts: 29
Joined: December 17th, 2013, 11:08 pm

Re: Forward Dupire PDE/Normal volatility

March 29th, 2018, 3:30 pm

@Cuchulainn : exactly Sir.

@Alan : 
What do you mean by solving exactly ? I definitely know the answer as my forward rate model is normally distributed . I did the comparison , and it was terrible. My scheme is similar to the one in Andersen&Huge(2011) unless...I am doing something ridiculously wrong, or Andersen & Huge are that wrong(which I doubt) , in that case I would look for another PDE scheme. 

This is my code : 

Thomas algorithm (Numerical recipes)
dtridag(const std::vector<double> & a, const std::vector<double> & b, const std::vector<double> & c, const std::vector<double>& r, std::vector<double> & u)
{
int j;
int n = a.size();
double bet;
std::vector<double> gam(n);

if (b[0] == 0.0){
return;
}
u[0] = r[0] / (bet = b[0]);
for (j = 1; j < n; j++) {
gam[j] = c[j - 1] / bet;
bet = b[j] - a[j] * gam[j];
if (bet == 0.0){ return; };
u[j] = (r[j] - a[j] * u[j - 1]) / bet;
}
for (j = (n - 2); j >= 0; j--)
u[j] -= gam[j + 1] * u[j + 1];
}
 
int lNumOfStrikes(1000);

 double lStartStrike(-0.05);
 double lEndStrike(0.1);
 
 double lStep((lEndStrike - lStartStrike) / lNumOfStrikes);
 std::vector<double> lStrikes(lNumOfStrikes+1);
 for (int i = 0; i <=lNumOfStrikes; ++i){
 lStrikes[i] = lStartStrike + lStep*i;
 }

std::vector<double> lAlpha(lNumOfStrikes+1,0);
 std::vector<double> lBeta(lNumOfStrikes+1,0);
 std::vector<double> lGamma(lNumOfStrikes+1,0);
 std::vector<double> lB(lNumOfStrikes+1 , 0);
 std::vector<double> lCallPrices(lNumOfStrikes+1 , 0);
double lLocalVolatility = 60e-4;
for (int i = 0; i <= lNumOfStrikes; ++i){

lB[i] = fmax(mFwd - lStrikes[i], 0.0);
if ((i == 0)|(i == lNumOfStrikes)){
lAlpha[i] = 0;
 lBeta[i] = 1;
 lGamma[i] = 0;
 }else{
lAlpha[i ] = -0.5*mMaturity*lLocalVolatility*lLocalVolatility/(lStep*lStep);
 lBeta[i ] = 1 - 2 * lAlpha[i];
 lGamma[i] = lAlpha[i];
}
 }
 dtridag(lAlpha, lBeta, lGamma, lB, lCallPrices);

 
User avatar
Alan
Posts: 2958
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

Re: Forward Dupire PDE/Normal volatility

March 29th, 2018, 3:37 pm

OK, good you've already solved it exactly. The next thing to do is iterate your scheme over multiple small time steps, decreasing the time step size, until you get convergence to that exact solution. After you've done that report back. Likely your basic problem is that your ratio [$]\delta k^2/\sigma^2[$] is *very* small, so you will need a time step on the order of that ratio. I would estimate [$]\delta t < 2 \times 10^{-4}[$] just eyeballing your code.
 
User avatar
Cuchulainn
Posts: 20252
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: Forward Dupire PDE/Normal volatility

March 29th, 2018, 5:52 pm

Maxwell,
I think Alan is referring to (17) and (18) here (FTCS scheme is conditionally stable)

http://www.dima.uniroma1.it/users/lsa_a ... FDheat.pdf

This is super easy to program.

// In the code snippet I cannot see dt(?)
Maybe a bug in the code? 
 
User avatar
MaxwellSheffield
Topic Author
Posts: 29
Joined: December 17th, 2013, 11:08 pm

Re: Forward Dupire PDE/Normal volatility

March 29th, 2018, 6:09 pm

@Cuchulainn, the "dt" is mMaturity, it  was defined somewhere else , and its value is 0.25...

I dont doubt the accuracy of a certain scheme over another. In the past, I could see huge differences between a full explicit Euler scheme versus a Crank nicolson ADI scheme. (I remember you brought up this ADE scheme vs ADI scheme for pricing derivative under an one factor HJM model    if I am not mistaken)
@Alan
If your guess is right( which I feel it is the case), the one-step FDM introduced by Andreasen and Huge 2011 is not good to imply the "right local vol" if it is used to calibrate a local vol model to a discrete set of prices. I am pretty sure any  PDE scheme with enough time steps can give me what I want, but here I focus on the one-step model. True, this model can generate arbitrage-free prices(by definition of the ODE), and consistent with market prices(if my local vol has enough parameters). However , if I use- let say- 10 call prices with strikes going from -1% to 9%, all coming from a Bachelier model with flat vol (50bps), let say that my local vol has 10 parameters( piecewise constant with respect to strike). I calibrate it as follows : I use an optimizer that plays with the 10 parameters , then solve the ODE, get the 10 prices and compare them to the market ones. 
Yes , my new local vol will yield  a nice density function capable of matching my "normal" market, but given the form of my local volatility model , I would expect a constant (50bps ) implied local volatility model. 
One would argue that Andreasen and huge 2011 is actually used for arbitrage free interpolation method(and it works !) , but then I can see the method is also used in ZABR-Expansion for the masses for calibrating a local SABR model...
 
User avatar
MaxwellSheffield
Topic Author
Posts: 29
Joined: December 17th, 2013, 11:08 pm

Re: Forward Dupire PDE/Normal volatility

April 9th, 2018, 1:46 pm

Got my answer, A&H[11] are actually aware of this flaw, that is why they readjust the one-step PDE with Dupide PDE using the Bachelier model for the theta and gamma.