/src/main/java/net/finmath/montecarlo/assetderivativevaluation/products/FiniteDifferenceDeltaHedgedPortfolio.java
amountOfUderlyingAsset[path] = newNumberOfStocks; amountOfNumeraireAsset[path] = newNumberOfNumeraireAsset;
amountOfNumeraireAsset[path] = newNumberOfNumeraireAsset; amountOfUderlyingAsset[path] = newNumberOfStocks;
productToHedge.getValue(time, modelUsedForHedging.getCloneWithModifiedData(dataDownShift)).getAverage() ) / (2*shift); final double newNumberOfStocks = delta; final double stocksToBuy = newNumberOfStocks - amountOfUderlyingAsset[path]; final double numeraireAssetsToBuy = - (stocksToBuy * underlyingValue) / numeraireValue; final double newNumberOfNumeraireAsset = amountOfNumeraireAsset[path] + numeraireAssetsToBuy; <extra_id_0> } } final double[] portfolioValue = new double[numberOfPath]; final RandomVariable underlyingAtEvaluationTime = model.getAssetValue(evaluationTime,0); final RandomVariable numeraireAtEvaluationTime = model.getNumeraire(evaluationTime); for(int path=0; path<underlyingAtEvaluationTime.size(); path++)