<!--
This file is generated by a tool. Do not edit directly.
For open-source contributions the docs will be updated automatically.
-->

*Last updated: 2023-03-16.*

<div itemscope itemtype="http://developers.google.com/ReferenceObject">
<meta itemprop="name" content="tf_quant_finance.rates.analytics.swap.ir_swap_par_rate_and_annuity" />
<meta itemprop="path" content="Stable" />
</div>

# tf_quant_finance.rates.analytics.swap.ir_swap_par_rate_and_annuity

<!-- Insert buttons and diff -->

<table class="tfo-notebook-buttons tfo-api" align="left">
</table>

<a target="_blank" href="https://github.com/paolodelia99/tf-quant-finance/blob/main/tf_quant_finance/rates/analytics/swap.py">View source</a>



Utility function to compute par swap rate and annuity.

```python
tf_quant_finance.rates.analytics.swap.ir_swap_par_rate_and_annuity(
    floating_leg_start_times, floating_leg_end_times, fixed_leg_payment_times,
    fixed_leg_daycount_fractions, reference_rate_fn, dtype=None, name=None
)
```



<!-- Placeholder for "Used in" -->


#### Args:


* <b>`floating_leg_start_times`</b>: A real `Tensor` of the same dtype as `expiries`.
  The times when accrual begins for each payment in the floating leg. The
  shape of this input should be `expiries.shape + [m]` where `m` denotes the
  number of floating payments in each leg.
* <b>`floating_leg_end_times`</b>: A real `Tensor` of the same dtype as `expiries`. The
  times when accrual ends for each payment in the floating leg. The shape of
  this input should be `expiries.shape + [m]` where `m` denotes the number
  of floating payments in each leg.
* <b>`fixed_leg_payment_times`</b>: A real `Tensor` of the same dtype as `expiries`.
  The payment times for each payment in the fixed leg. The shape of this
  input should be `expiries.shape + [n]` where `n` denotes the number of
  fixed payments in each leg.
* <b>`fixed_leg_daycount_fractions`</b>: A real `Tensor` of the same dtype and
  compatible shape as `fixed_leg_payment_times`. The daycount fractions for
  each payment in the fixed leg.
* <b>`reference_rate_fn`</b>: A Python callable that accepts expiry time as a real
  `Tensor` and returns a `Tensor` of shape `input_shape + [dim]`. Returns
  the continuously compounded zero rate at the present time for the input
  expiry time.
* <b>`dtype`</b>: `tf.Dtype`. If supplied the dtype for the input and output `Tensor`s.
  Default value: None which maps to the default dtype inferred from
    `floating_leg_start_times`.
* <b>`name`</b>: Python str. The name to give to the ops created by this function.
  Default value: None which maps to 'ir_swap_par_rate_and_annuity'.


#### Returns:

A tuple with two elements containing par swap rate and swap annuities.
