ArgumentChecker.notNull(swap, "swap");
ArgumentChecker.notNull(discountCurve, "discount curve");
ArgumentChecker.notNull(dividends, "dividends");
ArgumentChecker.notNull(marketVols, "market volatilities");
final PureImpliedVolatilitySurface piv = getPureImpliedVolFromMarket(spot, discountCurve, dividends, marketVols);
final double eps = 1e-5;
final int index = swap.correctForDividends() ? 0 : 1;
final double t = swap.getTimeToSettlement();
//up
final PureImpliedVolatilitySurface ivUp = new PureImpliedVolatilitySurface(flooredShiftSurface(piv.getSurface(), eps));
final double up = Math.sqrt(VAR_SWAP_CALCULATOR.expectedVariance(spot, discountCurve, dividends, t, ivUp)[index] / t);
//down
final PureImpliedVolatilitySurface ivDown = new PureImpliedVolatilitySurface(flooredShiftSurface(piv.getSurface(), -eps));
final double down = Math.sqrt(VAR_SWAP_CALCULATOR.expectedVariance(spot, discountCurve, dividends, t, ivDown)[index] / t);
final double vega = (up - down) / 2 / eps;
return vega;
}