DCF Analysis Using Python with an arbitrary example

A DCF (Discounted Cash Flow) analysis is a method of valuing a company by estimating its future cash flows and discounting them back to their present value. It can be used to estimate the intrinsic value of a stock and compare it to its current market price.

Here’s an example of how you might perform a DCF analysis for ZEEL (Zee Entertainment Enterprises Limited) using Python:

import numpy as np

# Estimate future cash flows
# Assume that ZEEL will have a revenue growth of 7% for the next 5 years
# and then a steady state growth rate of 3%
revenue_growth = [7, 7, 7, 7, 7, 3]
revenues = [1000, 1070, 1145, 1228, 1318, 1357]

# Estimate the operating income margin, 30% in the first 5 years and 25% thereafter
operating_income_margin = [0.3, 0.3, 0.3, 0.3, 0.3, 0.25]

# Project the operating income
operating_income = [r*m for r,m in zip(revenues, operating_income_margin)]

# estimate the free cash flows 
# Assume a tax rate of 25%, capital expenditure of 10% of revenues, and a change in working capital of 5% of revenues
tax_rate = 0.25
capex_rate = 0.1
working_capital_rate = 0.05

free_cash_flows = [oi*(1-tax_rate) - (r*capex_rate) - (r*working_capital_rate) for oi,r in zip(operating_income, revenues)]

# Estimate the terminal value
# Assume a WACC of 10% and a steady state growth rate of 3%
wacc = 0.1
steady_state_growth = 0.03

terminal_value = free_cash_flows[-1] * (1 + steady_state_growth) / (wacc - steady_state_growth)

# Discount the free cash flows
discount_factor = 1/(1+wacc)**np.arange(1,len(free_cash_flows)+1)

discounted_cash_flows = np.array(free_cash_flows) * discount_factor

# Calculate the intrinsic value
intrinsic_value = discounted_cash_flows.sum() + terminal_value

# Compare the intrinsic value to the current market price
market_price = 900 # current market price of ZEEL

if intrinsic_value > market_price:
    print("ZEEL is undervalued by: ", intrinsic_value - market_price)
else:
    print("ZEEL is overvalued by: ", market_price - intrinsic_value)

Please note, this is just an example and the assumptions used here such as growth rates, operating income margin, Tax rates, and working capital are very simplified and may not reflect the actuals.

Also please be aware that stock prices are subject to volatility and past performance is not indicative of future results.

2 Likes