SERVING THE QUANTITATIVE FINANCE COMMUNITY

Cuchulainn
Posts: 59714
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Testing

Here an example of the output when testing a scheme for a 2-factor problem (exchange option). Still experiment with BC but we can now compare different schemes over the whole domain (btw using Excel).

Cuchulainn
Posts: 59714
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Testing

Last edited by Cuchulainn on February 12th, 2012, 11:00 pm, edited 1 time in total.

Cuchulainn
Posts: 59714
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Testing

Spread call, with meshes of size 50, 100, 200.
Last edited by Cuchulainn on February 12th, 2012, 11:00 pm, edited 1 time in total.

Cuchulainn
Posts: 59714
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Testing

Finally, spread call on mesh 400 and 300, respectively400 300
Last edited by Cuchulainn on February 12th, 2012, 11:00 pm, edited 1 time in total.

Cuchulainn
Posts: 59714
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Testing

In the recent past the issue of how to approximate mixed derivatives was an issue (Numerical::CFD thread ). There are several options whose relative merits we want to analyse. Here is Janenko for rho = -0.99 and T = 1 for an exchange option using 300 steps. The max error is 0.009 at a given point.Stress test.(Remark: this kind of visualisation is a bit static, would be better to have real 3d objects as in VRML and its successor).
Last edited by Cuchulainn on February 13th, 2012, 11:00 pm, edited 1 time in total.

rmax
Topic Author
Posts: 6080
Joined: December 8th, 2005, 9:31 am

### Testing

Why do you get the saw tooth profile?

Cuchulainn
Posts: 59714
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Testing

NX = NY = 300rho = -0.99NT = 300 NT = 500 NT = 700 NT = 1000
Last edited by Cuchulainn on February 13th, 2012, 11:00 pm, edited 1 time in total.

Cuchulainn
Posts: 59714
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Testing

rho = -0.5 (benign)NT = 700 NT = 300
Last edited by Cuchulainn on February 13th, 2012, 11:00 pm, edited 1 time in total.

Cuchulainn
Posts: 59714
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Testing

QuoteOriginally posted by: rmaxWhy do you get the saw tooth profile?1. I took NX = NY = NT = 300 which is very conservative.2. Took absolute value of FD solution vs Margrabe solution.3. Almost perfect correlation, mixed derivatives may dominate. It is a stress test that kills many schemes.4. Payoff has a discontinuity on S1 = S2, has not been smoothed.Having said that, Janenko scheme gives max error 0.009. BTW many examples/articles take rho in the safe zone [-0.5, 0.5] Now, my new 2 posts take NX = 300 = NY with various NT (500, 700, 100). At some stage increasiing NT has no effect and then we can set NX = NY = 400 etc.As I mentiiond, Excel is not optimal, e.g. cannot create other graph from 400X400 matrix. Saw OpeVRML C++ boost library.
Last edited by Cuchulainn on February 14th, 2012, 11:00 pm, edited 1 time in total.

Alan
Posts: 9787
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

### Testing

QuoteOriginally posted by: CuchulainnQuoteOriginally posted by: rmaxWhy do you get the saw tooth profile?1. I took NX = NY = NT = 300 which is very conservative.2. Took absolute value of FD solution vs Margrabe solution.3. Almost perfect correlation, mixed derivatives may dominate. It is a stress test that kills many schemes.4. Payoff has a discontinuity on S1 = S2, has not been smoothed.Having said that, Janenko scheme gives max error 0.009. BTW many examples/articles take rho in the safe zone [-0.5, 0.5] Now, my new 2 posts take NX = 300 = NY with various NT (500, 700, 100). At some stage increasiing NT has no effect and then we can set NX = NY = 400 etc.As I mentiiond, Excel is not optimal, e.g. cannot create other graph from 400X400 matrix. Saw OpeVRML C++ boost library.For SV models, large |rho| is also a difficult numerical regime. When you get to it, will be interesting tosee your error plots for, say, Heston model with rho in (-1,-0.9) combined with volatility of volatility ~ O(1) and also small (not sure which is the more difficult for pde's For example, my OptionCity calculator uses the Leisen lattice algorithm and this has a specific limitation: |rho| < Sqrt[3/4]I'll have to see how Mathematica's NDSolve does for some extreme rho.
Last edited by Alan on February 14th, 2012, 11:00 pm, edited 1 time in total.

Cuchulainn
Posts: 59714
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Testing

Alan,I am rounding off my investigations on two-assets (in between the other duties) and even for large rho OK.In fact, all I need is that the full Heston IBVP (PDE + domain) be specified and my ADE can use it as a black box using well-known UDT(). Ideally, absorbing BC would be great, otherwise need to modify the BC.This is the style for 2-factor options. I have the coefficients somewhere for Heston, but have forgotten/don't know BC for S and v (Fichera say solve a 1st oder system at v = 0, but can it be done more easily??)
Last edited by Cuchulainn on February 14th, 2012, 11:00 pm, edited 1 time in total.

Cuchulainn
Posts: 59714
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Testing

The input for exchange option isOne advantage: the visualisation is an EWS (Early warning system), some BC will not be good.
Last edited by Cuchulainn on February 14th, 2012, 11:00 pm, edited 1 time in total.

Cuchulainn
Posts: 59714
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Testing

Transformation to UDT is
Last edited by Cuchulainn on February 14th, 2012, 11:00 pm, edited 1 time in total.

Alan
Posts: 9787
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

### Testing

QuoteOriginally posted by: CuchulainnAlan,I am rounding off my investigations on two-assets (in between the other duties) and even for large rho OK.In fact, all I need is that the full Heston IBVP (PDE + domain) be specified and my ADE can use it as a black box using well-known UDT(). Ideally, absorbing BC would be great, otherwise need to modify the BC.This is the style for 2-factor options. I have the coefficients somewhere for Heston, but have forgotten/don't know BC for S and v (Fichera say solve a 1st oder system at v = 0, but can it be done mote easily??)Heston at v=0 is exactly the same discussion we already had for CIR at r=0 in this threadYou may recall that I argued strongly against this notion of a separate (uncoupled) pde at the boundary, as thedifference approx there is stronly coupled to the interior -- recall you came to agree with that. If you apply absorption at v=0, just like CIR you will get a *different* solution in the hitting regime, just like theabsorbing CIR solution is different than the (orig. 1985) CIR solution.
Last edited by Alan on February 14th, 2012, 11:00 pm, edited 1 time in total.

Cuchulainn
Posts: 59714
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Testing

Quotevolatility of volatility ~ O(1) and also small (not sure which is the more difficult for pde's Small is doable (Roelof has done it) but a pain, I have no idea O(1) (V = S, 0 etc.).For SABR I know it is a big issue at v ~ 1.
Last edited by Cuchulainn on February 14th, 2012, 11:00 pm, edited 1 time in total.

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

 JOBS BOARD

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

GZIP: On