discount.rate function

Computing the rate of return for each period