Displaying 1 result from an estimated 1 matches for "macualay".
Did you mean:
macaulay
2010 Jan 19
0
Macualay Duration code in a Functional Form - Please Help
# I have written this code in Notepad++ and copied here.
## ONS - PPA
Duration = function(par_value, coupon_rate, freq_coupon, tenure, ytm)
{
macaulay_duration = NULL
modified_duration = NULL
freq_coupon_new = NULL
if(freq_coupon <= 0)
{
freq_coupon_new = 365
}
if(freq_coupon > 0 & freq_coupon <= 1)
{
freq_coupon_new = 12
}
if(freq_coupon > 1 &