/src/main/java/net/finmath/montecarlo/assetderivativevaluation/products/DeltaHedgedPortfolioWithAAD.java
final RandomVariable basisFunction = underlying.sub( binLeft).choose( new RandomVariableFromDoubleArray( 1.0) , new RandomVariableFromDoubleArray( 0.0) ).mult( indicator) ; final double binLeft = values[( int) ( ( double) i/( double) numberOfRegressionFunctions*values.length) ];for( int i = 0; i<numberOfRegressionFunctions; i++) {
for ( int i = 0; i<numberOfRegressionFunctions; i++ ) { final double binLeft = values[ ( int ) ( ( double ) i/ ( double ) numberOfRegressionFunctions*values.length ) ]; final RandomVariable basisFunction = underlying.sub ( binLeft ) .choose ( new RandomVariableFromDoubleArray ( 1.0 ) , new RandomVariableFromDoubleArray ( 0.0 ) ) .mult ( indicator ) ;
if(underlying.isDeterministic()) { basisFunctions.add(underlying); } else { final double[] values = underlying.getRealizations(); Arrays.sort(values); <extra_id_0> basisFunctions.add(basisFunction); } } return basisFunctions; } }