Computing HPR, the holding period return
ear2hpr(ear, t)
ear
effective annual rate
t
number of days remaining until maturity
hpr2ear
hpr
ear2hpr(ear=0.05039,t=150)