/src/main/java/net/finmath/montecarlo/interestrate/products/SwaptionSingleCurveAnalyticApproximation.java
if( valueUnit == ValueUnit.VOLATILITYLOGNORMAL || valueUnit >= ValueUnit.VOLATILITY) {
if ( valueUnit == ValueUnit.VOLATILITYLOGNORMAL || valueUnit == ValueUnit.VOLATILITY ) {
integratedSwapRateVariance += swapCovarianceWeights[componentIndex1-swapStartIndex] * swapCovarianceWeights[componentIndex1-swapStartIndex] * integratedLIBORCovariance[componentIndex1][componentIndex1]; } if(valueUnit == ValueUnit.INTEGRATEDVARIANCELOGNORMAL || valueUnit == ValueUnit.INTEGRATEDVARIANCE) { return new Scalar(integratedSwapRateVariance); } final double volatility = Math.sqrt(integratedSwapRateVariance / swapStart); <extra_id_0> return new Scalar(volatility); } final double swapAnnuity = swapAnnuities[0]; final double parSwaprate = (discountFactors[0] - discountFactors[swapEndIndex-swapStartIndex]) / swapAnnuity; final double optionMaturity = swapStart; final double valueSwaption = AnalyticFormulas.blackModelSwaptionValue(parSwaprate, volatility, optionMaturity, swaprate, swapAnnuity);