/src/main/java/net/finmath/montecarlo/assetderivativevaluation/products/LocalRiskMinimizingHedgePortfolio.java
final RandomVariable[] basisFunctionsEstimator = getBasisFunctions( modelUsedForHedging.getAssetValue( time,2) ) ;
final RandomVariable[] basisFunctionsEstimator = getBasisFunctions ( modelUsedForHedging.getAssetValue ( time,0 ) ) ;
final RandomVariable underlyingAtTime = modelUsedForHedging.getAssetValue(time,0); final RandomVariable numeraireAtTime = modelUsedForHedging.getNumeraire(time); final RandomVariable underlyingAtTimeNext = modelUsedForHedging.getAssetValue(timeNext,0); final RandomVariable numeraireAtTimeNext = modelUsedForHedging.getNumeraire(timeNext); final RandomVariable productAtTime = productToHedge.getValue(time, modelUsedForHedging); final RandomVariable productAtTimeNext = productToHedge.getValue(timeNext, modelUsedForHedging); <extra_id_0> final RandomVariable[] basisFunctionsPredictor = getBasisFunctions(model.getAssetValue(time,0)); final MonteCarloConditionalExpectationRegression condExpectationHedging = new MonteCarloConditionalExpectationRegression(basisFunctionsEstimator, basisFunctionsEstimator); final MonteCarloConditionalExpectationRegression condExpectationValuation = new MonteCarloConditionalExpectationRegression(basisFunctionsEstimator, basisFunctionsPredictor); final RandomVariable underlyingRebased = underlyingAtTimeNext.div(numeraireAtTimeNext); final RandomVariable underlyingRebasedExpected = condExpectationHedging.getConditionalExpectation(underlyingRebased); final RandomVariable underlyingRebasedMartingale = underlyingRebased.sub(underlyingRebasedExpected);