1. Cash flows and discounting
In financial transactions cash flows from one party to another. This first video explains you how to value cash flows.
2. A cash flow
To set the scene: fix a capital unit, say 1 euro, and a time unit, say 1 year. Our notation uses 0 to denote the present moment (that's right now!) and k refers to k time units in the future. The amount of money to be received or paid at time k is ck, that's the cash flow at time k.
3. A vector of cash flows in R
Here's an example of a sequence of cash flows. This vector has 8 entries, the first one corresponds to time 0 and the last one to time 7. You create this vector in R, with entries 500, 400, 300 and then repeat 200 5 times using the rep() function. The length of the vector cash_flows is 8, as expected.
The timeline at the bottom shows a general notation for a cash flow vector which starts from c0 at time 0 and runs up to cN at time N. The length of this vector is N+1.
4. Valuation of a cash flow vector
It is crucial to value a cash flow vector.
Two things are important: the timing of cash flows and the time value of money. The time value of money implies that a euro that is available to you right now is worth more than a euro that is promised to you in the future. That's because the euro that you own today can be invested and grow. This growth is determined by the interest rate.
5. Interest rate and discount factor
Let's assume a constant interest rate, say i. This is the interest earned over one time period. The timeline on the left illustrates how 1 euro at time 0 grows to 1-point-03 euro at time 1. At the right side the discount factor v describes the inverse operation. 1 euro at time 1 discounts to 1/(1+i) euro, or v euro, at time 0. That's 0-point-97 euro in our example.
6. From one time period to k time periods
You can extend this idea to k time periods instead of just one. The timeline on the left shows how 1 euro at time 0 grows to (1+i)^k euro at time k. Or, in terms of v, the discount factor, that's v^(-k) euro. In the R code you see how this works with k=2 and a rate of 3%. You obtain 1-point-06 euro at time 2. The timeline on the right shows how 1 euro at time k discounts to v^k euro at time 0. From the R code you learn that 1 euro at time 2 is worth 0-point-94 euro at time 0.
7. The present value of a cash flow vector
Your goal is now to calculate the value at time 0 of the cash flows on this timeline. The first cash flow, 500 euro, is at time 0 and the last one, 200 euro, is at time 7.
8. The present value of a cash flow vector
This value at time 0 is called the present value. You find it by discounting each cash flow to time 0 and then taking the sum.
9. The present value of a cash flow vector in R
Define the interest rate i of 3% and the corresponding discount factor v. The vector discount_factors stores the applicable discount factors, obtained by raising v to the power 0 to 7 and cash_flows stores the cash flows from time 0 to 7. By multiplying both vectors pointwise, you obtain the present value of each of the cash flows. For example, 200 euro at time 7 is worth 162-point-6 euro at the present time. Finally, to obtain the present value of the entire cash flow vector, sum the discounted cash flows from the previous step.
10. Let's practice!
Now it's your turn to value some cash flows in R!