/src/main/java/net/finmath/montecarlo/assetderivativevaluation/products/LocalRiskMinimizingHedgePortfolio.java
final RandomVariable underlyingAtEvaluationTime = model.getAssetValue( evaluationTime,0) ;final RandomVariable[] basisFunctionsPredictor = getBasisFunctions( model.getAssetValue( time,0) ) ;
final RandomVariable[] basisFunctionsPredictor = getBasisFunctions ( model.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); final RandomVariable[] basisFunctionsEstimator = getBasisFunctions(modelUsedForHedging.getAssetValue(time,0)); <extra_id_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); final RandomVariable derivativeRebased = productAtTimeNext.div(numeraireAtTimeNext);