scipy.integrate.odeint() or MATLAB's ode45.There already exist some python and MATLAB packages providing Euler-Maruyama and Milstein algorithms, and a couple of others. So why am I bothering to make another package?
It is because there has been 25 years of further research with better methods but for some reason I can't find any open source reference implementations. Not even for those methods published by Kloeden and Platen way back in 1992. So I will aim to gradually add some improved methods here.
This is prototype code in python, so not aiming for speed. Later can always rewrite these with loops in C when speed is needed.
Functions
itoint(f, G, y0, tspan) for Ito equation dy = f(y,t)dt + G(y,t)dWstratint(f, G, y0, tspan) for Stratonovich equation dy = f(y,t)dt + G(y,t)∘dW
Algorithms
itoEuler(f, G, y0, tspan): the Euler-Maruyama algorithm for Ito equations.stratHeun(f, G, y0, tspan): the Stratonovich Heun algorithm for Stratonovich equations.itoSRI2(f, G, y0, tspan): the Rößler2010 order 1.0 strong Stochastic Runge-Kutta algorithm SRI2 for Ito equations.itoSRI2(f, [g1,...,gm], y0, tspan): as above, with G matrix given as a separate function for each column (gives speedup for large m or complicated G).stratSRS2(f, G, y0, tspan): the Rößler2010 order 1.0 strong Stochastic Runge-Kutta algorithm SRS2 for Stratonovich equations.stratSRS2(f, [g1,...,gm], y0, tspan): as above, with G matrix given as a separate function for each column (gives speedup for large m or complicated G).stratKP2iS(f, G, y0, tspan): the Kloeden and Platen two-step implicit order 1.0 strong algorithm for Stratonovich equations.
Utility Functions
deltaW(N, m, h): Generate increments of m independent Wiener processes for each of N time intervals of length h.
Repeated integrals by the method of Kloeden, Platen and Wright (1992):
Ikpw(dW, h, n=5): Approximate repeated Ito integrals.Jkpw(dW, h, n=5): Approximate repeated Stratonovich integrals.
Repeated integrals by the method of Wiktorsson (2001):
Iwik(dW, h, n=5): Approximate repeated Ito integrals.Jwik(dW, h, n=5): Approximate repeated Stratonovich integrals.
No comments:
Post a Comment