Friends, I want to explain the series solution method for constant CDF lines of the density and relate it to my program and then discuss improvements I have made.

Previously we had derived the differential equation of constant CDF lines of solution of an SDE from Fokker-planck equation of the SDE. Here (Post 1202) are the details of that derivation: https://forum.wilmott.com/viewtopic.php?f=4&t=99702&start=1200#p867718

From the derivation above, we find that constant CDF lines of bessel form of the Fokker-planck equation are given as

[$]\frac{dw}{dt}=\mu(w) \, + \, .5 {\sigma}^2 Z \frac{\partial Z}{\partial w} - \, .5 {\sigma}^2 \frac{\partial^2 Z}{\partial w^2} [\frac{\partial Z}{\partial w}]^{-1}[$]

From method of iterated integrals for ordinary differential equations, For reference see: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2872598

we know that for a first order differential equation of the form

[$]\frac{dw}{dt}=f(w)[$] ,

the solution to second order accuracy in time is given as

[$]w(t_1) \, =\, w(t_0)+ f(w(t_0)) \, \int_{t_0}^{t_1} \, dt +\, f'(w(t_0)) f(w(t_0)) \, \int_{t_0}^{t_1} \int_{t_0}^t \, ds \, dt \,[$]

or

[$]w(t_1) \, =\, w(t_0)+ f(w(t_0)) \, (t_1-t_0)+\, f'(w(t_0)) f(w(t_0)) \,\frac{ {(t_1-t_0)}^2}{2} \,[$]

incidentally after the next higher order term, the third order accurate in time solution can be written as

[$]w(t_1) \, =\, w(t_0)+ f(w(t_0)) \, (t_1-t_0)+\, f'(w(t_0)) f(w(t_0)) \,\frac{ {(t_1-t_0)}^2}{2} \,+\, \Big[ f''(w(t_0)) {f(w(t_0))}^2 + {f'(w(t_0))}^2 f(w(t_0)) \Big] \,\frac{ {(t_1-t_0)}^3}{6} \,[$]

But we have not added third order term in our series solution to constant CDF lines solution to Fokker-planck equation yet. In our case

[$]\frac{dw}{dt}=\mu(w) \, + \, .5 {\sigma}^2 Z \frac{\partial Z}{\partial w} - \, .5 {\sigma}^2 \frac{\partial^2 Z}{\partial w^2} [\frac{\partial Z}{\partial w}]^{-1}[$]

So

[$]f(w)=\mu(w) \, + \, .5 {\sigma}^2 Z \frac{\partial Z}{\partial w} - \, .5 {\sigma}^2 \frac{\partial^2 Z}{\partial w^2} [\frac{\partial Z}{\partial w}]^{-1}[$]

and

[$]f'(w)=\mu'(w) \, + \, .5 {\sigma}^2 \Big[{ (\frac{\partial Z}{\partial w})}^2 \,+Z \frac{\partial^2 Z}{\partial w^2}\, \Big] - \, .5 {\sigma}^2 \Big[ \frac{\partial^3 Z}{\partial w^3} [\frac{\partial Z}{\partial w}]^{-1} - \, {(\frac{\partial^2 Z}{\partial w^2})}^2 [\frac{\partial Z}{\partial w}]^{-2} \, \Big][$]

Our second order solution to differential equation of constant CDF lines is given as

[$]w(t_1) \, =\, w(t_0)+ f(w(t_0)) \, \Delta t+\, f'(w(t_0)) f(w(t_0)) \,\frac{ {\Delta t}^2}{2} \,[$]

which becomes

[$]w(t_1) \, =\, w(t_0)+ \Bigg[ \mu(w) \, + \, .5 {\sigma}^2 Z \frac{\partial Z}{\partial w} - \, .5 {\sigma}^2 \frac{\partial^2 Z}{\partial w^2} [\frac{\partial Z}{\partial w}]^{-1}\Bigg] \, \Delta t \, [$]

[$]+\, \Bigg[ \mu'(w) \, + \, .5 {\sigma}^2 \Big[{ (\frac{\partial Z}{\partial w})}^2 \,+Z \frac{\partial^2 Z}{\partial w^2}\, \Big] - \, .5 {\sigma}^2 \Big[ \frac{\partial^3 Z}{\partial w^3} [\frac{\partial Z}{\partial w}]^{-1} - \, {(\frac{\partial^2 Z}{\partial w^2})}^2 [\frac{\partial Z}{\partial w}]^{-2} \, \Big]\Bigg] \, \Bigg[\mu(w) \, + \, .5 {\sigma}^2 Z \frac{\partial Z}{\partial w} - \, .5 {\sigma}^2 \frac{\partial^2 Z}{\partial w^2} [\frac{\partial Z}{\partial w}]^{-1} \Bigg] \,\frac{ {\Delta t}^2}{2} \,[$]

If wanted, we could extend the solution to third order in time for well behaved SDEs using the third order expansion of the differential equation that I described earlier.

In the next post, I will describe the series solution and then follow with another post to explain the program.