Description Usage Arguments Details Value
Generate sample paths of processes solving one-dimensional SDEs with near arbitrary coefficient functions. Three schemes are available: Euler-Maruyama, RK2 and Milstein's method.
1 |
x0 |
initial point of the process |
tt |
the time horizon to solve over |
dynamics |
list of functions defining dynamics of the stochastic process, see details |
n |
number of time sub-intervals in the partition |
method |
the numerical integration method to use: "em", "rk2", or "milstein", see details |
plotG |
whether to plot the sample path in the function body |
For method = "milstein"
one must pass single-variable coefficient functions and
one can optionally pass the derivative of the volatility function if it is known, otherwise use a numeric
approximation, as one of the two is required in the Milstein scheme. For method = "em"
or "rk2", the
coefficient functions ought to be functions of (t, x)
but wrappers are made if this is not done.
The dynamics
list must be a list of either 2 or 3 functions defining the infinitesimal drift
function and the infinitesimal volatility function and optionally its derivative for the Milstein method.
numeric/data.frame
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.