Fundamental Analysis
1. Fundamental Analysis
Introduction: The Foundation of Equity Valuation
Fundamental analysis is the cornerstone of equity valuation. It involves evaluating a company's intrinsic value by examining its financial statements, business model, competitive position, management quality, and industry dynamics. Unlike technical analysis, which focuses on price patterns and market sentiment, fundamental analysis seeks to understand the underlying business and determine whether a stock is undervalued or overvalued relative to its true worth.
Fundamental Analysis: A method of evaluating securities by attempting to measure the intrinsic value of a stock. It involves examining related economic, financial, and other qualitative and quantitative factors to determine a security's value. Fundamental analysis assumes that the market may misprice a security in the short run but will eventually correct itself to reflect the security's intrinsic value.
The fundamental analyst's goal is to determine the intrinsic value of a stock - the price that reflects all available information about the company's future cash flows, growth prospects, and risk profile. If the intrinsic value exceeds the current market price, the stock is undervalued and may represent a buying opportunity. If the intrinsic value is less than the market price, the stock is overvalued.
Theoretical Foundation: The Dividend Discount Model and DCF Framework
The theoretical foundation for fundamental analysis rests on the principle that a stock's value equals the present value of its future cash flows. This principle, formalized in the Dividend Discount Model (DDM) and Discounted Cash Flow (DCF) models, provides the conceptual framework that all fundamental analysis ultimately supports.
The fundamental equation of valuation states:
Where:
- 6 million (20% tax rate)
- Net Income: $19 million (19% net margin)
- Shares Outstanding: 10 million
- EPS: $1.90
Key Observations:
- Strong gross margin (60%) suggests pricing power
- Operating margin (30%) indicates efficient operations
- Net margin (19%) shows good profitability after all costs
Understanding the Balance Sheet
The balance sheet provides a snapshot of a company's financial position at a point in time. It follows the fundamental accounting equation:
Assets (what the company owns):
- Current Assets: Cash, accounts receivable, inventory (convertible to cash within 1 year)
- Non-Current Assets: Property, plant, equipment (PP&E), intangible assets, long-term investments
Liabilities (what the company owes):
- Current Liabilities: Accounts payable, short-term debt (due within 1 year)
- Non-Current Liabilities: Long-term debt, deferred taxes
Shareholders' Equity (what shareholders own):
- Common Stock: Par value of issued shares
- Retained Earnings: Cumulative profits not paid as dividends
- Additional Paid-In Capital: Amount paid above par value
Key Metrics from Balance Sheet:
- Working Capital: Current Assets - Current Liabilities
- Book Value: Total Assets - Total Liabilities = Shareholders' Equity
- Book Value Per Share: Shareholders' Equity ÷ Shares Outstanding
Understanding the Cash Flow Statement
The cash flow statement shows how cash enters and leaves the company. It has three sections:
Operating Activities: Cash from core business operations
- Net income (starting point)
- Adjustments for non-cash items (depreciation, amortization)
- Changes in working capital
- Operating Cash Flow: Net cash from operations
Investing Activities: Cash from buying/selling assets
- Capital expenditures (negative - cash out)
- Asset sales (positive - cash in)
- Acquisitions
- Cash from Investing: Net cash from investment activities
Financing Activities: Cash from borrowing, equity issuance, dividends
- Debt issuance/repayment
- Stock issuance/repurchase
- Dividends paid
- Cash from Financing: Net cash from financing activities
Free Cash Flow: The most important metric for valuation
Free cash flow represents cash available to shareholders after all operating expenses and necessary investments. It's the cash flow used in DCF valuation models.
Ratio Analysis: The Analytical Toolkit
Profitability Ratios
Gross Margin:
Measures pricing power and cost control. Higher gross margins indicate stronger competitive position.
Operating Margin:
Measures operating efficiency. Higher margins indicate better cost management.
Net Margin:
Measures overall profitability. Shows how much profit remains after all expenses.
Return on Assets (ROA):
Measures efficiency in using assets to generate profits. Higher ROA indicates better asset utilization.
Return on Equity (ROE):
Measures return on shareholders' investment. Can be decomposed using the DuPont formula:
Where:
- Net Margin = Net Income ÷ Revenue
- Asset Turnover = Revenue ÷ Total Assets
- Equity Multiplier = Total Assets ÷ Shareholders' Equity
The DuPont formula shows that ROE is driven by three factors: profitability (net margin), efficiency (asset turnover), and leverage (equity multiplier). This decomposition helps identify whether a company's ROE comes from operational excellence, efficient asset use, or financial leverage. Let's visualize the DuPont analysis:
Python exercise
#| label: dupont-analysis-enhanced
#| fig-cap: "DuPont Analysis: Enhanced Visualization showing ROE = Net Margin × Asset Turnover × Equity Multiplier decomposition"
#| fig-width: 16
#| fig-height: 10
#| echo: false
#| warning: false
# Sandbox metadata (auto-generated from lesson.ts)
# libraries: numpy, matplotlib, pandas
import numpy as np
import matplotlib.pyplot as plt
from IPython.display import display
# Example companies for DuPont analysis
companies = ['Company A\n(High Profitability)', 'Company B\n(High Efficiency)',
'Company C\n(High Leverage)', 'Company D\n(Balanced)']
# Financial data
net_incomes = [50, 30, 20, 40] # Millions
revenues = [500, 600, 200, 400] # Millions
total_assets = [1000, 500, 800, 600] # Millions
shareholders_equity = [500, 400, 200, 300] # Millions
# Calculate DuPont components
net_margins = [ni / rev for ni, rev in zip(net_incomes, revenues)]
asset_turnovers = [rev / ta for rev, ta in zip(revenues, total_assets)]
equity_multipliers = [ta / se for ta, se in zip(total_assets, shareholders_equity)]
roes = [nm * at * em for nm, at, em in zip(net_margins, asset_turnovers, equity_multipliers)]
# Create figure
fig, axes = plt.subplots(2, 2, figsize=(16, 12))
fig.suptitle('DuPont Analysis: ROE = Net Margin × Asset Turnover × Equity Multiplier',
fontsize=16, fontweight='bold')
# Plot 1: ROE Components
ax1 = axes[0, 0]
x = np.arange(len(companies))
width = 0.2
bars1 = ax1.bar(x - 1.5*width, [nm * 100 for nm in net_margins], width,
label='Net Margin (%)', color='blue', alpha=0.7, edgecolor='black', linewidth=1.5)
bars2 = ax1.bar(x - 0.5*width, asset_turnovers, width,
label='Asset Turnover', color='green', alpha=0.7, edgecolor='black', linewidth=1.5)
bars3 = ax1.bar(x + 0.5*width, equity_multipliers, width,
label='Equity Multiplier', color='orange', alpha=0.7, edgecolor='black', linewidth=1.5)
bars4 = ax1.bar(x + 1.5*width, [roe * 100 for roe in roes], width,
label='ROE (%)', color='red', alpha=0.7, edgecolor='black', linewidth=1.5)
ax1.set_xlabel('Company', fontsize=12, fontweight='bold')
ax1.set_ylabel('Value', fontsize=12, fontweight='bold')
ax1.set_title('DuPont Components: Net Margin, Asset Turnover, Equity Multiplier, and ROE',
fontsize=13, fontweight='bold')
ax1.set_xticks(x)
ax1.set_xticklabels(companies)
ax1.legend(loc='best', fontsize=9)
ax1.grid(True, alpha=0.3, linestyle='--', axis='y')
# Add value labels
for bars, values, scale in [(bars1, net_margins, 100), (bars2, asset_turnovers, 1),
(bars3, equity_multipliers, 1), (bars4, roes, 100)]:
for bar, val in zip(bars, values):
height = bar.get_height()
ax1.text(bar.get_x() + bar.get_width()/2., height + height*0.02,
f'{val*scale:.2f}', ha='center', va='bottom',
fontsize=8, fontweight='bold')
# Plot 2: DuPont Decomposition Visualization
ax2 = axes[0, 1]
# Show how components multiply to get ROE
colors_comp = ['blue', 'green', 'orange', 'red']
component_names = ['Net Margin', 'Asset Turnover', 'Equity Multiplier', 'ROE']
# Use Company D as example
example_idx = 3
example_components = [net_margins[example_idx], asset_turnovers[example_idx],
equity_multipliers[example_idx], roes[example_idx]]
example_values = [example_components[0] * 100, example_components[1],
example_components[2], example_components[3] * 100]
bars = ax2.bar(range(len(component_names)), example_values,
color=colors_comp, alpha=0.7, edgecolor='black', linewidth=1.5)
ax2.set_xlabel('Component', fontsize=12, fontweight='bold')
ax2.set_ylabel('Value', fontsize=12, fontweight='bold')
ax2.set_title(f'DuPont Decomposition Example (Company D)\nROE = {net_margins[example_idx]:.2%} × {asset_turnovers[example_idx]:.2f} × {equity_multipliers[example_idx]:.2f} = {roes[example_idx]:.2%}',
fontsize=13, fontweight='bold')
ax2.set_xticks(range(len(component_names)))
ax2.set_xticklabels(component_names, rotation=15, ha='right')
ax2.grid(True, alpha=0.3, linestyle='--', axis='y')
# Add value labels
for bar, val, comp in zip(bars, example_values, component_names):
height = bar.get_height()
if comp == 'Net Margin' or comp == 'ROE':
label = f'{val:.2f}%'
else:
label = f'{val:.2f}'
ax2.text(bar.get_x() + bar.get_width()/2., height + height*0.02,
label, ha='center', va='bottom',
fontsize=10, fontweight='bold')
# Add formula annotation
ax2.text(0.02, 0.98, f'Formula:\nROE = Net Margin × Asset Turnover × Equity Multiplier\n\nCalculation:\n= {net_margins[example_idx]:.2%} × {asset_turnovers[example_idx]:.2f} × {equity_multipliers[example_idx]:.2f}\n= {roes[example_idx]:.2%}',
transform=ax2.transAxes, fontsize=10, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='lightblue', alpha=0.9),
verticalalignment='top', family='monospace')
# Plot 3: ROE Comparison
ax3 = axes[1, 0]
bars = ax3.bar(range(len(companies)), [roe * 100 for roe in roes],
color=plt.cm.RdYlGn(np.array(roes) / max(roes)),
alpha=0.7, edgecolor='black', linewidth=1.5)
ax3.set_xlabel('Company', fontsize=12, fontweight='bold')
ax3.set_ylabel('ROE (%)', fontsize=12, fontweight='bold')
ax3.set_title('ROE Comparison Across Companies', fontsize=13, fontweight='bold')
ax3.set_xticks(range(len(companies)))
ax3.set_xticklabels(companies, rotation=15, ha='right')
ax3.grid(True, alpha=0.3, linestyle='--', axis='y')
# Add value labels
for bar, roe in zip(bars, roes):
height = bar.get_height()
ax3.text(bar.get_x() + bar.get_width()/2., height + 0.5,
f'{roe*100:.2f}%', ha='center', va='bottom',
fontsize=10, fontweight='bold')
# Plot 4: Component Contribution Analysis
ax4 = axes[1, 1]
# Show contribution of each component to ROE
component_contributions = []
for i in range(len(companies)):
contrib = {
'Net Margin': net_margins[i] * 100,
'Asset Turnover': asset_turnovers[i],
'Equity Multiplier': equity_multipliers[i]
}
component_contributions.append(contrib)
# Create grouped bar chart
x = np.arange(len(companies))
width = 0.25
bars1 = ax4.bar(x - width, [nm * 100 for nm in net_margins], width,
label='Net Margin (%)', color='blue', alpha=0.7, edgecolor='black', linewidth=1.5)
bars2 = ax4.bar(x, asset_turnovers, width,
label='Asset Turnover', color='green', alpha=0.7, edgecolor='black', linewidth=1.5)
bars3 = ax4.bar(x + width, equity_multipliers, width,
label='Equity Multiplier', color='orange', alpha=0.7, edgecolor='black', linewidth=1.5)
ax4.set_xlabel('Company', fontsize=12, fontweight='bold')
ax4.set_ylabel('Component Value', fontsize=12, fontweight='bold')
ax4.set_title('DuPont Component Comparison: Driving ROE', fontsize=13, fontweight='bold')
ax4.set_xticks(x)
ax4.set_xticklabels(companies, rotation=15, ha='right')
ax4.legend(loc='best', fontsize=9)
ax4.grid(True, alpha=0.3, linestyle='--', axis='y')
# Add value labels
for bars, values, scale in [(bars1, net_margins, 100), (bars2, asset_turnovers, 1),
(bars3, equity_multipliers, 1)]:
for bar, val in zip(bars, values):
height = bar.get_height()
ax4.text(bar.get_x() + bar.get_width()/2., height + height*0.02,
f'{val*scale:.2f}', ha='center', va='bottom',
fontsize=8, fontweight='bold')
plt.tight_layout()
display(fig)
plt.close(fig)
print(f"\n📊 **DuPont Analysis**")
print(f"{'='*70}")
print(f"Formula: ROE = Net Margin × Asset Turnover × Equity Multiplier")
print(f" where Net Margin = Net Income / Revenue")
print(f" Asset Turnover = Revenue / Total Assets")
print(f" Equity Multiplier = Total Assets / Shareholders' Equity")
print(f"{'='*70}")
print(f"Company Analysis:")
print(f"{'Company':<25} {'Net Margin':<15} {'Asset Turnover':<18} {'Equity Mult':<15} {'ROE':<10}")
print(f"{'-'*70}")
for i, (comp, nm, at, em, roe) in enumerate(zip(companies, net_margins, asset_turnovers, equity_multipliers, roes)):
print(f"{comp.replace(chr(10), ' '):<25} {nm*100:>12.2f}% {at:>15.2f} {em:>12.2f} {roe*100:>8.2f}%")
print(f"{'='*70}")
print(f"Key Insights:")
print(f" • Company A: High profitability drives ROE")
print(f" • Company B: High efficiency (asset turnover) drives ROE")
print(f" • Company C: High leverage (equity multiplier) drives ROE")
print(f" • Company D: Balanced approach across all components")
print(f"{'='*70}")
print(f"✅ DuPont analysis reveals how companies achieve their ROE")
print(f"✅ Different strategies (profitability, efficiency, leverage) can yield same ROE")
print(f"✅ Understanding components helps identify improvement opportunities")Return on Invested Capital (ROIC):
Where:
- NOPAT = EBIT × (1 - Tax Rate)
- Invested Capital = Total Assets - Non-Interest-Bearing Current Liabilities
ROIC measures return on capital invested in the business, regardless of financing structure.
Liquidity Ratios
Current Ratio:
Measures ability to meet short-term obligations. Ratio > 1 indicates sufficient liquidity.
Quick Ratio (Acid Test):
More conservative than current ratio (excludes inventory, which may not be liquid).
Leverage Ratios
Debt-to-Equity Ratio:
Measures financial leverage. Higher ratios indicate more debt financing.
Interest Coverage Ratio:
Measures ability to service debt. Higher ratios indicate better debt service capacity.
Efficiency Ratios
Asset Turnover:
Measures efficiency in using assets to generate revenue. Higher turnover indicates better asset utilization.
Inventory Turnover:
Measures how quickly inventory is sold. Higher turnover indicates efficient inventory management.
Qualitative Analysis: Beyond the Numbers
While financial statements provide quantitative data, fundamental analysis requires understanding qualitative factors that affect a company's competitive position and future prospects.
Business Model Analysis
Revenue Model: How does the company generate revenue?
- Subscription: Recurring revenue (e.g., SaaS companies)
- Transaction-based: Revenue per transaction (e.g., retailers)
- Advertising: Revenue from advertising (e.g., social media)
- Licensing: Revenue from intellectual property (e.g., software)
Cost Structure: What are the company's cost drivers?
- Fixed vs. Variable Costs: Companies with high fixed costs have operating leverage
- Economies of Scale: Do costs decrease as volume increases?
- Cost Advantages: Does the company have lower costs than competitors?
Competitive Analysis
Competitive Moat: What protects the company from competition?
- Brand: Strong brand loyalty (e.g., Coca-Cola)
- Network Effects: Value increases with users (e.g., Facebook)
- Cost Advantages: Lower costs than competitors (e.g., Walmart)
- Regulatory Barriers: Protected by regulations (e.g., utilities)
- Switching Costs: High cost to switch products (e.g., enterprise software)
Market Position: What is the company's position in its industry?
- Market Share: What percentage of the market does it serve?
- Market Leadership: Is it a leader or follower?
- Growth vs. Value: Is it growing or mature?
Management Quality
Management Assessment: Are executives capable and aligned with shareholders?
- Track Record: Historical performance
- Capital Allocation: How management uses capital
- Communication: Transparency and clarity
- Compensation: Alignment with shareholder interests
Corporate Governance: How is the company governed?
- Board Independence: Independent directors
- Shareholder Rights: Protection of minority shareholders
- Ethical Standards: Corporate ethics and responsibility
Industry and Macro Analysis
Industry Analysis: What is the industry's structure and prospects?
- Industry Lifecycle: Growth, mature, or decline?
- Competitive Intensity: How competitive is the industry?
- Regulatory Environment: How do regulations affect the industry?
- Technology Disruption: Risk of technological disruption
Macroeconomic Factors: How sensitive is the company to economic cycles?
- Cyclical vs. Defensive: Does performance vary with economic cycles?
- Interest Rate Sensitivity: How do interest rates affect the business?
- Inflation Impact: How does inflation affect costs and pricing?
The Fundamental Analysis Process
A systematic approach to fundamental analysis involves several steps that build upon each other to form a comprehensive investment thesis. While experienced analysts may combine or skip steps based on the specific situation, following a structured process ensures that you don't miss critical information and helps you form a well-reasoned investment conclusion.
Step 1: Company Overview
The first step is to understand what the company does and how it operates. This involves understanding the business model - how does the company make money? What products or services does it sell, and to whom? Identifying revenue sources helps you assess the diversity and sustainability of the business. Understanding the competitive position - where the company stands in its industry - provides context for interpreting financial results. This qualitative overview sets the foundation for all subsequent analysis.
Step 2: Financial Statement Analysis
The second step involves a thorough review of the financial statements. You should review the income statement, balance sheet, and cash flow statement to understand the company's profitability, financial position, and cash generation. Calculating key financial ratios transforms raw numbers into comparable metrics. Identifying trends over time - looking at multiple periods rather than just the most recent - helps you understand whether the company is improving, deteriorating, or stable. This quantitative analysis provides the factual foundation for your investment thesis.
Step 3: Competitive Analysis
The third step compares the company to its industry peers. Comparing ratios to industry peers helps you understand whether the company's performance is strong or weak relative to competitors. This analysis might reveal that a company with a 15% ROE is actually excellent if peers average 10%, or poor if peers average 25%. Assessing competitive position involves understanding market share, pricing power, and competitive advantages or disadvantages. This comparative analysis helps you understand whether the company's valuation is justified or whether it might be mispriced relative to peers.
Step 4: Management Assessment
The fourth step evaluates the people running the company. Evaluating management quality involves assessing their track record, capital allocation decisions, and communication with shareholders. Assessing corporate governance examines board independence, shareholder rights, and ethical standards. Reviewing strategic direction helps you understand management's plans for the future and whether those plans are reasonable and achievable. This assessment is crucial because even the best business can be destroyed by poor management, while excellent management can create value in difficult situations.
Step 5: Valuation
The fifth step estimates the company's intrinsic value. This involves estimating future cash flows - projecting how much cash the company will generate in the future. Determining the appropriate discount rate reflects the risk of those cash flows - riskier companies require higher returns. Calculating intrinsic value uses valuation models (DCF, DDM, multiples) to estimate what the company is worth. Comparing to market price determines whether the stock is undervalued (market price < intrinsic value) or overvalued (market price > intrinsic value). This valuation step is the core of fundamental analysis - it's where you determine whether an investment opportunity exists.
Step 6: Investment Decision
The final step synthesizes all the analysis into an investment decision. This involves asking: Is the stock undervalued or overvalued? If it's undervalued, by how much? What is the margin of safety? - how much room for error do you have if your analysis is wrong? What are the risks? - what could go wrong that would make this investment lose money? Does it fit the investment strategy? - does this stock align with your investment objectives, risk tolerance, and portfolio construction? This final step requires judgment - there's no formula that tells you definitively whether to buy or sell, but a thorough fundamental analysis provides the information needed to make an informed decision.
Knowledge Check 6.1
Which of the following is NOT a component of fundamental analysis?
A. Financial statement analysis
B. Ratio analysis
C. Price chart patterns
D. Qualitative business analysis
Click to reveal answer
C. Price chart patterns
Price chart patterns are part of technical analysis, not fundamental analysis. Fundamental analysis focuses on:
- Financial statement analysis (quantitative)
- Ratio analysis (quantitative)
- Qualitative business analysis (qualitative factors like business model, management, competitive position)
Technical analysis, in contrast, focuses on price patterns, trends, and market sentiment rather than underlying business fundamentals.
Practice Problem 6.1: Financial Statement Analysis
Company XYZ has the following financial information for 2023:
Income Statement:
- Revenue: 5 billion ÷ $250 million = 20.0x
Both methods yield the same result: investors are paying 20 times the company's annual earnings.
Let's visualize the P/E ratio formula with enhanced examples:
Python exercise
#| label: pe-ratio-formula-enhanced
#| fig-cap: "P/E Ratio Formula: Enhanced Visualization showing P/E = Price / EPS with Multiple Examples and Interpretation"
#| fig-width: 16
#| fig-height: 10
#| echo: false
#| warning: false
# Sandbox metadata (auto-generated from lesson.ts)
# libraries: numpy, matplotlib, pandas
import numpy as np
import matplotlib.pyplot as plt
from IPython.display import display
# Example companies
companies = ['Growth Stock\n(High P/E)', 'Value Stock\n(Moderate P/E)',
'Cheap Stock\n(Low P/E)', 'Company DEF\n(Example)']
prices = [60, 30, 16, 50]
eps_values = [2.00, 2.00, 2.00, 2.50]
pe_ratios = [p / e for p, e in zip(prices, eps_values)]
# Market cap basis (for comparison)
market_caps = [6.0, 3.0, 1.6, 5.0] # Billions
net_incomes = [0.2, 0.2, 0.2, 0.25] # Billions
pe_ratios_mcap = [mc / ni for mc, ni in zip(market_caps, net_incomes)]
# P/E interpretation
pe_categories = ['Very Low\n(<10x)', 'Low\n(10-15x)', 'Moderate\n(15-20x)',
'High\n(20-30x)', 'Very High\n(>30x)']
pe_ranges = [8, 12.5, 17.5, 25, 35]
pe_colors = ['green', 'lightgreen', 'yellow', 'orange', 'red']
# Create figure
fig, axes = plt.subplots(2, 2, figsize=(16, 12))
fig.suptitle('P/E Ratio Formula: P/E = Price / EPS - Enhanced Visualization',
fontsize=16, fontweight='bold')
# Plot 1: P/E Components
ax1 = axes[0, 0]
x = np.arange(len(companies))
width = 0.35
bars1 = ax1.bar(x - width/2, prices, width, label='Stock Price ($)', color='blue', alpha=0.7,
edgecolor='black', linewidth=1.5)
bars2 = ax1.bar(x + width/2, eps_values, width, label='EPS ($)', color='green', alpha=0.7,
edgecolor='black', linewidth=1.5)
ax1.set_xlabel('Company', fontsize=12, fontweight='bold')
ax1.set_ylabel('Amount ($)', fontsize=12, fontweight='bold')
ax1.set_title('P/E Ratio Components: Price and Earnings Per Share', fontsize=13, fontweight='bold')
ax1.set_xticks(x)
ax1.set_xticklabels(companies, rotation=15, ha='right')
ax1.legend(loc='best', fontsize=9)
ax1.grid(True, alpha=0.3, linestyle='--', axis='y')
# Add P/E values on top
for i, (price, eps, pe) in enumerate(zip(prices, eps_values, pe_ratios)):
max_val = max(price, eps)
ax1.text(i, max_val + max_val*0.1, f'P/E = {pe:.1f}x\n({price}/{eps})',
ha='center', fontsize=9, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='yellow', alpha=0.8))
# Add formula annotation
ax1.text(0.02, 0.98, 'Formula:\nP/E = Price / EPS\n\nExample (Company DEF):\nP/E = $50 / $2.50\n= 20.0x',
transform=ax1.transAxes, fontsize=10, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='lightblue', alpha=0.9),
verticalalignment='top', family='monospace')
# Plot 2: P/E Ratio Comparison
ax2 = axes[0, 1]
bars = ax2.bar(range(len(companies)), pe_ratios,
color=plt.cm.RdYlGn(np.array(pe_ratios) / max(pe_ratios)),
alpha=0.7, edgecolor='black', linewidth=1.5)
ax2.set_xlabel('Company', fontsize=12, fontweight='bold')
ax2.set_ylabel('P/E Ratio (x)', fontsize=12, fontweight='bold')
ax2.set_title('P/E Ratio Comparison Across Companies', fontsize=13, fontweight='bold')
ax2.set_xticks(range(len(companies)))
ax2.set_xticklabels(companies, rotation=15, ha='right')
ax2.grid(True, alpha=0.3, linestyle='--', axis='y')
# Add value labels
for bar, pe in zip(bars, pe_ratios):
height = bar.get_height()
ax2.text(bar.get_x() + bar.get_width()/2., height + 1,
f'{pe:.1f}x', ha='center', va='bottom',
fontsize=10, fontweight='bold')
# Add interpretation zones
ax2.axhline(y=10, color='green', linestyle='--', linewidth=1.5, alpha=0.5, label='Low (10x)')
ax2.axhline(y=20, color='orange', linestyle='--', linewidth=1.5, alpha=0.5, label='Moderate (20x)')
ax2.axhline(y=30, color='red', linestyle='--', linewidth=1.5, alpha=0.5, label='High (30x)')
ax2.legend(loc='best', fontsize=9)
# Plot 3: P/E Interpretation Zones
ax3 = axes[1, 0]
bars = ax3.barh(range(len(pe_categories)), pe_ranges,
color=pe_colors, alpha=0.7, edgecolor='black', linewidth=1.5)
ax3.set_xlabel('P/E Ratio (x)', fontsize=12, fontweight='bold')
ax3.set_ylabel('Category', fontsize=12, fontweight='bold')
ax3.set_title('P/E Ratio Interpretation Zones', fontsize=13, fontweight='bold')
ax3.set_yticks(range(len(pe_categories)))
ax3.set_yticklabels(pe_categories)
ax3.grid(True, alpha=0.3, linestyle='--', axis='x')
# Add value labels
for bar, pe_range in zip(bars, pe_ranges):
width = bar.get_width()
ax3.text(width + 1, bar.get_y() + bar.get_height()/2,
f'{pe_range}x', fontsize=10, fontweight='bold', va='center')
# Mark where our examples fall
for i, pe in enumerate(pe_ratios[:3]):
if 0 <= pe <= 40:
# Find category
if pe < 10:
cat_idx = 0
elif pe < 15:
cat_idx = 1
elif pe < 20:
cat_idx = 2
elif pe < 30:
cat_idx = 3
else:
cat_idx = 4
ax3.plot(pe, cat_idx, 'ro', markersize=12, zorder=5)
ax3.annotate(f'{companies[i].split()[0]}\n{pe:.1f}x',
xy=(pe, cat_idx), xytext=(pe + 2, cat_idx + 0.3),
fontsize=9, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='yellow', alpha=0.8),
arrowprops=dict(arrowstyle='->', color='red', lw=1.5))
# Plot 4: Market Cap vs Price Basis (Method Comparison)
ax4 = axes[1, 1]
x = np.arange(len(companies))
width = 0.35
bars1 = ax4.bar(x - width/2, pe_ratios, width,
label='Method 1: Price/EPS', color='blue', alpha=0.7, edgecolor='black', linewidth=1.5)
bars2 = ax4.bar(x + width/2, pe_ratios_mcap, width,
label='Method 2: Market Cap/Net Income', color='green', alpha=0.7,
edgecolor='black', linewidth=1.5)
ax4.set_xlabel('Company', fontsize=12, fontweight='bold')
ax4.set_ylabel('P/E Ratio (x)', fontsize=12, fontweight='bold')
ax4.set_title('P/E Calculation: Two Equivalent Methods', fontsize=13, fontweight='bold')
ax4.set_xticks(x)
ax4.set_xticklabels(companies, rotation=15, ha='right')
ax4.legend(loc='best', fontsize=9)
ax4.grid(True, alpha=0.3, linestyle='--', axis='y')
# Add value labels
for bars, pes in [(bars1, pe_ratios), (bars2, pe_ratios_mcap)]:
for bar, pe in zip(bars, pes):
height = bar.get_height()
ax4.text(bar.get_x() + bar.get_width()/2., height + 0.5,
f'{pe:.1f}x', ha='center', va='bottom',
fontsize=9, fontweight='bold')
# Add annotation showing equivalence
ax4.text(0.5, 0.98, 'Both methods yield same result:\nP/E = Price/EPS = Market Cap/Net Income',
transform=ax4.transAxes, ha='center', va='top',
fontsize=10, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='lightgreen', alpha=0.9))
plt.tight_layout()
display(fig)
plt.close(fig)
print(f"\n📊 **P/E Ratio Formula Analysis**")
print(f"{'='*70}")
print(f"Formula: P/E = Price / EPS")
print(f" Alternative: P/E = Market Cap / Net Income")
print(f" where Price = stock price per share")
print(f" EPS = earnings per share")
print(f"{'='*70}")
print(f"Example Companies:")
print(f"{'Company':<25} {'Price':<12} {'EPS':<12} {'P/E Ratio':<12}")
print(f"{'-'*70}")
for i, (comp, price, eps, pe) in enumerate(zip(companies, prices, eps_values, pe_ratios)):
print(f"{comp.replace(chr(10), ' '):<25} ${price:>8.2f} ${eps:>8.2f} {pe:>10.1f}x")
print(f"{'='*70}")
print(f"Interpretation:")
print(f" • P/E = 30x: Paying $30 for $1 of earnings (high expectations)")
print(f" • P/E = 15x: Paying $15 for $1 of earnings (moderate)")
print(f" • P/E = 8x: Paying $8 for $1 of earnings (low expectations)")
print(f"{'='*70}")
print(f"✅ P/E shows how many years of earnings to recover stock price")
print(f"✅ Higher P/E = higher growth expectations or lower risk")
print(f"✅ Lower P/E = lower growth expectations or higher risk")Python exercise
#| label: fig-pe-ratio-visualization
#| fig-cap: "P/E Ratio: Understanding Price Relative to Earnings"
#| fig-width: 14
#| fig-height: 8
# Sandbox metadata (auto-generated from lesson.ts)
# libraries: numpy, matplotlib, pandas
import matplotlib.pyplot as plt
from IPython.display import display
import numpy as np
# Create figure
fig, axes = plt.subplots(1, 2, figsize=(16, 8))
fig.suptitle('Price-to-Earnings (P/E) Ratio: How Many Years of Earnings to Recover Stock Price', fontsize=16, fontweight='bold')
# Left plot: P/E ratio calculation breakdown
ax1 = axes[0]
# Example companies with different P/E ratios
companies = ['Growth Stock\n(P/E = 30x)', 'Value Stock\n(P/E = 15x)', 'Cheap Stock\n(P/E = 8x)']
prices = [60, 30, 16]
eps_values = [2.00, 2.00, 2.00]
pe_ratios = [p/e for p, e in zip(prices, eps_values)]
# Create grouped bar chart
x = np.arange(len(companies))
width = 0.35
bars1 = ax1.bar(x - width/2, prices, width, label='Stock Price ($)', color='#2E86AB', alpha=0.8)
bars2 = ax1.bar(x + width/2, eps_values, width, label='Earnings Per Share ($)', color='#A23B72', alpha=0.8)
ax1.set_xlabel('Stock', fontsize=12, fontweight='bold')
ax1.set_ylabel('Amount ($)', fontsize=12, fontweight='bold')
ax1.set_title('P/E Ratio Components: Price vs. Earnings', fontsize=13, fontweight='bold')
ax1.set_xticks(x)
ax1.set_xticklabels(companies)
ax1.legend(fontsize=10)
ax1.grid(True, alpha=0.3, linestyle='--', axis='y')
# Add P/E ratio labels
for i, (price, eps, pe) in enumerate(zip(prices, eps_values, pe_ratios)):
ax1.text(i, max(price, eps) + 3, f'P/E = {pe:.0f}x\n({pe:.0f} years)',
ha='center', fontsize=9, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='wheat', alpha=0.7))
# Right plot: P/E ratio categories and interpretation
ax2 = axes[1]
# P/E ratio ranges
pe_categories = ['Very High\n(30x+)', 'High\n(20-30x)', 'Moderate\n(15-20x)', 'Low\n(10-15x)', 'Very Low\n(<10x)']
pe_midpoints = [35, 25, 17.5, 12.5, 8]
colors_pe = ['#FF6B6B', '#FFA07A', '#4ECDC4', '#96CEB4', '#45B7D1']
bars = ax2.barh(pe_categories, pe_midpoints, color=colors_pe, alpha=0.8, edgecolor='black', linewidth=1.5)
ax2.set_xlabel('P/E Ratio (x)', fontsize=12, fontweight='bold')
ax2.set_title('P/E Ratio Categories and Typical Interpretation', fontsize=13, fontweight='bold')
ax2.grid(True, alpha=0.3, linestyle='--', axis='x')
ax2.set_xlim(0, 40)
# Add value labels and interpretations
for bar, val in zip(bars, pe_midpoints):
width = bar.get_width()
ax2.text(width + 1, bar.get_y() + bar.get_height()/2,
f'{val:.1f}x', fontsize=10, fontweight='bold', va='center')
# Add interpretation annotations
interpretations = ['Growth\nExpected', 'Growth\nPremium', 'Fair\nValue', 'Value\nStock', 'Deep\nValue']
for i, (bar, interp) in enumerate(zip(bars, interpretations)):
ax2.text(-5, bar.get_y() + bar.get_height()/2,
interp, fontsize=9, fontweight='bold', va='center', ha='right',
bbox=dict(boxstyle='round', facecolor='white', alpha=0.7))
# Add formula
fig.text(0.5, 0.02, 'P/E Ratio = Stock Price ÷ Earnings Per Share = Market Capitalization ÷ Net Income',
ha='center', fontsize=13, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='lightblue', alpha=0.8))
plt.tight_layout()
display(fig)
plt.close(fig)Types of P/E Ratios
Trailing P/E (Historical P/E)
Trailing P/E uses earnings from the past 12 months (Trailing Twelve Months, or TTM).
Characteristics:
- Based on actual, reported earnings
- More reliable (uses realized data)
- Most commonly cited P/E ratio
- Also called "P/E TTM"
Advantages:
- Uses actual earnings (no estimation required)
- Objective and verifiable
- Reflects what the company has actually earned
Limitations:
- Backward-looking (doesn't reflect future prospects)
- May be distorted by one-time items
- Doesn't account for future growth
Forward P/E (Leading P/E)
Forward P/E uses estimated earnings for the next 12 months.
Characteristics:
- Based on analyst earnings estimates
- Forward-looking (reflects future prospects)
- More relevant for growth companies
- Also called "P/E LTM" (Leading Twelve Months)
Advantages:
- Forward-looking (reflects future earnings)
- More relevant for valuation
- Better for comparing growth companies
Limitations:
- Depends on earnings estimates (may be inaccurate)
- Estimates may be biased or optimistic
- Different analysts may have different estimates
Example: Trailing vs. Forward P/E
Company GHI has:
- Current stock price: $75 per share
- Trailing 12-month EPS: $3.00
- Estimated next 12-month EPS: $4.00 (analyst consensus)
Trailing P/E:
$75 ÷ $3.00 = 25.0x
Forward P/E:
$75 ÷ $4.00 = 18.75x
The forward P/E is lower because analysts expect earnings to grow from $3.00 to $4.00 (33% growth). The forward P/E better reflects the company's valuation relative to expected future earnings.
Let's visualize the difference between trailing and forward P/E ratios:
Python exercise
#| label: trailing-forward-pe-comparison
#| fig-cap: "Trailing vs. Forward P/E: Comparison showing TTM vs. forward P/E with earnings timeline"
#| fig-width: 16
#| fig-height: 10
#| echo: false
#| warning: false
# Sandbox metadata (auto-generated from lesson.ts)
# libraries: numpy, matplotlib, pandas
import numpy as np
import matplotlib.pyplot as plt
from IPython.display import display
from datetime import datetime, timedelta
# Example: Company with growing earnings
stock_price = 75
trailing_eps = 3.00
forward_eps = 4.00
trailing_pe = stock_price / trailing_eps
forward_pe = stock_price / forward_eps
growth_rate = ((forward_eps / trailing_eps) - 1) * 100
# Create earnings timeline (quarters)
quarters = ['Q1\nT-3', 'Q2\nT-2', 'Q3\nT-1', 'Q4\nT-0', 'Q1\nT+1', 'Q2\nT+2', 'Q3\nT+3', 'Q4\nT+4']
# Historical earnings (backward)
historical_eps = [2.5, 2.7, 2.8, 3.0] # Last 4 quarters
# Future estimated earnings (forward)
future_eps = [4.0, 4.2, 4.4, 4.6] # Next 4 quarters
all_eps = historical_eps + future_eps
# Timeline dates
today = datetime.now()
dates = [today - timedelta(days=270-i*90) for i in range(7, -1, -1)]
# Create figure
fig, axes = plt.subplots(2, 2, figsize=(16, 12))
fig.suptitle('Trailing vs. Forward P/E: Comparison with Earnings Timeline',
fontsize=16, fontweight='bold')
# Plot 1: Earnings Timeline
ax1 = axes[0, 0]
x_pos = np.arange(len(quarters))
colors_timeline = ['gray'] * 4 + ['blue'] * 4
bars = ax1.bar(x_pos, all_eps, color=colors_timeline, alpha=0.7, edgecolor='black', linewidth=1.5)
# Add divider between trailing and forward
ax1.axvline(x=3.5, color='red', linestyle='--', linewidth=2, alpha=0.7, label='Today (T-0)')
ax1.set_xlabel('Quarter', fontsize=12, fontweight='bold')
ax1.set_ylabel('Earnings Per Share ($)', fontsize=12, fontweight='bold')
ax1.set_title('Earnings Timeline: Trailing vs. Forward', fontsize=13, fontweight='bold')
ax1.set_xticks(x_pos)
ax1.set_xticklabels(quarters)
ax1.grid(True, alpha=0.3, linestyle='--', axis='y')
ax1.legend(loc='best', fontsize=9)
# Add value labels
for i, (bar, eps) in enumerate(zip(bars, all_eps)):
height = bar.get_height()
ax1.text(bar.get_x() + bar.get_width()/2., height + 0.1,
f'${eps:.2f}', ha='center', va='bottom',
fontsize=9, fontweight='bold')
# Add annotations
ax1.text(1.5, max(all_eps) + 0.3, 'Trailing 12 Months (TTM)',
ha='center', fontsize=11, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='lightgray', alpha=0.8))
ax1.text(5.5, max(all_eps) + 0.3, 'Forward 12 Months',
ha='center', fontsize=11, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='lightblue', alpha=0.8))
# Add average lines
ttm_avg = trailing_eps
forward_avg = forward_eps
ax1.axhline(y=ttm_avg, color='red', linestyle=':', linewidth=2, alpha=0.7,
label=f'TTM Avg: ${ttm_avg:.2f}')
ax1.axhline(y=forward_avg, color='blue', linestyle=':', linewidth=2, alpha=0.7,
label=f'Forward Avg: ${forward_avg:.2f}')
# Plot 2: P/E Ratio Comparison
ax2 = axes[0, 1]
pe_types = ['Trailing P/E\n(TTM)', 'Forward P/E\n(Estimated)']
pe_values = [trailing_pe, forward_pe]
colors_pe = ['red', 'blue']
bars = ax2.bar(range(len(pe_types)), pe_values,
color=colors_pe, alpha=0.7, edgecolor='black', linewidth=1.5)
ax2.set_xlabel('P/E Type', fontsize=12, fontweight='bold')
ax2.set_ylabel('P/E Ratio (x)', fontsize=12, fontweight='bold')
ax2.set_title('P/E Ratio Comparison: Trailing vs. Forward', fontsize=13, fontweight='bold')
ax2.set_xticks(range(len(pe_types)))
ax2.set_xticklabels(pe_types)
ax2.grid(True, alpha=0.3, linestyle='--', axis='y')
# Add value labels
for bar, pe, label in zip(bars, pe_values, ['Trailing', 'Forward']):
height = bar.get_height()
ax2.text(bar.get_x() + bar.get_width()/2., height + 0.5,
f'{pe:.2f}x', ha='center', va='bottom',
fontsize=11, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='white', alpha=0.9))
# Add formula annotations
ax2.text(0.02, 0.98, f'Trailing P/E:\n= ${stock_price:.0f} / ${trailing_eps:.2f}\n= {trailing_pe:.2f}x\n\nForward P/E:\n= ${stock_price:.0f} / ${forward_eps:.2f}\n= {forward_pe:.2f}x',
transform=ax2.transAxes, fontsize=10, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='lightyellow', alpha=0.9),
verticalalignment='top', family='monospace')
# Add difference arrow
diff = trailing_pe - forward_pe
ax2.annotate(f'Difference: {diff:.2f}x\n({(diff/trailing_pe)*100:.1f}% lower)',
xy=(1, forward_pe), xytext=(0.5, forward_pe + 3),
fontsize=10, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='lightgreen', alpha=0.9),
arrowprops=dict(arrowstyle='->', color='green', lw=2))
# Plot 3: Earnings Growth Impact
ax3 = axes[1, 0]
# Simulate different growth scenarios
growth_scenarios = [0, 10, 20, 33, 50, 75] # Percentage growth
forward_eps_scenarios = [trailing_eps * (1 + g/100) for g in growth_scenarios]
forward_pe_scenarios = [stock_price / eps for eps in forward_eps_scenarios]
# Create array of trailing_pe values (constant line)
trailing_pe_array = [trailing_pe] * len(growth_scenarios)
ax3.plot(growth_scenarios, trailing_pe_array, 'r--', linewidth=2.5, alpha=0.7,
label=f'Trailing P/E = {trailing_pe:.2f}x (constant)', marker='o', markersize=10)
ax3.plot(growth_scenarios, forward_pe_scenarios, 'b-', linewidth=3, alpha=0.8,
label='Forward P/E (varies with growth)', marker='s', markersize=10)
# Mark current scenario
current_idx = growth_scenarios.index(33)
ax3.plot(33, forward_pe, 'go', markersize=15, markeredgewidth=2, markeredgecolor='white',
zorder=5, label=f'Current: {growth_rate:.0f}% growth')
ax3.annotate(f'Current Scenario\nGrowth: {growth_rate:.0f}%\nForward P/E: {forward_pe:.2f}x',
xy=(33, forward_pe), xytext=(33 + 10, forward_pe + 2),
fontsize=10, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='yellow', alpha=0.9),
arrowprops=dict(arrowstyle='->', color='green', lw=2))
ax3.set_xlabel('Expected Earnings Growth (%)', fontsize=12, fontweight='bold')
ax3.set_ylabel('P/E Ratio (x)', fontsize=12, fontweight='bold')
ax3.set_title('Forward P/E vs. Earnings Growth Rate', fontsize=13, fontweight='bold')
ax3.grid(True, alpha=0.3, linestyle='--')
ax3.legend(loc='best', fontsize=9)
# Add interpretation zones
ax3.axhspan(0, trailing_pe * 0.8, alpha=0.1, color='green', label='Lower P/E (Better Value)')
ax3.axhspan(trailing_pe * 1.2, 50, alpha=0.1, color='red', label='Higher P/E (Premium)')
# Plot 4: When to Use Each Metric
ax4 = axes[1, 1]
# Create comparison table visualization
comparison_categories = ['Data Source', 'Time Horizon', 'Reliability', 'Best For']
trailing_characteristics = ['Historical\nEarnings', 'Past 12\nMonths', 'High\n(Actual)', 'Mature\nCompanies']
forward_characteristics = ['Estimated\nEarnings', 'Next 12\nMonths', 'Medium\n(Estimated)', 'Growth\nCompanies']
x_pos_comparison = np.arange(len(comparison_categories))
width_comparison = 0.35
bars1 = ax4.bar(x_pos_comparison - width_comparison/2, [1, 1, 1, 1], width_comparison,
label='Trailing P/E', color='red', alpha=0.7, edgecolor='black', linewidth=1.5)
bars2 = ax4.bar(x_pos_comparison + width_comparison/2, [1, 1, 1, 1], width_comparison,
label='Forward P/E', color='blue', alpha=0.7, edgecolor='black', linewidth=1.5)
ax4.set_xlabel('Comparison Category', fontsize=12, fontweight='bold')
ax4.set_ylabel('Characteristic', fontsize=12, fontweight='bold')
ax4.set_title('Trailing vs. Forward P/E: When to Use Each', fontsize=13, fontweight='bold')
ax4.set_xticks(x_pos_comparison)
ax4.set_xticklabels(comparison_categories, rotation=15, ha='right')
ax4.set_yticks([])
ax4.legend(loc='upper left', fontsize=9)
ax4.grid(True, alpha=0.3, linestyle='--', axis='x')
# Add text annotations
for i, (trail, forward) in enumerate(zip(trailing_characteristics, forward_characteristics)):
ax4.text(i - width_comparison/2, 0.5, trail, ha='center', va='center',
fontsize=9, fontweight='bold', color='white')
ax4.text(i + width_comparison/2, 0.5, forward, ha='center', va='center',
fontsize=9, fontweight='bold', color='white')
# Add summary text box
ax4.text(0.5, 0.02, 'Key Insight: Forward P/E is more relevant for valuation\nbut depends on earnings estimates accuracy',
transform=ax4.transAxes, ha='center', va='bottom',
fontsize=10, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='lightgreen', alpha=0.9))
plt.tight_layout()
display(fig)
plt.close(fig)
print(f"\n📊 **Trailing vs. Forward P/E Analysis**")
print(f"{'='*70}")
print(f"Trailing P/E = Current Price / Trailing 12-Month EPS")
print(f"Forward P/E = Current Price / Estimated Next 12-Month EPS")
print(f"{'='*70}")
print(f"Example: Stock Price = ${stock_price:.2f}")
print(f" Trailing EPS: ${trailing_eps:.2f}")
print(f" Forward EPS: ${forward_eps:.2f} (estimated)")
print(f" Expected Growth: {growth_rate:.1f}%")
print(f"{'='*70}")
print(f"Trailing P/E: {trailing_pe:.2f}x = ${stock_price:.2f} / ${trailing_eps:.2f}")
print(f"Forward P/E: {forward_pe:.2f}x = ${stock_price:.2f} / ${forward_eps:.2f}")
print(f"Difference: {diff:.2f}x ({((diff/trailing_pe)*100):.1f}% lower)")
print(f"{'='*70}")
print(f"✅ Trailing P/E uses actual earnings (more reliable)")
print(f"✅ Forward P/E reflects future prospects (more relevant)")
print(f"✅ Forward P/E typically lower when earnings growing")
print(f"✅ Forward P/E better for growth company valuation")Interpreting P/E Ratios
What Does a P/E Ratio Mean?
High P/E Ratio (e.g., 30x or higher):
- Investors are paying a premium for earnings
- May indicate:
- High growth expectations
- Strong competitive position
- Overvaluation (if growth doesn't materialize)
- Often associated with growth stocks
Low P/E Ratio (e.g., 10x or lower):
- Investors are paying less for earnings
- May indicate:
- Low growth expectations
- Company in decline
- Undervaluation (if company is actually healthy)
- Often associated with value stocks
Moderate P/E Ratio (e.g., 15-20x):
- Reasonable valuation relative to earnings
- May indicate:
- Stable, mature company
- Moderate growth expectations
- Fair valuation
P/E Ratio Interpretation Framework
Interpreting P/E ratios requires context - a P/E of 20 might be expensive for one company and cheap for another, depending on growth, risk, and profitability. A systematic framework for interpreting P/E ratios helps you avoid common mistakes and identify when a stock might be mispriced.
1. Compare to Historical P/E
The first step is to compare the current P/E to the company's own historical average. Is the current P/E higher or lower than the company's historical average? This tells you whether the stock is trading at a premium or discount to its own historical valuation. If a company typically trades at a P/E of 15x but is currently trading at 25x, that's a significant premium that might indicate overvaluation - unless something fundamental has changed (new growth prospects, improved profitability, reduced risk). High relative to history may indicate overvaluation - investors might be overly optimistic. Low relative to history may indicate undervaluation - investors might be overly pessimistic, or the company might have fundamental problems.
2. Compare to Industry Peers
The second step is to compare the P/E to similar companies in the same industry. Is the P/E higher or lower than similar companies? This helps you understand whether the stock is valued appropriately relative to its peers. Higher P/E may indicate superior growth prospects or competitive position - the market might be willing to pay more because it expects this company to outperform peers. Lower P/E may indicate inferior prospects or undervaluation - the company might have weaker fundamentals than peers, or it might be undervalued if its fundamentals are actually strong.
3. Compare to Market Average
The third step is to compare the P/E to the overall market average. S&P 500 average P/E is typically 15-20x, though this varies with market conditions. Higher than market may indicate premium company - the stock might deserve a premium due to superior growth, profitability, or quality. Lower than market may indicate value opportunity - the stock might be undervalued, or it might simply be a lower-quality company that deserves a discount.
4. Consider Growth Rate
The fourth and perhaps most important step is to evaluate the P/E relative to the company's growth rate. P/E should be evaluated relative to earnings growth - a high P/E ratio is justified if the company has high growth prospects, but not if growth is low or negative. This is captured in the PEG ratio (P/E to Growth), which adjusts P/E for growth. High P/E justified by high growth (PEG ratio) - a P/E of 30 might be reasonable if the company is growing earnings at 30% per year (PEG = 1.0). High P/E without growth may indicate overvaluation - a P/E of 30 with 5% growth (PEG = 6.0) suggests the stock is expensive relative to its growth prospects.
Drivers of P/E Ratios
Understanding what drives P/E ratios is crucial for valuation analysis. The P/E ratio is determined by several factors that interact in complex ways. Two companies with identical earnings might have very different P/E ratios because investors have different expectations about their future prospects. Understanding these drivers helps you interpret P/E ratios correctly and identify when a high or low P/E ratio is justified versus when it might indicate mispricing.
The P/E ratio reflects the market's collective assessment of a company's future prospects, discounted to the present. When investors see a high P/E ratio, they're essentially saying: "We're willing to pay more for this company's earnings because we expect them to grow, or because we view the company as less risky, or because we believe it has superior profitability." Similarly, a low P/E ratio might indicate pessimism about growth, concerns about risk, or perception of inferior profitability.
Let's visualize how the key drivers - growth, risk, and profitability - affect P/E ratios:
Python exercise
#| label: pe-drivers-visualization
#| fig-cap: "P/E Drivers: Interactive visualization showing how growth, risk, and profitability affect P/E ratios"
#| fig-width: 16
#| fig-height: 10
#| echo: false
#| warning: false
# Sandbox metadata (auto-generated from lesson.ts)
# libraries: numpy, matplotlib, pandas
import numpy as np
import matplotlib.pyplot as plt
from IPython.display import display
# Base parameters
base_eps = 2.00
base_price = 30
base_pe = base_price / base_eps
# Create figure
fig, axes = plt.subplots(2, 2, figsize=(16, 12))
fig.suptitle('P/E Drivers: How Growth, Risk, and Profitability Affect P/E Ratios',
fontsize=16, fontweight='bold')
# Plot 1: Growth Rate Impact
ax1 = axes[0, 0]
growth_rates = np.linspace(0, 30, 100) # 0% to 30% growth
# Simplified P/E model: P/E ≈ (1 - g/r) / (r - g) where r = required return
# Simplified: Higher growth → Higher P/E (assuming constant discount rate)
required_return = 0.12 # 12% required return
pe_by_growth = [15 + (g/100) * 50 for g in growth_rates] # Simplified relationship
ax1.plot(growth_rates, pe_by_growth, 'b-', linewidth=3, alpha=0.8, label='P/E vs Growth')
ax1.axvline(x=3, color='red', linestyle='--', linewidth=2, alpha=0.7, label='Low Growth (3%)')
ax1.axvline(x=15, color='green', linestyle='--', linewidth=2, alpha=0.7, label='High Growth (15%)')
ax1.plot(3, pe_by_growth[3], 'ro', markersize=12, markeredgewidth=2, markeredgecolor='white', zorder=5)
ax1.plot(15, pe_by_growth[50], 'go', markersize=12, markeredgewidth=2, markeredgecolor='white', zorder=5)
ax1.set_xlabel('Expected Earnings Growth Rate (%)', fontsize=12, fontweight='bold')
ax1.set_ylabel('P/E Ratio (x)', fontsize=12, fontweight='bold')
ax1.set_title('Driver 1: Growth Rate → Higher Growth = Higher P/E', fontsize=13, fontweight='bold')
ax1.grid(True, alpha=0.3, linestyle='--')
ax1.legend(loc='upper left', fontsize=9)
# Add annotations
ax1.annotate(f'Company A\n(Low Growth)\nP/E ≈ {pe_by_growth[3]:.1f}x',
xy=(3, pe_by_growth[3]), xytext=(3 + 5, pe_by_growth[3] + 5),
fontsize=9, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='lightcoral', alpha=0.9),
arrowprops=dict(arrowstyle='->', color='red', lw=2))
ax1.annotate(f'Company B\n(High Growth)\nP/E ≈ {pe_by_growth[50]:.1f}x',
xy=(15, pe_by_growth[50]), xytext=(15 + 5, pe_by_growth[50] + 5),
fontsize=9, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='lightgreen', alpha=0.9),
arrowprops=dict(arrowstyle='->', color='green', lw=2))
# Plot 2: Risk (Required Return) Impact
ax2 = axes[0, 1]
risk_levels = np.linspace(8, 20, 100) # 8% to 20% required return
# Higher risk → Higher discount rate → Lower P/E
# Simplified: P/E ≈ 1 / (r - g) where g = 5% constant
constant_growth = 5
pe_by_risk = [1 / ((r/100 - constant_growth/100) + 0.01) * 15 for r in risk_levels]
pe_by_risk = np.clip(pe_by_risk, 5, 50) # Clamp to reasonable range
ax2.plot(risk_levels, pe_by_risk, 'r-', linewidth=3, alpha=0.8, label='P/E vs Risk')
ax2.axvline(x=10, color='green', linestyle='--', linewidth=2, alpha=0.7, label='Low Risk (10% req return)')
ax2.axvline(x=16, color='red', linestyle='--', linewidth=2, alpha=0.7, label='High Risk (16% req return)')
# Find indices
low_risk_idx = int((10 - 8) / (20 - 8) * 100)
high_risk_idx = int((16 - 8) / (20 - 8) * 100)
ax2.plot(10, pe_by_risk[low_risk_idx], 'go', markersize=12, markeredgewidth=2,
markeredgecolor='white', zorder=5)
ax2.plot(16, pe_by_risk[high_risk_idx], 'ro', markersize=12, markeredgewidth=2,
markeredgecolor='white', zorder=5)
ax2.set_xlabel('Required Rate of Return (%)', fontsize=12, fontweight='bold')
ax2.set_ylabel('P/E Ratio (x)', fontsize=12, fontweight='bold')
ax2.set_title('Driver 2: Risk → Higher Risk = Lower P/E', fontsize=13, fontweight='bold')
ax2.grid(True, alpha=0.3, linestyle='--')
ax2.legend(loc='upper right', fontsize=9)
# Add annotations
ax2.annotate(f'Low Risk Company\nP/E ≈ {pe_by_risk[low_risk_idx]:.1f}x',
xy=(10, pe_by_risk[low_risk_idx]), xytext=(10 - 2, pe_by_risk[low_risk_idx] + 3),
fontsize=9, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='lightgreen', alpha=0.9),
arrowprops=dict(arrowstyle='->', color='green', lw=2))
ax2.annotate(f'High Risk Company\nP/E ≈ {pe_by_risk[high_risk_idx]:.1f}x',
xy=(16, pe_by_risk[high_risk_idx]), xytext=(16 + 1, pe_by_risk[high_risk_idx] + 3),
fontsize=9, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='lightcoral', alpha=0.9),
arrowprops=dict(arrowstyle='->', color='red', lw=2))
# Plot 3: ROE (Profitability) Impact
ax3 = axes[1, 0]
roe_levels = np.linspace(5, 25, 100) # 5% to 25% ROE
# Higher ROE → Higher P/E (via P/E = P/B / ROE relationship)
# For constant P/B, higher ROE → lower P/E, but in practice higher ROE → higher P/B → higher P/E
# Simplified: Higher ROE allows for higher P/E
pb_ratio = 2.0 # Constant P/B for illustration
pe_by_roe_via_pb = [pb_ratio / (roe/100) for roe in roe_levels] # Direct relationship
# But in practice, higher ROE → higher P/B, so:
pe_by_roe_practical = [10 + (roe - 5) * 1.2 for roe in roe_levels] # Practical relationship
ax3.plot(roe_levels, pe_by_roe_practical, 'g-', linewidth=3, alpha=0.8,
label='P/E vs ROE (Practical)')
ax3.axvline(x=10, color='red', linestyle='--', linewidth=2, alpha=0.7, label='Low ROE (10%)')
ax3.axvline(x=20, color='green', linestyle='--', linewidth=2, alpha=0.7, label='High ROE (20%)')
low_roe_idx = int((10 - 5) / (25 - 5) * 100)
high_roe_idx = int((20 - 5) / (25 - 5) * 100)
ax3.plot(10, pe_by_roe_practical[low_roe_idx], 'ro', markersize=12, markeredgewidth=2,
markeredgecolor='white', zorder=5)
ax3.plot(20, pe_by_roe_practical[high_roe_idx], 'go', markersize=12, markeredgewidth=2,
markeredgecolor='white', zorder=5)
ax3.set_xlabel('Return on Equity (ROE) (%)', fontsize=12, fontweight='bold')
ax3.set_ylabel('P/E Ratio (x)', fontsize=12, fontweight='bold')
ax3.set_title('Driver 3: Profitability (ROE) → Higher ROE = Higher P/E', fontsize=13, fontweight='bold')
ax3.grid(True, alpha=0.3, linestyle='--')
ax3.legend(loc='upper left', fontsize=9)
# Add annotations
ax3.annotate(f'Low ROE Company\nP/E ≈ {pe_by_roe_practical[low_roe_idx]:.1f}x',
xy=(10, pe_by_roe_practical[low_roe_idx]), xytext=(10 - 3, pe_by_roe_practical[low_roe_idx] + 2),
fontsize=9, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='lightcoral', alpha=0.9),
arrowprops=dict(arrowstyle='->', color='red', lw=2))
ax3.annotate(f'High ROE Company\nP/E ≈ {pe_by_roe_practical[high_roe_idx]:.1f}x',
xy=(20, pe_by_roe_practical[high_roe_idx]), xytext=(20 + 2, pe_by_roe_practical[high_roe_idx] + 2),
fontsize=9, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='lightgreen', alpha=0.9),
arrowprops=dict(arrowstyle='->', color='green', lw=2))
# Plot 4: Combined Effect (3D Surface Projection)
ax4 = axes[1, 1]
# Create example companies with different combinations
companies = ['Low Growth\nLow ROE\nHigh Risk', 'Moderate\nAll Factors',
'High Growth\nHigh ROE\nLow Risk', 'Low Growth\nHigh ROE\nLow Risk']
pe_values_example = [8, 15, 30, 18]
growth_values = [3, 8, 15, 5]
roe_values = [8, 12, 20, 18]
risk_values = [16, 12, 10, 11]
colors_example = ['red', 'orange', 'green', 'lightgreen']
bars = ax4.bar(range(len(companies)), pe_values_example,
color=colors_example, alpha=0.7, edgecolor='black', linewidth=1.5)
ax4.set_xlabel('Company Profile', fontsize=12, fontweight='bold')
ax4.set_ylabel('P/E Ratio (x)', fontsize=12, fontweight='bold')
ax4.set_title('Combined Effect: Multiple Drivers Interact', fontsize=13, fontweight='bold')
ax4.set_xticks(range(len(companies)))
ax4.set_xticklabels(companies, rotation=15, ha='right')
ax4.grid(True, alpha=0.3, linestyle='--', axis='y')
# Add value labels with drivers
for i, (bar, pe, g, roe, risk) in enumerate(zip(bars, pe_values_example, growth_values, roe_values, risk_values)):
height = bar.get_height()
ax4.text(bar.get_x() + bar.get_width()/2., height + 1,
f'P/E: {pe:.0f}x\nG: {g}% | ROE: {roe}% | R: {risk}%',
ha='center', va='bottom',
fontsize=8, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='white', alpha=0.9))
# Add formula annotation
ax4.text(0.02, 0.98, 'Key Drivers:\n• Growth Rate (↑ → P/E ↑)\n• Risk (↑ → P/E ↓)\n• ROE/Profitability (↑ → P/E ↑)\n\nAll factors interact\nsimultaneously',
transform=ax4.transAxes, fontsize=10, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='lightyellow', alpha=0.9),
verticalalignment='top', family='monospace')
plt.tight_layout()
display(fig)
plt.close(fig)
print(f"\n📊 **P/E Drivers Analysis**")
print(f"{'='*70}")
print(f"P/E Ratio is driven by multiple factors:")
print(f" 1. Growth Rate: Higher growth → Higher P/E")
print(f" 2. Risk (Required Return): Higher risk → Lower P/E")
print(f" 3. Profitability (ROE): Higher ROE → Higher P/E")
print(f"{'='*70}")
print(f"Example Companies:")
print(f"{'Company':<30} {'Growth':<10} {'ROE':<10} {'Risk':<10} {'P/E':<10}")
print(f"{'-'*70}")
for i, (comp, pe, g, roe, risk) in enumerate(zip(companies, pe_values_example,
growth_values, roe_values, risk_values)):
print(f"{comp.replace(chr(10), ' '):<30} {g:>8.0f}% {roe:>8.0f}% {risk:>8.0f}% {pe:>8.0f}x")
print(f"{'='*70}")
print(f"✅ All drivers interact simultaneously")
print(f"✅ High growth + Low risk + High ROE = High P/E")
print(f"✅ Low growth + High risk + Low ROE = Low P/E")
print(f"✅ Understanding drivers helps interpret P/E ratios")1. Earnings Growth Rate
Higher growth → Higher P/E
Companies with higher expected earnings growth typically command higher P/E ratios. This makes intuitive sense: if you expect a company's earnings to double in five years, you'd be willing to pay more today for those future earnings than if you expected earnings to remain flat. Investors are essentially paying a premium today for earnings that will grow rapidly in the future.
The relationship between growth and P/E is fundamental to valuation. A company with strong growth prospects can justify a high P/E ratio because the future earnings will be much larger than current earnings. Conversely, a company with no growth prospects should trade at a lower P/E ratio because there's no expectation of future earnings expansion.
Mathematical Relationship:
The P/E ratio can be related to growth through the Gordon Growth Model (simplified):
Where:
- 1 of equity, while a company with a 10% ROE generates only $0.10. Investors are willing to pay more (higher P/E) for companies that generate higher returns on their equity investment.
The relationship between P/E and ROE is mathematically captured through the P/B ratio. Since P/E = P/B ÷ ROE, a company with a higher ROE can justify a higher P/E ratio, all else equal. This relationship is fundamental to valuation: two companies with the same P/B ratio will have different P/E ratios if they have different ROEs. The company with higher ROE will have the higher P/E ratio because it generates more earnings per dollar of book value.
Relationship:
This formula shows that P/E is inversely related to ROE when holding P/B constant. However, in practice, companies with higher ROE often have higher P/B ratios as well, so the relationship is more complex. Higher ROE allows for higher P/E, but it also typically leads to higher P/B, creating a virtuous cycle for high-quality companies.
4. Dividend Policy
Higher dividends → May affect P/E
Companies that pay higher dividends may have different P/E ratios, though the relationship is complex and depends on investor preferences and market conditions. High dividend payouts may reduce growth because less money is retained in the business for reinvestment. A company that pays out 80% of earnings as dividends has only 20% left to reinvest for growth, which might limit future earnings expansion. However, dividends provide current income, which is valued by income-focused investors who prefer cash today over uncertain growth tomorrow.
The dividend preference varies by investor type and market conditions. In low-interest-rate environments, dividend-paying stocks become more attractive relative to bonds, potentially supporting higher P/E ratios. Growth investors might prefer companies that reinvest earnings rather than pay dividends, while income investors might prefer high dividend payers. The net effect on P/E ratios depends on the balance of these preferences in the market.
5. Market Sentiment and Psychology
Bull markets → Higher P/E ratios
Bear markets → Lower P/E ratios
Market-wide sentiment affects P/E ratios significantly, sometimes more than fundamentals. During bull markets, investors are optimistic about the future, confident that earnings will grow, and willing to pay higher multiples for current earnings. This optimism can push P/E ratios above levels justified by fundamentals. During bear markets, fear and pessimism dominate. Investors worry about future earnings, demand higher returns to compensate for perceived risks, and push P/E ratios below levels justified by fundamentals.
This sentiment-driven variation in P/E ratios creates opportunities for value investors. When market sentiment is extremely negative, high-quality companies might trade at P/E ratios that are unjustifiably low based on their fundamentals. Conversely, when sentiment is extremely positive, average companies might trade at P/E ratios that are unjustifiably high. Understanding market sentiment helps you interpret P/E ratios in context and identify when market psychology is driving prices away from fundamental value.
6. Industry and Sector Characteristics
Different industries have different typical P/E ratios due to their inherent characteristics - growth prospects, risk profiles, capital intensity, and regulatory environments all vary by industry. Comparing a company's P/E ratio to its industry average is often more meaningful than comparing it to the overall market average.
High P/E Industries typically include industries with strong growth potential, even if current earnings are modest. Technology companies often trade at high P/E ratios because investors expect rapid earnings growth as new technologies are adopted. Biotechnology companies trade at high P/E ratios because of speculative growth potential - investors are betting on future drug approvals and market expansion. Consumer discretionary companies often have high P/E ratios during economic expansions when cyclical growth is expected.
Low P/E Industries typically include industries with slower growth, higher risk, or regulatory constraints. Utilities trade at lower P/E ratios because they have slow, predictable growth and are heavily regulated, limiting their ability to expand. Financials often have lower P/E ratios due to regulatory capital requirements and the cyclical nature of the business. Energy companies trade at lower P/E ratios because they're commodity-driven, with earnings that fluctuate with commodity prices rather than company-specific factors.
The PEG Ratio: Adjusting P/E for Growth
The PEG ratio (Price/Earnings to Growth) adjusts the P/E ratio for expected earnings growth, providing a more nuanced valuation metric.
Where the growth rate is typically expressed as a percentage (e.g., 15% = 0.15 in the formula, or 15 in the denominator if using percentage directly).
Interpretation:
- PEG < 1: Potentially undervalued - growth rate exceeds P/E ratio
- PEG = 1: Fairly valued - growth rate matches P/E ratio
- PEG > 1: Potentially overvalued - P/E ratio exceeds growth rate
The PEG ratio helps adjust for growth expectations, making P/E ratios more comparable across companies with different growth rates. Let's visualize the PEG ratio:
Python exercise
#| label: peg-ratio-formula-enhanced
#| fig-cap: "PEG Ratio Formula: Enhanced Visualization showing PEG = P/E / Growth Rate with Interpretation"
#| fig-width: 16
#| fig-height: 10
#| echo: false
#| warning: false
# Sandbox metadata (auto-generated from lesson.ts)
# libraries: numpy, matplotlib, pandas
import numpy as np
import matplotlib.pyplot as plt
from IPython.display import display
# Example companies
companies = ['Growth Stock A\n(High Growth)', 'Growth Stock B\n(Moderate Growth)',
'Value Stock\n(Low Growth)', 'Overvalued Stock\n(High P/E, Low Growth)']
pe_ratios = [30, 20, 15, 40]
growth_rates = [30, 15, 5, 10] # Percentage
peg_ratios = [pe / g for pe, g in zip(pe_ratios, growth_rates)]
# PEG interpretation zones
peg_categories = ['Undervalued\n(PEG < 0.75)', 'Fair Value\n(PEG 0.75-1.5)',
'Expensive\n(PEG 1.5-2.5)', 'Very Expensive\n(PEG > 2.5)']
peg_colors = ['green', 'lightgreen', 'orange', 'red']
peg_zones = [0.5, 1.0, 2.0, 3.5]
# Create figure
fig, axes = plt.subplots(2, 2, figsize=(16, 12))
fig.suptitle('PEG Ratio Formula: PEG = P/E / Growth Rate - Enhanced Visualization',
fontsize=16, fontweight='bold')
# Plot 1: PEG Components
ax1 = axes[0, 0]
x = np.arange(len(companies))
width = 0.25
bars1 = ax1.bar(x - 1.5*width, pe_ratios, width,
label='P/E Ratio (x)', color='blue', alpha=0.7, edgecolor='black', linewidth=1.5)
bars2 = ax1.bar(x - 0.5*width, growth_rates, width,
label='Growth Rate (%)', color='green', alpha=0.7, edgecolor='black', linewidth=1.5)
bars3 = ax1.bar(x + 0.5*width, peg_ratios, width,
label='PEG Ratio', color='purple', alpha=0.7, edgecolor='black', linewidth=1.5)
ax1.set_xlabel('Company', fontsize=12, fontweight='bold')
ax1.set_ylabel('Value', fontsize=12, fontweight='bold')
ax1.set_title('PEG Ratio Components: P/E, Growth Rate, and PEG', fontsize=13, fontweight='bold')
ax1.set_xticks(x)
ax1.set_xticklabels(companies, rotation=15, ha='right')
ax1.legend(loc='best', fontsize=9)
ax1.grid(True, alpha=0.3, linestyle='--', axis='y')
# Add value labels
for bars, values, label_prefix in [(bars1, pe_ratios, ''), (bars2, growth_rates, ''),
(bars3, peg_ratios, '')]:
for bar, val in zip(bars, values):
height = bar.get_height()
if bars == bars3:
label = f'{val:.2f}'
elif bars == bars2:
label = f'{val:.0f}%'
else:
label = f'{val:.0f}x'
ax1.text(bar.get_x() + bar.get_width()/2., height + height*0.02,
label, ha='center', va='bottom',
fontsize=9, fontweight='bold')
# Add formula annotation
ax1.text(0.02, 0.98, 'Formula:\nPEG = P/E / Growth Rate\n\nExample:\nPEG = 30 / 30%\n= 1.0 (Fair)',
transform=ax1.transAxes, fontsize=10, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='lightblue', alpha=0.9),
verticalalignment='top', family='monospace')
# Plot 2: PEG Ratio Comparison
ax2 = axes[0, 1]
colors_peg = ['green' if peg < 0.75 else 'lightgreen' if peg < 1.5 else 'orange' if peg < 2.5 else 'red'
for peg in peg_ratios]
bars = ax2.bar(range(len(companies)), peg_ratios,
color=colors_peg, alpha=0.7, edgecolor='black', linewidth=1.5)
ax2.axhline(y=1.0, color='black', linestyle='--', linewidth=2, alpha=0.7, label='PEG = 1.0 (Fair Value)')
ax2.set_xlabel('Company', fontsize=12, fontweight='bold')
ax2.set_ylabel('PEG Ratio', fontsize=12, fontweight='bold')
ax2.set_title('PEG Ratio Comparison Across Companies', fontsize=13, fontweight='bold')
ax2.set_xticks(range(len(companies)))
ax2.set_xticklabels(companies, rotation=15, ha='right')
ax2.legend(loc='best', fontsize=9)
ax2.grid(True, alpha=0.3, linestyle='--', axis='y')
# Add value labels with interpretation
interpretations = ['Undervalued', 'Fair', 'Moderate', 'Expensive']
for bar, peg, interp in zip(bars, peg_ratios, interpretations):
height = bar.get_height()
ax2.text(bar.get_x() + bar.get_width()/2., height + 0.1,
f'{peg:.2f}\n({interp})', ha='center', va='bottom',
fontsize=9, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='white', alpha=0.8))
# Plot 3: P/E vs Growth Rate (PEG Contours)
ax3 = axes[1, 0]
# Create scatter plot with PEG contours
growth_range = np.linspace(5, 35, 100)
pe_range = np.linspace(10, 50, 100)
# Plot PEG = 1 line
peg_1_line = growth_range # When PEG = 1, P/E = Growth
ax3.plot(growth_range, peg_1_line, 'k--', linewidth=2, alpha=0.7, label='PEG = 1.0')
# Plot PEG = 0.75 and 1.5 lines
peg_075_line = growth_range * 0.75
peg_15_line = growth_range * 1.5
ax3.plot(growth_range, peg_075_line, 'g--', linewidth=1.5, alpha=0.5, label='PEG = 0.75')
ax3.plot(growth_range, peg_15_line, 'orange', linestyle='--', linewidth=1.5, alpha=0.5, label='PEG = 1.5')
# Plot companies
colors_scatter = colors_peg
for i, (pe, g, peg_val) in enumerate(zip(pe_ratios, growth_rates, peg_ratios)):
ax3.scatter(g, pe, s=200, c=colors_scatter[i], alpha=0.7,
edgecolor='black', linewidth=2, zorder=5)
ax3.annotate(f'{companies[i].split()[0]}\nP/E={pe}x, G={g}%\nPEG={peg_val:.2f}',
xy=(g, pe), xytext=(g + 2, pe + 2),
fontsize=9, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='white', alpha=0.9),
arrowprops=dict(arrowstyle='->', color='black', lw=1.5))
ax3.fill_between(growth_range, 0, peg_075_line, alpha=0.2, color='green', label='Undervalued Zone')
ax3.fill_between(growth_range, peg_075_line, peg_15_line, alpha=0.2, color='lightgreen',
label='Fair Value Zone')
ax3.fill_between(growth_range, peg_15_line, 50, alpha=0.2, color='orange', label='Expensive Zone')
ax3.set_xlabel('Growth Rate (%)', fontsize=12, fontweight='bold')
ax3.set_ylabel('P/E Ratio (x)', fontsize=12, fontweight='bold')
ax3.set_title('P/E vs Growth Rate: PEG Ratio Analysis', fontsize=13, fontweight='bold')
ax3.legend(loc='upper left', fontsize=9)
ax3.grid(True, alpha=0.3, linestyle='--')
# Plot 4: PEG Interpretation Zones
ax4 = axes[1, 1]
bars = ax4.barh(range(len(peg_categories)), peg_zones,
color=peg_colors, alpha=0.7, edgecolor='black', linewidth=1.5)
ax4.axvline(x=1.0, color='black', linestyle='--', linewidth=2, alpha=0.7,
label='PEG = 1.0 (Fair Value)')
ax4.set_xlabel('PEG Ratio', fontsize=12, fontweight='bold')
ax4.set_ylabel('Category', fontsize=12, fontweight='bold')
ax4.set_title('PEG Ratio Interpretation Zones', fontsize=13, fontweight='bold')
ax4.set_yticks(range(len(peg_categories)))
ax4.set_yticklabels(peg_categories)
ax4.grid(True, alpha=0.3, linestyle='--', axis='x')
ax4.legend(loc='best', fontsize=9)
# Add value labels
for bar, peg_zone in zip(bars, peg_zones):
width = bar.get_width()
ax4.text(width + 0.1, bar.get_y() + bar.get_height()/2,
f'{peg_zone:.1f}', fontsize=10, fontweight='bold', va='center')
# Mark where our examples fall
for i, peg in enumerate(peg_ratios):
if peg < 0.75:
cat_idx = 0
elif peg < 1.5:
cat_idx = 1
elif peg < 2.5:
cat_idx = 2
else:
cat_idx = 3
ax4.plot(peg, cat_idx, 'ro', markersize=12, zorder=5)
ax4.annotate(f'{companies[i].split()[0]}\n{peg:.2f}',
xy=(peg, cat_idx), xytext=(peg + 0.3, cat_idx + 0.3),
fontsize=9, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='yellow', alpha=0.8),
arrowprops=dict(arrowstyle='->', color='red', lw=1.5))
plt.tight_layout()
display(fig)
plt.close(fig)
print(f"\n📊 **PEG Ratio Formula Analysis**")
print(f"{'='*70}")
print(f"Formula: PEG = P/E / Growth Rate")
print(f" where P/E = price-to-earnings ratio")
print(f" Growth Rate = annual earnings growth rate (%)")
print(f"{'='*70}")
print(f"Example Companies:")
print(f"{'Company':<25} {'P/E':<10} {'Growth':<12} {'PEG':<12} {'Interpretation':<20}")
print(f"{'-'*70}")
for i, (comp, pe, g, peg) in enumerate(zip(companies, pe_ratios, growth_rates, peg_ratios)):
if peg < 0.75:
interp = 'Undervalued'
elif peg < 1.5:
interp = 'Fair Value'
elif peg < 2.5:
interp = 'Expensive'
else:
interp = 'Very Expensive'
print(f"{comp.replace(chr(10), ' '):<25} {pe:>8.0f}x {g:>9.0f}% {peg:>10.2f} {interp:<20}")
print(f"{'='*70}")
print(f"Interpretation:")
print(f" • PEG < 0.75: Growth rate much higher than P/E - potentially undervalued")
print(f" • PEG = 1.0: Growth rate matches P/E - fair value")
print(f" • PEG > 1.5: P/E much higher than growth - potentially overvalued")
print(f"{'='*70}")
print(f"✅ PEG adjusts P/E for growth expectations")
print(f"✅ Lower PEG = better value relative to growth")
print(f"✅ PEG helps compare companies with different growth rates")Python exercise
#| label: fig-peg-ratio-visualization
#| fig-cap: "PEG Ratio: Adjusting P/E for Growth to Identify Value"
#| fig-width: 14
#| fig-height: 8
# Sandbox metadata (auto-generated from lesson.ts)
# libraries: numpy, matplotlib, pandas
import matplotlib.pyplot as plt
from IPython.display import display
import numpy as np
# Create figure
fig, axes = plt.subplots(1, 2, figsize=(16, 8))
fig.suptitle('PEG Ratio: P/E Adjusted for Growth - Identifying Value Relative to Growth Prospects', fontsize=16, fontweight='bold')
# Left plot: PEG calculation examples
ax1 = axes[0]
# Example companies
companies = ['Company A\n(High Growth)', 'Company B\n(Moderate Growth)', 'Company C\n(Low Growth)']
pe_ratios = [30, 20, 15]
growth_rates = [30, 15, 5] # Percentage
peg_ratios = [pe / g for pe, g in zip(pe_ratios, growth_rates)]
# Create grouped bar chart
x = np.arange(len(companies))
width = 0.25
bars1 = ax1.bar(x - width, pe_ratios, width, label='P/E Ratio (x)', color='#2E86AB', alpha=0.8, edgecolor='black', linewidth=1.5)
bars2 = ax1.bar(x, growth_rates, width, label='Growth Rate (%)', color='#4ECDC4', alpha=0.8, edgecolor='black', linewidth=1.5)
bars3 = ax1.bar(x + width, peg_ratios, width, label='PEG Ratio', color='#A23B72', alpha=0.8, edgecolor='black', linewidth=1.5)
ax1.set_xlabel('Company', fontsize=12, fontweight='bold')
ax1.set_ylabel('Value', fontsize=12, fontweight='bold')
ax1.set_title('PEG Ratio Components: P/E, Growth, and PEG', fontsize=13, fontweight='bold')
ax1.set_xticks(x)
ax1.set_xticklabels(companies)
ax1.legend(fontsize=10)
ax1.grid(True, alpha=0.3, linestyle='--', axis='y')
# Add PEG labels with interpretation
interpretations = ['PEG = 1.0\n(Fair)', 'PEG = 1.33\n(Moderate)', 'PEG = 3.0\n(Expensive)']
colors_peg = ['green', 'orange', 'red']
for i, (peg, interp, color) in enumerate(zip(peg_ratios, interpretations, colors_peg)):
ax1.text(i, max(pe_ratios[i], growth_rates[i], peg_ratios[i]) + 3,
f'PEG = {peg:.2f}\n{interp}',
ha='center', fontsize=9, fontweight='bold',
bbox=dict(boxstyle='round', facecolor=color, alpha=0.3))
# Right plot: PEG interpretation zones
ax2 = axes[1]
# PEG ratio ranges
peg_categories = ['Undervalued\n(PEG < 0.75)', 'Fair Value\n(PEG 0.75-1.5)', 'Expensive\n(PEG 1.5-2.5)', 'Very Expensive\n(PEG > 2.5)']
peg_midpoints = [0.5, 1.0, 2.0, 3.5]
colors_peg_cat = ['#96CEB4', '#4ECDC4', '#FFA07A', '#FF6B6B']
bars = ax2.barh(peg_categories, peg_midpoints, color=colors_peg_cat, alpha=0.8, edgecolor='black', linewidth=1.5)
ax2.set_xlabel('PEG Ratio', fontsize=12, fontweight='bold')
ax2.set_title('PEG Ratio Interpretation Zones', fontsize=13, fontweight='bold')
ax2.grid(True, alpha=0.3, linestyle='--', axis='x')
ax2.set_xlim(0, 4)
ax2.axvline(x=1.0, color='black', linestyle='--', linewidth=2, alpha=0.5, label='PEG = 1.0 (Fair Value)')
# Add value labels
for bar, val in zip(bars, peg_midpoints):
width = bar.get_width()
ax2.text(width + 0.1, bar.get_y() + bar.get_height()/2,
f'{val:.1f}', fontsize=10, fontweight='bold', va='center')
# Add interpretation annotations
interpretations_peg = ['Growth > P/E\nGood Value', 'Growth ≈ P/E\nFair Value', 'P/E > Growth\nPremium Price', 'P/E >> Growth\nOvervalued']
for i, (bar, interp) in enumerate(zip(bars, interpretations_peg)):
ax2.text(-0.3, bar.get_y() + bar.get_height()/2,
interp, fontsize=9, fontweight='bold', va='center', ha='right',
bbox=dict(boxstyle='round', facecolor='white', alpha=0.7))
ax2.legend(fontsize=9)
# Add formula
fig.text(0.5, 0.02, 'PEG Ratio = P/E Ratio ÷ Annual Earnings Growth Rate | PEG < 1.0 suggests good value relative to growth',
ha='center', fontsize=13, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='lightblue', alpha=0.8))
plt.tight_layout()
display(fig)
plt.close(fig)Interpretation:
- PEG < 1: Potentially undervalued (growth exceeds P/E)
- PEG = 1: Fairly valued (growth matches P/E)
- PEG > 1: Potentially overvalued (P/E exceeds growth)
Advantages:
- Accounts for growth in valuation
- Allows comparison across companies with different growth rates
- Popularized by Peter Lynch
Limitations:
- Growth rate is an estimate (may be inaccurate)
- Assumes linear growth (may not hold)
- Doesn't account for risk differences
Example: PEG Ratio Analysis
Company JKL:
- P/E ratio: 30x
- Expected earnings growth: 25% per year
- PEG = 30 ÷ 25 = 1.2
Company MNO:
- P/E ratio: 20x
- Expected earnings growth: 10% per year
- PEG = 20 ÷ 10 = 2.0
Company PQR:
- P/E ratio: 15x
- Expected earnings growth: 20% per year
- PEG = 15 ÷ 20 = 0.75
Analysis:
- Company PQR has the lowest PEG (0.75), suggesting it may be undervalued relative to its growth
- Company MNO has the highest PEG (2.0), suggesting it may be overvalued
- Company JKL's PEG (1.2) is moderate
The PEG ratio helps identify which company offers the best value relative to growth expectations.
P/E Ratio Variations and Adjustments
Normalized P/E (Cyclical Earnings Adjustment)
For cyclical companies, earnings vary significantly with economic cycles. Normalized P/E uses average earnings over a full business cycle rather than current earnings.
Where Normalized EPS = Average EPS over a business cycle (typically 5-7 years).
Use Case: Cyclical industries (automobiles, steel, construction) where earnings fluctuate with economic conditions.
Earnings Yield (E/P Ratio)
Earnings yield is the inverse of the P/E ratio:
Interpretation:
- Represents the earnings return as a percentage of stock price
- Comparable to bond yields (can compare stocks to bonds)
- Higher earnings yield = lower P/E = potentially better value
Example: If P/E = 20x, then Earnings Yield = 1/20 = 5%
Shiller P/E (Cyclically Adjusted P/E, CAPE)
Developed by Robert Shiller, the CAPE ratio uses 10-year average inflation-adjusted earnings to smooth out business cycles.
Use Case: Market-level analysis (e.g., S&P 500) to assess overall market valuation.
P/E Ratio Analysis: Cross-Sectional and Time-Series
Cross-Sectional Analysis: Comparing Companies
Step 1: Identify Comparable Companies
- Same industry or sector
- Similar business model
- Similar size and growth profile
Step 2: Calculate P/E Ratios
- Use consistent methodology (trailing vs. forward)
- Ensure comparable EPS definitions
Step 3: Analyze Differences
- Why does Company A have a higher P/E than Company B?
- Growth prospects?
- Profitability (ROE)?
- Risk profile?
- Competitive position?
Step 4: Determine Fair Value
- If Company A trades at 25x P/E and peers trade at 20x, is Company A overvalued?
- Or does it deserve a premium due to superior fundamentals?
Example: Cross-Sectional P/E Analysis
Three companies in the software industry:
Company Software A:
- P/E: 35x
- Growth rate: 30%
- ROE: 25%
- Market leader
Company Software B:
- P/E: 20x
- Growth rate: 10%
- ROE: 15%
- Market follower
Company Software C:
- P/E: 15x
- Growth rate: 5%
- ROE: 10%
- Declining market position
Analysis:
- Company A's high P/E (35x) is justified by high growth (30%) and strong ROE (25%)
- Company B's moderate P/E (20x) matches moderate growth (10%)
- Company C's low P/E (15x) reflects low growth (5%) and weak position
Company A may not be overvalued despite the high P/E - its superior fundamentals justify the premium.
Time-Series Analysis: Historical P/E Trends
Analyzing a company's P/E ratio over time reveals valuation trends:
High P/E Relative to History:
- May indicate overvaluation
- May reflect improved fundamentals
- May indicate market optimism
Low P/E Relative to History:
- May indicate undervaluation
- May reflect deteriorating fundamentals
- May indicate market pessimism
Mean Reversion:
- P/E ratios tend to revert toward historical averages
- Extremes (very high or very low) often correct over time
Limitations of P/E Ratios
While P/E ratios are valuable, they have important limitations:
1. Earnings Quality Issues
Accounting Manipulation:
- Earnings can be manipulated through accounting choices
- Aggressive revenue recognition
- Expense deferral
- One-time charges/exclusions
Solution: Examine cash flows, not just earnings. Free cash flow is harder to manipulate.
2. Negative Earnings
Problem: P/E ratio cannot be calculated for companies with negative earnings (losses).
Solutions:
- Use forward P/E (if earnings expected to turn positive)
- Use alternative metrics (P/S, P/B, EV/EBITDA)
- Consider enterprise value multiples
3. Cyclical Companies
Problem: P/E ratios are distorted for cyclical companies whose earnings fluctuate.
Solution: Use normalized P/E or average earnings over a cycle.
4. Growth Assumptions
Problem: P/E doesn't explicitly account for growth rates.
Solution: Use PEG ratio or DCF models that explicitly model growth.
5. Industry Differences
Problem: Different industries have different typical P/E ranges.
Solution: Compare within industry, not across industries.
6. Capital Structure
Problem: P/E is affected by financial leverage (debt).
Solution: Use enterprise value multiples (EV/EBITDA) that are capital-structure neutral.
Advanced P/E Concepts
P/E Decomposition: The DuPont Approach
The P/E ratio can be decomposed to understand its drivers:
This shows that P/E depends on:
- P/B ratio (market valuation of book value)
- ROE (profitability)
- Which itself depends on margins, efficiency, and leverage
Forward P/E and Growth Expectations
The relationship between forward P/E and growth can be expressed as:
Where:
- 8 billion ÷ $4 billion = 2.0x
Both methods yield the same result: investors are paying 2 times the company's book value.
Let's visualize the P/B ratio calculation with enhanced detail:
Python exercise
#| label: pb-ratio-formula-enhanced
#| fig-cap: "P/B Ratio Formula: Enhanced Visualization showing P/B = Price / Book Value with Multiple Examples"
#| fig-width: 16
#| fig-height: 10
#| echo: false
#| warning: false
# Sandbox metadata (auto-generated from lesson.ts)
# libraries: numpy, matplotlib, pandas
import numpy as np
import matplotlib.pyplot as plt
from IPython.display import display
# Example companies
companies = ['Premium Stock\n(High P/B)', 'Fair Value\n(P/B = 1.0)',
'Value Stock\n(Low P/B)', 'Company STU\n(Example)']
prices = [60, 20, 10, 80]
book_values = [20, 20, 20, 40]
pb_ratios = [p / b for p, b in zip(prices, book_values)]
# Market cap basis (for comparison)
market_caps = [6.0, 2.0, 1.0, 8.0] # Billions
shareholders_equity = [2.0, 2.0, 2.0, 4.0] # Billions
pb_ratios_mcap = [mc / se for mc, se in zip(market_caps, shareholders_equity)]
# Create figure
fig, axes = plt.subplots(2, 2, figsize=(16, 12))
fig.suptitle('P/B Ratio Formula: P/B = Price / Book Value - Enhanced Visualization',
fontsize=16, fontweight='bold')
# Plot 1: P/B Components
ax1 = axes[0, 0]
x = np.arange(len(companies))
width = 0.35
bars1 = ax1.bar(x - width/2, prices, width,
label='Stock Price ($)', color='blue', alpha=0.7, edgecolor='black', linewidth=1.5)
bars2 = ax1.bar(x + width/2, book_values, width,
label='Book Value ($)', color='green', alpha=0.7, edgecolor='black', linewidth=1.5)
ax1.set_xlabel('Company', fontsize=12, fontweight='bold')
ax1.set_ylabel('Amount ($)', fontsize=12, fontweight='bold')
ax1.set_title('P/B Ratio Components: Price and Book Value', fontsize=13, fontweight='bold')
ax1.set_xticks(x)
ax1.set_xticklabels(companies, rotation=15, ha='right')
ax1.legend(loc='best', fontsize=9)
ax1.grid(True, alpha=0.3, linestyle='--', axis='y')
# Add P/B values on top
for i, (price, bv, pb) in enumerate(zip(prices, book_values, pb_ratios)):
max_val = max(price, bv)
ax1.text(i, max_val + max_val*0.1, f'P/B = {pb:.1f}x\n({price}/{bv})',
ha='center', fontsize=9, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='yellow', alpha=0.8))
# Add formula annotation
ax1.text(0.02, 0.98, 'Formula:\nP/B = Price / Book Value\n\nExample (Company STU):\nP/B = $80 / $40\n= 2.0x',
transform=ax1.transAxes, fontsize=10, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='lightblue', alpha=0.9),
verticalalignment='top', family='monospace')
# Plot 2: P/B Ratio Comparison
ax2 = axes[0, 1]
colors_pb = ['red' if pb < 0.75 else 'orange' if pb < 1.0 else 'green' if pb < 2.0 else 'blue'
for pb in pb_ratios]
bars = ax2.bar(range(len(companies)), pb_ratios,
color=colors_pb, alpha=0.7, edgecolor='black', linewidth=1.5)
ax2.axhline(y=1.0, color='black', linestyle='--', linewidth=2, alpha=0.7, label='P/B = 1.0 (Book Value)')
ax2.set_xlabel('Company', fontsize=12, fontweight='bold')
ax2.set_ylabel('P/B Ratio (x)', fontsize=12, fontweight='bold')
ax2.set_title('P/B Ratio Comparison Across Companies', fontsize=13, fontweight='bold')
ax2.set_xticks(range(len(companies)))
ax2.set_xticklabels(companies, rotation=15, ha='right')
ax2.legend(loc='best', fontsize=9)
ax2.grid(True, alpha=0.3, linestyle='--', axis='y')
# Add value labels
for bar, pb in zip(bars, pb_ratios):
height = bar.get_height()
ax2.text(bar.get_x() + bar.get_width()/2., height + 0.05,
f'{pb:.1f}x', ha='center', va='bottom',
fontsize=10, fontweight='bold')
# Plot 3: Market Value vs Book Value
ax3 = axes[1, 0]
# Show market value vs book value relationship
market_value_premium = [(p - b) / b * 100 for p, b in zip(prices, book_values)]
bars = ax3.bar(range(len(companies)), market_value_premium,
color=colors_pb, alpha=0.7, edgecolor='black', linewidth=1.5)
ax3.axhline(y=0, color='black', linestyle='-', linewidth=1.5)
ax3.axhline(y=100, color='green', linestyle='--', linewidth=1.5, alpha=0.5, label='100% Premium')
ax3.axhline(y=-50, color='red', linestyle='--', linewidth=1.5, alpha=0.5, label='50% Discount')
ax3.set_xlabel('Company', fontsize=12, fontweight='bold')
ax3.set_ylabel('Market Value Premium/Discount (%)', fontsize=12, fontweight='bold')
ax3.set_title('Market Value vs. Book Value: Premium/Discount', fontsize=13, fontweight='bold')
ax3.set_xticks(range(len(companies)))
ax3.set_xticklabels(companies, rotation=15, ha='right')
ax3.legend(loc='best', fontsize=9)
ax3.grid(True, alpha=0.3, linestyle='--', axis='y')
# Add value labels
for bar, premium in zip(bars, market_value_premium):
height = bar.get_height()
ax3.text(bar.get_x() + bar.get_width()/2., height + (5 if height > 0 else -5),
f'{premium:+.0f}%', ha='center', va='bottom' if height > 0 else 'top',
fontsize=9, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='white', alpha=0.8))
# Plot 4: Method Comparison (Price/EPS vs Market Cap/Equity)
ax4 = axes[1, 1]
x = np.arange(len(companies))
width = 0.35
bars1 = ax4.bar(x - width/2, pb_ratios, width,
label='Method 1: Price/Book Value', color='blue', alpha=0.7, edgecolor='black', linewidth=1.5)
bars2 = ax4.bar(x + width/2, pb_ratios_mcap, width,
label='Method 2: Market Cap/Equity', color='green', alpha=0.7,
edgecolor='black', linewidth=1.5)
ax4.set_xlabel('Company', fontsize=12, fontweight='bold')
ax4.set_ylabel('P/B Ratio (x)', fontsize=12, fontweight='bold')
ax4.set_title('P/B Calculation: Two Equivalent Methods', fontsize=13, fontweight='bold')
ax4.set_xticks(x)
ax4.set_xticklabels(companies, rotation=15, ha='right')
ax4.legend(loc='best', fontsize=9)
ax4.grid(True, alpha=0.3, linestyle='--', axis='y')
# Add value labels
for bars, pbs in [(bars1, pb_ratios), (bars2, pb_ratios_mcap)]:
for bar, pb in zip(bars, pbs):
height = bar.get_height()
ax4.text(bar.get_x() + bar.get_width()/2., height + 0.05,
f'{pb:.1f}x', ha='center', va='bottom',
fontsize=9, fontweight='bold')
# Add annotation showing equivalence
ax4.text(0.5, 0.98, 'Both methods yield same result:\nP/B = Price/Book Value = Market Cap/Equity',
transform=ax4.transAxes, ha='center', va='top',
fontsize=10, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='lightgreen', alpha=0.9))
plt.tight_layout()
display(fig)
plt.close(fig)
print(f"\n📊 **P/B Ratio Formula Analysis**")
print(f"{'='*70}")
print(f"Formula: P/B = Price / Book Value")
print(f" Alternative: P/B = Market Cap / Shareholders' Equity")
print(f" where Price = stock price per share")
print(f" Book Value = shareholders' equity per share")
print(f"{'='*70}")
print(f"Example Companies:")
print(f"{'Company':<25} {'Price':<12} {'Book Value':<15} {'P/B Ratio':<12}")
print(f"{'-'*70}")
for i, (comp, price, bv, pb) in enumerate(zip(companies, prices, book_values, pb_ratios)):
print(f"{comp.replace(chr(10), ' '):<25} ${price:>8.2f} ${bv:>11.2f} {pb:>10.1f}x")
print(f"{'='*70}")
print(f"Interpretation:")
print(f" • P/B = 3.0x: Paying $3 for $1 of book value (premium)")
print(f" • P/B = 1.0x: Paying $1 for $1 of book value (fair)")
print(f" • P/B = 0.5x: Paying $0.50 for $1 of book value (discount)")
print(f"{'='*70}")
print(f"✅ P/B shows market value relative to accounting value")
print(f"✅ P/B > 1.0 = premium to book (growth/intangibles)")
print(f"✅ P/B < 1.0 = discount to book (value opportunity)")Python exercise
#| label: fig-pb-ratio-visualization
#| fig-cap: "P/B Ratio: Understanding Market Price Relative to Book Value"
#| fig-width: 14
#| fig-height: 8
# Sandbox metadata (auto-generated from lesson.ts)
# libraries: numpy, matplotlib, pandas
import matplotlib.pyplot as plt
from IPython.display import display
import numpy as np
# Create figure
fig, axes = plt.subplots(1, 2, figsize=(16, 8))
fig.suptitle('Price-to-Book (P/B) Ratio: Market Value vs. Book Value', fontsize=16, fontweight='bold')
# Left plot: P/B ratio calculation breakdown
ax1 = axes[0]
# Example companies with different P/B ratios
companies = ['Premium Stock\n(P/B = 3.0x)', 'Fair Value\n(P/B = 1.0x)', 'Value Stock\n(P/B = 0.5x)']
prices = [60, 20, 10]
book_values = [20, 20, 20]
pb_ratios = [p/b for p, b in zip(prices, book_values)]
# Create grouped bar chart
x = np.arange(len(companies))
width = 0.35
bars1 = ax1.bar(x - width/2, prices, width, label='Market Price ($)', color='#2E86AB', alpha=0.8)
bars2 = ax1.bar(x + width/2, book_values, width, label='Book Value ($)', color='#A23B72', alpha=0.8)
ax1.set_xlabel('Stock', fontsize=12, fontweight='bold')
ax1.set_ylabel('Value ($)', fontsize=12, fontweight='bold')
ax1.set_title('P/B Ratio Components: Market Price vs. Book Value', fontsize=13, fontweight='bold')
ax1.set_xticks(x)
ax1.set_xticklabels(companies)
ax1.legend(fontsize=10)
ax1.grid(True, alpha=0.3, linestyle='--', axis='y')
# Add P/B ratio labels
for i, (price, bv, pb) in enumerate(zip(prices, book_values, pb_ratios)):
ax1.text(i, max(price, bv) + 3, f'P/B = {pb:.1f}x',
ha='center', fontsize=9, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='wheat', alpha=0.7))
# Add line showing difference
if price > bv:
ax1.plot([i, i], [bv, price], 'g--', linewidth=2, alpha=0.5)
ax1.text(i, (price + bv)/2, f'+${price-bv}', ha='center', fontsize=8, color='green', fontweight='bold')
elif price < bv:
ax1.plot([i, i], [price, bv], 'r--', linewidth=2, alpha=0.5)
ax1.text(i, (price + bv)/2, f'-${bv-price}', ha='center', fontsize=8, color='red', fontweight='bold')
# Right plot: P/B ratio categories
ax2 = axes[1]
# P/B ratio ranges
pb_categories = ['Very High\n(3x+)', 'High\n(2-3x)', 'Moderate\n(1-2x)', 'At Book\n(1.0x)', 'Below Book\n(<1.0x)']
pb_midpoints = [4.0, 2.5, 1.5, 1.0, 0.5]
colors_pb = ['#FF6B6B', '#FFA07A', '#4ECDC4', '#45B7D1', '#96CEB4']
bars = ax2.barh(pb_categories, pb_midpoints, color=colors_pb, alpha=0.8, edgecolor='black', linewidth=1.5)
ax2.set_xlabel('P/B Ratio (x)', fontsize=12, fontweight='bold')
ax2.set_title('P/B Ratio Categories and Interpretation', fontsize=13, fontweight='bold')
ax2.grid(True, alpha=0.3, linestyle='--', axis='x')
ax2.set_xlim(0, 4.5)
ax2.axvline(x=1.0, color='black', linestyle='--', linewidth=2, alpha=0.5, label='Book Value')
# Add value labels
for bar, val in zip(bars, pb_midpoints):
width = bar.get_width()
ax2.text(width + 0.1, bar.get_y() + bar.get_height()/2,
f'{val:.1f}x', fontsize=10, fontweight='bold', va='center')
# Add interpretation annotations
interpretations = ['Premium\nValuation', 'Growth\nExpected', 'Fair\nValue', 'At Book\nValue', 'Value\nOpportunity']
for i, (bar, interp) in enumerate(zip(bars, interpretations)):
ax2.text(-0.3, bar.get_y() + bar.get_height()/2,
interp, fontsize=9, fontweight='bold', va='center', ha='right',
bbox=dict(boxstyle='round', facecolor='white', alpha=0.7))
ax2.legend(fontsize=9)
# Add formula
fig.text(0.5, 0.02, 'P/B Ratio = Stock Price ÷ Book Value Per Share = Market Capitalization ÷ Shareholders\' Equity',
ha='center', fontsize=13, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='lightblue', alpha=0.8))
plt.tight_layout()
display(fig)
plt.close(fig)Understanding Book Value
What is Book Value?
Book value (also called shareholders' equity or net asset value) represents the accounting value of a company's equity. It's calculated as:
Components of Book Value:
- Common Stock: Par value of issued shares
- Additional Paid-In Capital: Amount paid above par value
- Retained Earnings: Cumulative profits not paid as dividends
- Treasury Stock: Shares repurchased (reduces book value)
- Accumulated Other Comprehensive Income: Unrealized gains/losses
Book Value vs. Market Value
Book Value (Accounting Value):
- Based on historical cost accounting
- Reflects assets at purchase price (less depreciation)
- May not reflect current market values
- Conservative measure of asset values
Market Value (Market Capitalization):
- Based on current stock price
- Reflects market's assessment of company value
- Includes expectations about future prospects
- Can be significantly different from book value
Key Insight: The difference between market value and book value reflects:
- Intangible value: Brand, reputation, intellectual property
- Growth expectations: Future earnings potential
- Market sentiment: Optimism or pessimism
- Asset appreciation: Assets worth more than book value
Interpreting P/B Ratios
What Does a P/B Ratio Mean?
P/B = 1.0x:
- Stock trades at exactly book value
- Market value equals accounting value
- May indicate fair valuation or undervaluation
P/B > 1.0x (Premium to Book):
- Market values company above book value
- May indicate:
- Strong intangible assets (brand, IP)
- High growth expectations
- Superior profitability (ROE)
- Overvaluation (if fundamentals don't justify)
P/B < 1.0x (Discount to Book):
- Market values company below book value
- May indicate:
- Assets overstated on balance sheet
- Poor profitability
- Declining business
- Undervaluation opportunity (if company is healthy)
Typical P/B Ratio Ranges
High P/B (2.0x - 5.0x+):
- Growth companies with strong intangibles
- Technology companies (software, biotech)
- Companies with strong brands
- High-ROE companies
Moderate P/B (1.0x - 2.0x):
- Mature, stable companies
- Asset-heavy companies (manufacturing, utilities)
- Companies with moderate growth
Low P/B (< 1.0x):
- Value stocks
- Companies in decline
- Financial companies (banks, insurance)
- Asset-heavy companies with low ROE
The Relationship Between P/B and ROE
One of the most important insights in equity valuation is the relationship between P/B ratio and Return on Equity (ROE). This relationship is fundamental to understanding why some companies trade at premiums to book value while others trade at discounts.
The Fundamental Relationship
This can be rearranged to show:
Where:
- 8 ÷ $1.00)
Analysis:
- Higher ROE → Higher P/B ratio
- Company High ROE (25% ROE) trades at 3.0x book value
- Company Low ROE (5% ROE) trades at 0.4x book value
- The market rewards profitability with valuation premiums
Let's visualize the P/B vs. ROE relationship in detail: