Page 1 of 1

Matlab libor duration

Posted: January 8th, 2005, 6:08 am
by jparekh
Can somebody please explain how does the Matlab function "libor duration" works?Given below is an example where i have given duration as per my calculations and also as per MatlabFor ExampleSwapFixRate = 0.0383;Tenor = 7;the fixed side of swap as per matlab has duration of 4.7567 (as given below)whereas when i calculate using classical method with principal repayment i get 6.17and if do not have principal payment i get duration as 3.47Matlab Description of the functionliborduration Duration of a LIBOR-based interest rate swap Syntax[PayFixDuration GetFixDuration] = liborduration(SwapFixRate, Tenor, Settle)ArgumentsSwapFixRate Swap fixed rate in decimal.Tenor Life of the swap in years. Fractional numbers are rounded upward.Settle Settlement date.Description[PayFixDuration GetFixDuration] = liborduration(SwapFixRate, Tenor, Settle) computes the duration of LIBOR-based interest rate swaps.PayFixDuration is the modified duration, in years, realized when entering pay-fix side of the swap. GetFixDuration is the modified duration, in years, realized when entering receive-fix side of the swap. ExamplesGiven the data SwapFixRate = 0.0383;Tenor = 7;Settle = datenum('11-Oct-2002');compute the swap durations. [PayFixDuration GetFixDuration] = liborduration(SwapFixRate,... Tenor, Settle)PayFixDuration = -4.7567GetFixDuration = 4.7567Text

Matlab libor duration

Posted: January 8th, 2005, 6:52 am
by daveangel
There is usually no principal exchange in a IR swap. Thats why Matlabs duration is less than yours. You have assumed that the fixed leg is like a bond.

Matlab libor duration

Posted: January 12th, 2005, 5:50 am
by jparekh
Thanks Daveangel for your reply.But i am still not able to reconcile the matlab duration (4.75) with calculated duration without principal (3.47).Appreciate your reply.Thanks and Regards,Jugal

Matlab libor duration

Posted: January 12th, 2005, 12:23 pm
by daveangel
whats the yield of the swap or better still whats its pv ?

Matlab libor duration

Posted: January 13th, 2005, 8:49 am
by jparekh
The yield of the swap is 3.83%.Regards,Jugal