示例#1
0
        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
        }
示例#2
0
 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
 }