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