diff --git a/README.md b/README.md index 3d6d699..fb2882e 100644 --- a/README.md +++ b/README.md @@ -2,5 +2,5 @@ ###### A library to estimate and simulate Stochastic Differential Equations. This library is a collection of statistical methods to simulate and estimate non-deterministic differential equations. Inference of SDEs is a topic I personally find very interesting but while the tools for their deterministic counterparts are well-developed (and especially well-implemented), stochastic differential equations lack a common tool set in Python. - +![Alt text](misc/cirpaths.png?raw=true) Currently implemented are strong schemes with different properties and besides the Euler scheme they all have first-order convergence. diff --git a/examples/simulate_cir.py b/examples/simulate_cir.py index 5ccf809..3ded3c4 100644 --- a/examples/simulate_cir.py +++ b/examples/simulate_cir.py @@ -15,16 +15,16 @@ def cir_diffusion(x, c): return np.sqrt(x) * c -cir_process = SDE(cir_drift, cir_diffusion, timerange=[0,10]) +cir_process = SDE(cir_drift, cir_diffusion, timerange=[0,2]) -euler_path = np.zeros([100, 2001]) -platen_path = np.zeros([100, 2001]) +euler_path = np.zeros([10, 2001]) +platen_path = np.zeros([10, 2001]) print("Run time estimation between Euler and Platen discretization of an CIR process.") -parameter = {'a': 2, 'b': 0.5, 'c' : 0.2} +parameter = {'a': 2, 'b': 2.5, 'c' : 0.2} t = time() -for i in range(100): +for i in range(10): tmp = [] for path in Euler(cir_process, parameter, steps = 2000): tmp.append(path) @@ -32,7 +32,7 @@ def cir_diffusion(x, c): print("Euler: " + str(time() - t)) t = time() -for i in range(100): +for i in range(10): tmp = [] for path in Platen(cir_process, parameter, steps = 2000): tmp.append(path) diff --git a/misc/cirpaths.png b/misc/cirpaths.png new file mode 100644 index 0000000..671b824 Binary files /dev/null and b/misc/cirpaths.png differ