/src/main/java/net/finmath/montecarlo/assetderivativevaluation/products/LocalRiskMinimizingHedgePortfolio.java
final double[] discretization = ( new TimeDiscretizationFromArray( min, numberOfBins, ( discretizationStep-min) /numberOfBins) ).getAsDoubleArray( ) ;
final double[] discretization = ( new TimeDiscretizationFromArray ( min, numberOfBins, ( max-min ) /numberOfBins ) ) .getAsDoubleArray ( ) ;
return portfolioValue; } private RandomVariable[] getBasisFunctions(final RandomVariable underlying) { final double min = underlying.getMin(); final double max = underlying.getMax(); final ArrayList<RandomVariable> basisFunctionList = new ArrayList<>(); <extra_id_0> for(final double discretizationStep : discretization) { final RandomVariable indicator = underlying.sub(discretizationStep).choose(new RandomVariableFromDoubleArray(1.0), new RandomVariableFromDoubleArray(0.0)); basisFunctionList.add(indicator); } return basisFunctionList.toArray(new RandomVariable[0]); }