Compute Discounted Cash Flow for Buying a House as Investment

[ house  dcf  finance  ]

In this post, I apply DCF to evaluate whether it is a good idea to buy a house as investment. Here I use the numbers for a typical townhouse in bay area. Based on my analysis here, it may not be a good investment to buy a house for rent in Bay area–it could take more than 40 years to pay back your investment from rent, if doesn’t consider the value of selling house at the end of investment period. This could be even worse, if you could not use mortgage when buying the house.

Discounted Cash Flow or DCF is a valuation method used to estimate the value of an investment based on its expected future cash flows. DCF analysis attempts to figure out the value of an investment today, based on projections of how much money it will generate in the future. Please check previous post How to Evaluate a Company for Investment for more details.

Those are the assumptions I made for this analysis:

#@title Assumptions for Those Analysis { run: "auto", vertical-output: true }
# mortgage
# tax benefit is not considered
monthly_mortgage_payment = 2465 #@param {type:"number"}
anual_mortagate_interest_rate = 0.025 #@param {type:"slider", min:0, max:0.1, step:0.001}
term_of_mortgage_year = 30 #@param [0, 7, 15, 20, 30] {type:"raw"}

# other cost on house
anual_property_tax_rate = 0.0125 #@param {type:"slider", min:0, max:0.05, step:0.001}
# in some cases, hoa could increase as well
monthly_hoa_fee = 300 #@param {type:"slider", min:0, max:1000, step:1}
monthly_house_insurance = 100 #@param {type:"slider", min:0, max:1000, step:1}
# the fee to sell the house
house_sell_cost_ratio = 0.06 #@param {type:"slider", min:0, max:0.1, step:0.001}

# affect house price and property tax
anual_house_increase_rate = 0.03 #@param {type:"slider", min:0, max:1.0, step:0.001}

# initial cost of buying house
house_purchase_price = 780000 #@param {type:"slider", min:0, max:5000000, step:100}
downpay = 156000 #@param {type:"slider", min:0, max:5000000, step:1000}

# rent related
# tax is not considered
monthly_rent = 3000 #@param {type:"slider", min:0, max:50000, step:10}
anual_rent_occupied_month = 11 #@param {type:"slider", min:0, max:12, step:1}
anual_rent_increase_rate = 0.03 #@param {type:"slider", min:0, max:1.0, step:0.001}
years_to_rent = 30 #@param {type:"slider", min:0, max:100, step:1}

# use 10-year treasury bond as price of your money
anual_interest_rate = 0.04 #@param {type:"slider", min:0, max:0.1, step:0.001}

Then the DCF for buying the house can compute as:

def compute_dcf_from_rent(
    years_to_rent,
    anual_interest_rate,
    monthly_rent,
    anual_rent_occupied_month,
    anual_rent_increase_rate,
    monthly_hoa_fee,
    monthly_house_insurance,
    anual_property_tax_rate,
    house_purchase_price,
    anual_house_increase_rate,
    term_of_mortgage_year,
    monthly_mortgage_payment,
  ):
  result = 0.0
  income = []
  cost = []
  for year in range(years_to_rent):
    factor = (1 / (1 + anual_interest_rate)) ** year
    # rent income
    anual_rent_income = monthly_rent * anual_rent_occupied_month * ((1 + anual_rent_increase_rate) ** year)
    income.append(anual_rent_income)
    # house cost
    anual_house_cost = monthly_hoa_fee * 12 + monthly_house_insurance * 12 + anual_property_tax_rate * house_purchase_price * ((1 + anual_house_increase_rate) ** year)
    # if mortgate is still applicable
    if year < term_of_mortgage_year:
      anual_house_cost += monthly_mortgage_payment * 12
    cost.append(anual_house_cost)
    result += (anual_rent_income - anual_house_cost) * factor
  return result, income, cost

def compute_dcf_from_selling(
    year,
    downpay,
    house_purchase_price,
    anual_house_increase_rate,
    anual_mortagate_interest_rate,
    term_of_mortgage_year,
    house_sell_cost_ratio,
    anual_interest_rate,
):
  if year > term_of_mortgage_year:
    return (1 - house_sell_cost_ratio) * house_purchase_price * ((1 + anual_house_increase_rate) ** year) / ((1 + anual_interest_rate) ** year)
  a = (1 + anual_mortagate_interest_rate) ** year
  b = (1 + anual_mortagate_interest_rate) ** term_of_mortgage_year
  c = (b - a) / ((1 + anual_mortagate_interest_rate) ** (b - 1))
  balance_in_mortgage = (house_purchase_price - downpay) * c
  return ((1 - house_sell_cost_ratio) * house_purchase_price * (1 + anual_house_increase_rate) ** year - balance_in_mortgage) / ((1 + anual_interest_rate) ** year)

The code is available at colab. Note for this study, I didn’t consider any tax beyond property tax.

Buy a House with Mortgage

Use the assumptions I made above, then we could get DCF plot as below. So you could get your investment paid back even in 40 years, which makes it a terrible business. Here we don’t consider the income of selling the house at the end of investment.

download (9)

If we consider the income of selling the house at the end of investment, then we have the following plot. It shows we could the investment back at 4th year, which makes it more attractive investment.

download (10)

If you are interested in the anual income and cost, you could also look at following charts. It shows the income and cost breaks even in year 13.

download (11)

Buy a House in Cash

Here change downpay to the house purchase price and set monthly mortgage to 0:

monthly_mortgage_payment = 0 #@param {type:"number"}
term_of_mortgage_year = 0 #@param [0, 7, 15, 20, 30] {type:"raw"}
downpay = 780000 #@param {type:"slider", min:0, max:5000000, step:1000}

This is the DCF from rent. This indicates you will be far from getting your investment with in 40 years from rent. This means buying a house in cash for rent is terrible investment.

download (7)

This is the DCF combining rent and selling the house. Similar as buying a house with mortgage case, the investment is paid back in around 4 years, which makes it attractive.

download (8)

When House Price Doesn’t Increase

Let us also consider the scenario where house value doesn’t change at all. This means your property should not change as well.

Here is DCF from rent. It shows it pays back your investment at year 34.

download (12)

Here is DCF combining rent and house sell price. It shows it pays back your investment at year 16, compared with 4 years when house price increases 3% annually.

download (13)

Finally the cost vs income curve from rent. It breaks even at year 10.

download (14)

Written on March 20, 2021