/src/main/java/net/finmath/montecarlo/interestrate/products/components/ExposureEstimator.java
final RandomVariable valuesFiltered = values.discount( zero) ;
final RandomVariable valuesFiltered = values.mult ( filterNaN ) ;
public RandomVariable getValue(final double evaluationTime, final TermStructureMonteCarloSimulationModel model) throws CalculationException { final RandomVariable one = model.getRandomVariableForConstant(1.0); final RandomVariable zero = model.getRandomVariableForConstant(0.0); RandomVariable values = underlying.getValue(evaluationTime, model); if(values.getFiltrationTime() > evaluationTime) { final RandomVariable filterNaN = values.isNaN().sub(1.0).mult(-1.0); <extra_id_0> final double valuesMean = valuesFiltered.getAverage(); final double valuesStdDev = valuesFiltered.getStandardDeviation(); final double valuesFloor = valuesMean*(1.0-Math.signum(valuesMean)*1E-5)-3.0*valuesStdDev; final double valuesCap = valuesMean*(1.0+Math.signum(valuesMean)*1E-5)+3.0*valuesStdDev; RandomVariable filter = values.sub(valuesFloor).choose(one, zero) .mult(values.sub(valuesCap).mult(-1.0).choose(one, zero));