Calculate discounted cash flows for a fixed net present value with some restrictions

57 Views Asked by At

I was wondering what my maximal investment in year zero can be, given certain ratio that is pre-specified between cash flows, for a fixed net present value:

This solution was offered by Bob:

If you can express the payment in each period as $CF_i = a_i x$ where $x$ is the sum to be paid. You can easily plug x in easily substitute this in the equation and calculate the value of $x$, once you know $x$ you can calculate $CF_i$

To determine $x$ start with

$$ PV = \sum_{i=0}^n \frac{CF_i}{(1+r)^i} = \sum_{i=0}^n \frac{a_i x}{(1+r)^i}$$

and solve

$$ x = \frac{PV}{\sum_{i=0}^n a_i{(1+r)^{-i}}} $$

Although it does provide a correct number, it only does so if the weight vector in itself does not require a sign switch (solutions I want to exclude).

However, this does not completely answer my question, which is the following:

When I give up a rental contract with a known series of cash flows, how much can I invest in a property in year zero when I use it for x number of years, with year 0 the time of obtaining the property and the last year the sale of the property.

The problem is the following:

I found that actually the fact if x is positive or negative, is independent of the amount of the value of (Net)PV (this is always a positive number in my case, the amount saved from giving up the rental contract). What I noticed is that the weight vector is what determines if the denominator in the x = ... formula is positive or negative. The nominator is always positive. So that's not really what I want although I get why it works like that. If PV is large enough, it should be able to calculate a series of cash flows that satisfies this PV (and weight vector).

I guess I could leave one or more a_i as an dependent variable... . And only require a_i*x in year zero to reach a certain minimum amount?

The problem is that in the current solution, the weight vector in itself must be "economically viable", so that the sign doesn't switch (and investments become costs). But that does not take into account that every year I also save some money by, in my case, terminating a rental contract. Whatever value you put for (N)PV, the resell price (weight) still needs to be adjust to form a solution. So I'm limited so solutions that hold a positive value for the property spending on itself. But I want to take into account the cost saving by giving up the rental place. So the property spending can be negative, by this amount.

The NPV saved I now put as the PV in the formula. But that doesn't influence the sign switching... . But I don't know how to bring the rental info into the weight vector maybe, and solve for NPV = 0. Which may make more sense... ?

Or are there just too many unknowns/free variables for this problem?

"'
# let's check if this works

test_npv = 100; # npv_RC_vec[length(npv_RC_vec)]#100; # these are the savings you make by giving up the rental place, calculated separately
weight_vector = c(-1, -0.05, -0.02, -0.02, -0.02, -0.02, -0.02, -0.02, -0.02, 1.55) # give in all !future values (they will be discounted)!, as a ratio of the initial investment in the first year (so always put -1 as a first element)
"
negative values: investments/costs
positive values: income
"

normalized_weight_vector = weight_vector/sum(weight_vector)
n = length(weight_vector)
denominator_vec = rep(-1,n)

for (denominator_i in 1:n) {
  
  denominator_current = weight_vector[denominator_i]*((1+actualisatiepercentage)^-denominator_i)
  denominator_vec[denominator_i] = denominator_current
  
}
(denominator_vec)
common_amount = test_npv /sum(denominator_vec)



cash_flow_vec = rep(-1,n)

for (cash_flow_i in 1:n) {
  
  cash_flow_current = weight_vector[cash_flow_i]*common_amount
  cash_flow_vec[cash_flow_i] = cash_flow_current
  
}


cf0 = 0
times = 1:length(cash_flow_vec)
# control result
npv = NPV(cf0,cash_flow_vec,times,actualisatiepercentage,plot=FALSE)

# print some results
if (common_amount < 0) {
  print("sorry no economically viable solution exists for these inputs => keeping the rental place is cheaper")
  print("I guess the resulting flow of cash will tell you how much money you lose each year given your weight distribution")
}
(npv)
(test_npv)
(weight_vector)
(cash_flow_vec)

sprintf("Your maximum allowed investment in the first year equals  %g", cash_flow_vec[1])

plot(times, cash_flow_vec, type ="b", ylab="cash flow in euro",xlab="years", lwd=2.5,mar=c(2,2,0,0),col="red")
points(times, rep(0, length(times)), col = "green", type = "l")

"'