SigmaField

Practice Banking and corporate finance

Value a continuously paid income stream

Easy+10 pointsAbout 20 minutesBanking and corporate finance

The brief

A bank is arranging a 20-year loan to a solar farm, secured on its power sales. The farm sells power around the clock, so its income arrives continuously. It earns $2.4 million a year now, indexed to grow at a continuous 2% a year.

The bank's model values that income as a continuous stream. The buyer, though, pays at the end of each month for the power delivered in it. The credit team wants both values, and the cost of the monthly timing.

Your task

  1. Write pv_continuous(c0, g, r, T): the present value of income paid continuously at c0egtc_0 e^{gt} a year for TT years, discounted at the continuous rate rr. Raise ValueError if T is negative.
  2. Write monthly_payments(c0, g, T): the list of monthly payments, first month first. Payment mm is the income earned during month mm, paid at its end. Raise ValueError if T is negative or is not a whole number of months.
  3. Write pv_monthly(c0, g, r, T): the present value of those payments, each discounted at rr from the end of its month.

Keep full precision when gg equals rr or nearly does, and when gg is 0 or tiny.

The data

INCOME, GROWTH, RATE and YEARS in the code hold the farm's terms. Rates are annual decimals, continuously compounded, and times are in years.

Hint: Where to start

Lesson 2.5.5 values a growing stream as the integral of c0egte−rtc_0 e^{gt} e^{-rt} over [0,T][0, T]. Write the closed form with math.expm1, as that lesson does, so that a tiny r−gr - g keeps its digits.

Hint: The monthly payments

The income earned between times aa and bb is the integral of its rate from aa to bb (lesson 2.5.3). An antiderivative of c0egtc_0 e^{gt} is c0gegt\frac{c_0}{g} e^{gt} (lesson 2.5.2), so the payment is c0g(egb−ega)\frac{c_0}{g}\left(e^{gb} - e^{ga}\right). Factor out egae^{ga} and use math.expm1 for the rest.

Hint: Checking your answer

Paid at month ends, each month's income arrives on average half a month late. So the monthly value should be about e−r/24e^{-r/24} times the continuous one. In the same way, lesson 2.5.5 found mid-year payments worth almost as much as the continuous stream.