Exemplo n.º 1
0
 // -> METHODS
 // --------------------
 public override void evolve(double dateFrom, double dateTo, int path,
                             IScenario scenario, double correlatedBrownians)
 {
     double currentValue;
     double nextValue;
     double incT = (dateTo - dateFrom) / 365.25;
     try
     {                
         currentValue = scenario.getValue(ID, dateFrom, path);
         nextValue = currentValue * Math.Exp(_riskFreeRate*incT) 
                                  * Math.Exp(- (Math.Pow(_vol, 2) * (incT/2)) )
                                  * Math.Exp(_vol * Math.Sqrt(incT) * correlatedBrownians);
         scenario.setValue(ID, dateTo, path, nextValue);
     }
     catch
     {
         throw new Exception("Error in method evolve of risk factor " + ID + " from date " + dateFrom);
     }
 }