Serving the Quantitative Finance Community

 
User avatar
Cuchulainn
Topic Author
Posts: 20250
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: Parallelisation of ODEs and Method of Lines

July 4th, 2017, 7:03 pm

For delta and gamma, we can take raw divided differences but this breaks down sooner or later.
Now, if we use the array of V(j) prices we can do cubic spline interpolation is what MM seems to do. And there is "spline on spline" in which the second spline interpolates on delta to get  a better gamma.
/*  S  exact delta CN delta    Spline delta exact gamma CN gamma    Spline gamma
59     0.330935233 0.330702564 0.330478248  0.040967715 0.04098453  0.041068871
60     0.372482798 0.372232265 0.372093554  0.042043376 0.042074873 0.042161739
61     0.41484882  0.414593361 0.414541127  0.042603904 0.042647319 0.042733408
62     0.457519085 0.457270132 0.457302102  0.042654217 0.042706223 0.042788541
63     0.499993235 0.499760129 0.499871257  0.042216737 0.04227377  0.042349769
64     0.541801022 0.541590678 0.541773643  0.041328768 0.041387329 0.041455004
65     0.582515647 0.582332471 0.582578239  0.040039354 0.040096257 0.040154187
66     0.62176381  0.621609821 0.621908227  0.038405882 0.038458444 0.038505789
67     0.659232357 0.659107471 0.659447781  0.036490702 0.036536856 0.03657332
68     0.694671633 0.694574052 0.694945475  0.034357967 0.034396306 0.034422069
69     0.727895851 0.727822509 0.728214631  0.032070838 0.032100608 0.032116243
70     0.758780913 0.758727922 0.759131055  0.029689185 0.029710218 0.029716604
71     0.787260172 0.787223244 0.787628682  0.027267796 0.027280425 0.027278649*/
 
Table 22.1 Output from Steps 1-4; data is K = 65, T = 0.25, r = b = 0.8, v = 0.3,NS = 325, NT = 1000
 
which can then be symbolically differentiated, to produce new interpolating objects (of less accuracy). 
Ahlberg,  Nielson and Walsh 1967.
 
User avatar
Alan
Posts: 2958
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

Re: Parallelisation of ODEs and Method of Lines

July 4th, 2017, 7:11 pm

And speed?

[$]\frac{\partial^3 V}{\partial S^3}[$]

It would be interesting to see how MM splines handle this.
Here is a second attachment, showing the NDSolve timing (0.016 sec) and Vxx:
CoupledPDE2.zip
(1.91 MiB) Downloaded 134 times
 
User avatar
Cuchulainn
Topic Author
Posts: 20250
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: Parallelisation of ODEs and Method of Lines

July 11th, 2017, 8:47 am

And speed?

[$]\frac{\partial^3 V}{\partial S^3}[$]

It would be interesting to see how MM splines handle this.
Here is a second attachment, showing the NDSolve timing (0.016 sec) and Vxx:

CoupledPDE2.zip
The accuracy of the output is determined by the quality of the input. In this case the solution is densely defined on a well-behaved mesh and (spline?) interpolation will be pleasing on the eye.

I think NDSolve uses Bulirsch-Stoer which is high accuracy. Also nice it it can detect stiffness

http://reference.wolfram.com/language/t ... ching.html

What I really like about NDSolve is the symbolic nature .. it's almost like maths.