You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Hi, following up on this as I am doing a fair bit of re-working to the instruments module.
I will be using a Payoff trait of the form instead of my previous comment:
/// Generic payoff trait.pubtraitPayoff{/// Underlying input type for the payoff function.typeUnderlying;/// Payoff function for the derivative.fnpayoff(&self,underlying:Self::Underlying) -> f64;}implPayoffforVanillaOption{typeUnderlying = f64;fnpayoff(&self,underlying:Self::Underlying) -> f64{
...}}implPayoffforAsianOption{typeUnderlying = Vec<f64>;fnpayoff(&self,underlying:Self::Underlying) -> f64{
...}}
Background
There are two traits in the Stochastics module,
StochasticProcess
andStochasticVolatilityProcess
. The two traits utilise the Euler-Maruyama scheme through methodseuler_maruyama()
andseedable_euler_maruyama()
to approximate solutions to stochastic differential equations (SDEs).Feature requests
StochasticProcess
andStochasticVolatilityProcess
traits as an alternative to the Euler-Maruyama schemeStochasticProcess
andStochasticVolatilityProcess
for an approximation of option pricesMathematical context for the feature requests
Milstein Method
Take the SDE
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
with the initial condition$\tilde{X_0} = x_0$ .
Monte Carlo Method for Option Pricing
The Monte-Carlo method provides the following approximation
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:
where$\tilde{S}_{T, i}$ is the $i^{\textrm{th}}$ numerical approximation of $S_T$ .
The text was updated successfully, but these errors were encountered: