Last updated: 2023-03-16.
tf_quant_finance.rates.analytics.swap.ir_swap_par_rate_and_annuity#
Utility function to compute par swap rate and annuity.
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
)
Args:#
floating_leg_start_times: A realTensorof the same dtype asexpiries. The times when accrual begins for each payment in the floating leg. The shape of this input should beexpiries.shape + [m]wheremdenotes the number of floating payments in each leg.floating_leg_end_times: A realTensorof the same dtype asexpiries. The times when accrual ends for each payment in the floating leg. The shape of this input should beexpiries.shape + [m]wheremdenotes the number of floating payments in each leg.fixed_leg_payment_times: A realTensorof the same dtype asexpiries. The payment times for each payment in the fixed leg. The shape of this input should beexpiries.shape + [n]wherendenotes the number of fixed payments in each leg.fixed_leg_daycount_fractions: A realTensorof the same dtype and compatible shape asfixed_leg_payment_times. The daycount fractions for each payment in the fixed leg.reference_rate_fn: A Python callable that accepts expiry time as a realTensorand returns aTensorof shapeinput_shape + [dim]. Returns the continuously compounded zero rate at the present time for the input expiry time.dtype:tf.Dtype. If supplied the dtype for the input and outputTensors. Default value: None which maps to the default dtype inferred fromfloating_leg_start_times.name: 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.