public double getValue ( ForwardCurve forwardCurve , double swaprateVolatility ) { double [ ] swapTenor = new double [ fixingDates . length + 1 ] ; System . arraycopy ( fixingDates , 0 , swapTenor , 0 , fixingDates . length ) ; swapTenor [ swapTenor . length - 1 ] = paymentDates [ paymentDates . length - 1 ] ; TimeDiscretization fixTenor = new TimeDiscretizationFromArray ( swapTenor ) ; TimeDiscretization floatTenor = new TimeDiscretizationFromArray ( swapTenor ) ; double forwardSwapRate = Swap . getForwardSwapRate ( fixTenor , floatTenor , forwardCurve ) ; double swapAnnuity = SwapAnnuity . getSwapAnnuity ( fixTenor , forwardCurve ) ; double payoffUnit = SwapAnnuity . getSwapAnnuity ( new TimeDiscretizationFromArray ( swapTenor [ 0 ] , swapTenor [ 1 ] ) , forwardCurve ) / ( swapTenor [ 1 ] - swapTenor [ 0 ] ) ; return AnalyticFormulas . huntKennedyCMSOptionValue ( forwardSwapRate , swaprateVolatility , swapAnnuity , exerciseDate , swapTenor [ swapTenor . length - 1 ] - swapTenor [ 0 ] , payoffUnit , strike ) * ( swapTenor [ 1 ] - swapTenor [ 0 ] ) ; }
This method returns the value of the product using a Black - Scholes model for the swap rate with the Hunt - Kennedy convexity adjustment . The model is determined by a discount factor curve and a swap rate volatility .