Introduction to Financial Concepts in Python
Dakota Wixom
Quantitative Finance Analyst
$ WACC = F_{Equity} * C_{Equity} + F_{Debt} * C_{Debt} * (1 - TR) $
The proportion (%) of financing can be calculated as follows:
$ F_{Equity} = \frac{M_{Equity}}{M_{Total}} $
$ F_{Debt} = \frac{M_{Debt}}{M_{Total}} $
$ M_{Total} = M_{Debt} + M_{Equity} $
Example:
Calculate the WACC of a company with a 12% cost of debt, 14% cost of equity, 20% debt financing and 80% equity financing. Assume a 35% effective corporate tax rate.
percent_equity = 0.80
percent_debt = 0.20
cost_equity = 0.14
cost_debt = 0.12
tax_rate = 0.35
wacc = (percent_equity*cost_equity) + (percent_debt*cost_debt) *
(1 - tax_rate)
print(wacc)
0.1276
Example:
Calculate the NPV of a project that produces $100 in cash flow every year for 5 years. Assume a WACC of 13%.
cf_project1 = np.repeat(100, 5)
npv_project1 = np.npv(0.13, cf_project1)
print(npv_project1)
397.45
Introduction to Financial Concepts in Python