Skip to content

Commit

Permalink
Updated README and reorganized folders.
Browse files Browse the repository at this point in the history
  • Loading branch information
dbischof90 committed Jul 23, 2017
1 parent bfdb397 commit 9661f58
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 15 deletions.
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,29 @@

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)

In current focus are one-dimensional Itô - diffusions and the focus will lie on such until the framework for the one-dimensional case is stable enough. The multidimensional case is in scope and the code is developed with the later extension to that case in mind.

## Usage

All numerical schemes and estimation algorithms rely on a stochastic differential equation, given by
```Python
SDE(drift, diffusion, timerange=[0,2])
```

with generic drift and diffusion functions. These can be specified in any way - it is useful though to ensure that the theoretical boundaries for existence of weak or strong solutions are set.

Schemes are implemented as iterators. To import the Euler-Mayurama scheme, use
```Python
from simulation.strong.taylor import Order_05 as Euler

[...]


for path_value in Euler(SDE, parameter, steps=50):
do_stuff_with_it(path_value)
```
which gives you maximal flexibility, speed and effective memory management.

Currently implemented are strong schemes with different properties and besides the Euler scheme they all have first-order convergence.
A short introduction on estimation methods will later be included.
8 changes: 4 additions & 4 deletions examples/convergence order_cir.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import numpy as np

from src.sde import SDE
from src.simulation.strong.explicit import Order_10 as Platen
from src.simulation.strong.taylor import Order_05 as Euler
from src.simulation.strong.taylor import Order_10 as Milstein
from sde import SDE
from simulation.strong.explicit import Order_10 as Platen
from simulation.strong.taylor import Order_05 as Euler
from simulation.strong.taylor import Order_10 as Milstein

"""
We compare the order of convergence between two strong Taylor schemes and one derivative-free strong
Expand Down
8 changes: 4 additions & 4 deletions examples/simulate_cir.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

import numpy as np

from src.sde import SDE
from src.simulation.strong.explicit import Order_10 as Platen
from src.simulation.strong.taylor import Order_05 as Euler
from sde import SDE
from simulation.strong.explicit import Order_10 as Platen
from simulation.strong.taylor import Order_05 as Euler

"""
We begin with the definition of both drift and diffusion functions and define the CIR process.
Expand All @@ -29,7 +29,7 @@ def cir_diffusion(c, x):

euler_path = np.zeros([100, 2001])
platen_path = np.zeros([100, 2001])
print("Run time estimation between Euler and Platen discretization of an CIR process.")
print("Run time estimation for Euler and Platen discretization of an CIR process.")

"""
A dictionary for all parameters is given to the iterators representing the schemes.
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import numpy as np

from src.simulation.scheme import Scheme
from simulation.scheme import Scheme


class Order_10(Scheme):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

from scipy.optimize import newton

from src.simulation.scheme import Scheme
from simulation.scheme import Scheme


class Order_10(Scheme):
Expand Down
Empty file added simulation/strong/multistep.py
Empty file.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import numpy as np

from src.simulation.scheme import Scheme
from simulation.scheme import Scheme


class Order_10(Scheme):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

from src.simulation.scheme import Scheme
from simulation.scheme import Scheme


class Order_05(Scheme):
Expand Down

0 comments on commit 9661f58

Please sign in to comment.