Skip to content

Implementation of the Milstein Scheme + a Monte Carlo Engine #244

@yfnaji

Description

@yfnaji

Background

There are two traits in the Stochastics module, StochasticProcess and StochasticVolatilityProcess. The two traits utilise the Euler-Maruyama scheme through methods euler_maruyama() and seedable_euler_maruyama() to approximate solutions to stochastic differential equations (SDEs).

Feature requests

  • Implement the Milstein method in the StochasticProcess and StochasticVolatilityProcess traits as an alternative to the Euler-Maruyama scheme
  • Create a Monte-Carlo engine to utilise the numerical methods in StochasticProcess and StochasticVolatilityProcess for an approximation of option prices

Mathematical context for the feature requests

Milstein Method

Take the SDE

$$ dX_t = A(X_t)dt + B(X_t) dW_t $$

where $W_t\sim N\left(0, t\right)$ is the Wiener process. The Milstein method at time $\tau_n\in\left[0, T\right]$ is defined as

$$ \tilde{X}_{n+1} = \tilde{X}_n + A(\tilde{X}_n)\Delta t + B(\tilde{X}_n)\Delta W_t + \frac{1}{2}b(\tilde{X}_n)\frac{\partial}{\partial X}B\left(\tilde{X}_n\right)\left(\Delta W_n^2 - \Delta t\right) $$

with the initial condition $\tilde{X_0} = x_0$.

Monte Carlo Method for Option Pricing

The Monte-Carlo method provides the following approximation

$$ \textrm{E}\left[X\right] \approx \frac{1}{n}\sum^N_{i=0} X_i $$

for some stochastic process $X$, simulated samples $X_i$ and sufficiently large $N$.

We can simulate a numerical scheme $N$ times, each approximating the value of an asset $S_T$ and then obtain the Monte-Carlo approximation from there:

$$ \textrm{E}\left[\left(S_T - K\right)_{+}\right] \approx \textrm{E}\left[\left(\tilde{S}_T - K\right)_{+}\right] \approx \frac{1}{n}\sum^N_{i=0} \left(\tilde{S}_{T, i} - K\right)_{+} $$

where $\tilde{S}_{T, i}$ is the $i^{\textrm{th}}$ numerical approximation of $S_T$.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions