Need a unique gift idea?
A Pastebin account makes a great Christmas gift


a guest Mar 13th, 2018 55 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
  1. def durations(cfs, rates, price, ytm, no_coupons):
  2.     import numpy as np
  3.     mac_dur = np.sum([cfs[i]*(i+1)/np.power(1+rates[i],i+1) for i in range(len(cfs))])/price
  4.     mod_dur = mac_dur/(1+ytm/no_coupons)
  5.     return mac_dur, mod_dur
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand