private Pair<Double, Double> calibrationAtm( double forward, double shift, double beta, double rho, double nu, BusinessDayAdjustment bda, ZonedDateTime calibrationDateTime, DayCount dayCount, Period expiry, double volatility, ValueType volatilityType) { double alphaStart = volatility / Math.pow(forward + shift, beta); DoubleArray startParameters = DoubleArray.of(alphaStart, beta, rho, nu); Pair<Double, Double> r = null; if (volatilityType.equals(ValueType.NORMAL_VOLATILITY)) { r = calibrateAtmShiftedFromNormalVolatilities( bda, calibrationDateTime, dayCount, expiry, forward, volatility, startParameters, shift); } else { if (volatilityType.equals(ValueType.BLACK_VOLATILITY)) { r = calibrateAtmShiftedFromBlackVolatilities( bda, calibrationDateTime, dayCount, expiry, forward, volatility, 0.0, startParameters, shift); } else { throw new IllegalArgumentException("Data type not supported"); } } return r; }