Fair Rate
Function Fair Rate within FxdFlt IRS with keys FxdFlt IRS Fair Rate keysreturns the rate that the referenced swap needs to have at its fixed rate leg in order to have a given NPV, usually a zero NPV.
Note 1:
If the swap contains more than 1 fixed rate, i.e. if the value associated with its key Fxd_Rate is an array containing more than 1 elements, the returned rate corresponds only to the first of these elements, while all other elements retain their original values.
Note 2:
While the generic implementation is based on a quite slow iterative root finding method that makes use of an optional input of type Solver, in the special but frequent case where the target NPV is 0 and the swap is either a Vanilla IRS or OIS with a single fixed rate, the implementation switches to a much faster non-iterative formula that does not need the Solver input.
