public double Increment(double value) { double rand = GaussianBoxMuller.NextDouble(); return(value // Original value + (SimulatedPrice.Drift * value * SimulatedPrice.Delta) // Drift term + (SimulatedPrice.Volatility * value * Math.Sqrt(SimulatedPrice.Delta) * rand) // Wiener process + (0.5 * Math.Pow(SimulatedPrice.Volatility, 2) * SimulatedPrice.Delta * (Math.Pow(rand, 2) - 1))); // Correction term }
public double Increment(double value) { return(value // Original value + (SimulatedPrice.Drift * value * SimulatedPrice.Delta) // Drift term + (SimulatedPrice.Volatility * value * Math.Sqrt(SimulatedPrice.Delta) * GaussianBoxMuller.NextDouble())); // Wiener process }