public static double huntKennedyCMSOptionValue ( double forwardSwaprate , double volatility , double swapAnnuity , double optionMaturity , double swapMaturity , double payoffUnit , double optionStrike ) { double a = 1.0 / swapMaturity ; double b = ( payoffUnit / swapAnnuity - a ) / forwardSwaprate ; double convexityAdjustment = Math . exp ( volatility * volatility * optionMaturity ) ; double valueUnadjusted = blackModelSwaptionValue ( forwardSwaprate , volatility , optionMaturity , optionStrike , swapAnnuity ) ; double valueAdjusted = blackModelSwaptionValue ( forwardSwaprate * convexityAdjustment , volatility , optionMaturity , optionStrike , swapAnnuity ) ; return a * valueUnadjusted + b * forwardSwaprate * valueAdjusted ; }
Calculate the value of a CMS option using the Black - Scholes model for the swap rate together with the Hunt - Kennedy convexity adjustment .