Valuation
1. Valuation
With a constant interest i and corresponding discount factor v calculations were pretty simple. You will now learn a more general notation and setting that is fundamental to go beyond a constant interest rate and to incorporate interest rates that may change over time.2. Discount factors
Let's fix two time points, s and t, and introduce the notation v(s,t) for the value at time s of one euro at time t. The second argument, t, refers to the point in time when you consider the 1 euro. If the first argument, s, is smaller than t, then v(s,t) is a discounting factor.3. Discount factors
But if s is larger than t, then v(s,t) is an accumulation factor such that 1 euro at t grows to v(s,t) euro at time s.4. Discount factors in R
Let's assume an interest rate of 3%. The corresponding discount factor v is 1/(1+i). In the first example set s to 2 and t to 4, v(2,4) is then the value at time 2 of 1 euro at time 4. That's 0-dot-94 euro. You can calculate this value in two equivalent ways: the discount factor v to the power 2, or 1 plus the interest rate i to the power (-2). The power, 2 in our example, corresponds to the number of time units that elapses between time points s and t.5. Discount factors in R
In the second example set s to 6 and t to 3, then v(6,3) tells you how 1 euro at time 3 grows to 1-dot-09 euro at time 6.6. Valuation of a cash flow vector
You now have a general mechanism to value a cash flow vector at any point in time. You convert each cash flow ck in the vector from time k to time n using discount factor v(n,k). The sum over all entries in the vector then gives you the value at time n. With n is equal to 0 you obtain the present value of the cash flow vector. When n is equal to capital N, the time point that corresponds to the last entry in the vector, you obtain the vector's accumulated value.7. Valuation of a cash flow vector in R
Let's do this in R.8. Valuation of a cash flow vector in R
You face a cash flow of 500 euro at time 0,9. Valuation of a cash flow vector in R
300 euro at time 210. Valuation of a cash flow vector in R
and 200 euro at time 7.11. Valuation of a cash flow vector in R
What is the value of this cash flow vector at time 3? You create a function discount with three arguments: s, t and i. The interest rate i has a default value of 0-dot-03 or 3%. The function returns 1 plus i raised to the negative time difference between t and s. Thus, when t is larger than s, the function discounts one euro at time t to time s. And when s is larger than t, the function accumulates one euro at time t to time s. Using this function you convert the cash flows in the timeline to time 3. With an interest rate of 3% the value at time 3 is 1033 euro.12. Valuation of a cash flow vector in R
Instead of repeatedly using the discount() function, you can vectorize this code. You call the function discount() with first argument s equal to 3, the point in time at which you want to value the cash flows. The second argument is now a vector running from 0 to 7, the points considered on the timeline. Thus, the vectorized function call returns a vector with the values at time 3 of 1 euro at time 0 to 7. Multiplying with the vector cash_flows and taking the sum returns the value of the given cash flows at time 3. That's again 1033 euro.13. Let's practice!
Now you're ready for some cash flow valuation in R.Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.