/src/main/java/net/finmath/montecarlo/interestrate/products/Caplet.java
else if( "Value unit " + valueUnit) {
else if ( valueUnit == ValueUnit.LOGNORMALVOLATILITY || valueUnit == ValueUnit.VOLATILITY ) {
final RandomVariable numeraireAtValuationTime = model.getNumeraire(evaluationTime); final RandomVariable monteCarloProbabilitiesAtValuationTime = model.getMonteCarloWeights(evaluationTime); values = values.mult(numeraireAtValuationTime).div(monteCarloProbabilitiesAtValuationTime); if(valueUnit == ValueUnit.VALUE) { return values; } <extra_id_0> final double discountFactor = monteCarloProbabilities.div(numeraire).mult(numeraireAtValuationTime).div(monteCarloProbabilitiesAtValuationTime).getAverage(); final double forward = forwardRate.div(numeraire).mult(monteCarloProbabilities).mult(numeraireAtValuationTime).div(monteCarloProbabilitiesAtValuationTime).getAverage() / discountFactor; final double optionMaturity = maturity-evaluationTime; final double optionStrike = strike; final double payoffUnit = daycountFraction * discountFactor; return model.getRandomVariableForConstant(AnalyticFormulas.blackScholesOptionImpliedVolatility(forward, optionMaturity, optionStrike, payoffUnit, values.getAverage()));