liborduration

Duration of LIBOR-based interest-rate swap

Description

example

[PayFixDuration,GetFixDuration] = liborduration(SwapFixRate,Tenor,Settle) computes the duration of LIBOR-based interest-rate swaps.

Examples

collapse all

This example shows how to compute the duration of LIBOR-based interest-rate swaps using the following data.

SwapFixRate = 0.0383;
Tenor = 7;
Settle = datenum('11-Oct-2002');

[PayFixDuration GetFixDuration] = liborduration(SwapFixRate,... 
Tenor, Settle)
PayFixDuration = -4.7567
GetFixDuration = 4.7567

Input Arguments

collapse all

Par swap fixed rate (quarterly compounded), specified as an N-by-1 vector in decimals. The Basis should be actual/360.

Data Types: double

Swap tenor in years, specified as a N-by-1 vector. Fractional numbers are rounded upward.

Data Types: double

Settlement date, specified as an N-by-1 vector using serial date numbers.

Data Types: double

Output Arguments

collapse all

Modified duration, in years, for the pay-fix side of the swap, returned as a N-by-1 vector.

Modified duration, in years, for the receive-fix side of the swap, returned as a N-by-1 vector.

Introduced before R2006a