Macroeconomics Fundamentals: The Economy as a Whole
2. Macroeconomics Fundamentals: The Economy as a Whole
Macroeconomics studies the economy as a whole - total output, employment, inflation, and economic growth. While microeconomics focuses on individual decisions, macroeconomics focuses on aggregate outcomes. Understanding macroeconomics is essential for financial markets, because macroeconomic conditions affect all asset prices, interest rates, and investment returns.
The Circular Flow of Income
The economy is a circular flow of income and spending. Understanding this flow is fundamental to macroeconomics.
Households supply labor and capital to firms and receive income (wages, interest, profits). They use this income to buy goods and services from firms, creating revenue for firms. Firms use this revenue to pay for inputs (labor, capital), creating income for households. The cycle continues.
Injections add money to the circular flow: investment (firms spending on capital), government spending, and exports. Leakages remove money from the flow: savings, taxes, and imports. For the economy to be in equilibrium, injections must equal leakages.
This simple model helps understand how the economy works. When injections exceed leakages, economic activity increases. When leakages exceed injections, economic activity decreases. Understanding this flow helps explain business cycles, economic growth, and the effects of government policy.
Let's visualize the complete circular flow with all components:
Python exercise
#| label: circular-flow-enhanced
#| fig-cap: "Circular Flow of Income: Household/Firm Flows, Injections, Leakages, Government, Foreign Sector"
#| fig-width: 16
#| fig-height: 12
#| echo: false
#| warning: false
# Sandbox metadata (auto-generated from lesson.ts)
# libraries: numpy, matplotlib, pandas
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from matplotlib.patches import FancyBboxPatch, FancyArrowPatch, Circle, Ellipse
from IPython.display import display
fig, ax = plt.subplots(figsize=(16, 12))
ax.set_xlim(0, 12)
ax.set_ylim(0, 12)
ax.axis('off')
fig.suptitle('Circular Flow of Income: Complete Economic Model', fontsize=16, fontweight='bold', y=0.95)
# Draw main circular flow between households and firms
# Households box (left)
household_box = FancyBboxPatch((1, 5), 2, 2, boxstyle='round,pad=0.2',
facecolor='#4A90E2', edgecolor='black', linewidth=2, alpha=0.8)
ax.add_patch(household_box)
ax.text(2, 6, 'Households', ha='center', va='center', fontsize=12, fontweight='bold', color='white')
# Firms box (right)
firm_box = FancyBboxPatch((9, 5), 2, 2, boxstyle='round,pad=0.2',
facecolor='#50C878', edgecolor='black', linewidth=2, alpha=0.8)
ax.add_patch(firm_box)
ax.text(10, 6, 'Firms', ha='center', va='center', fontsize=12, fontweight='bold', color='white')
# Government box (top)
gov_box = FancyBboxPatch((4.5, 9), 3, 1.5, boxstyle='round,pad=0.2',
facecolor='#FF6B6B', edgecolor='black', linewidth=2, alpha=0.8)
ax.add_patch(gov_box)
ax.text(6, 9.75, 'Government', ha='center', va='center', fontsize=12, fontweight='bold', color='white')
# Foreign Sector box (bottom)
foreign_box = FancyBboxPatch((4.5, 1), 3, 1.5, boxstyle='round,pad=0.2',
facecolor='#FFD700', edgecolor='black', linewidth=2, alpha=0.8)
ax.add_patch(foreign_box)
ax.text(6, 1.75, 'Foreign Sector', ha='center', va='center', fontsize=12, fontweight='bold', color='white')
# Financial Markets box (center left)
fin_box = FancyBboxPatch((0.5, 2.5), 2, 1.5, boxstyle='round,pad=0.2',
facecolor='#9B59B6', edgecolor='black', linewidth=2, alpha=0.8)
ax.add_patch(fin_box)
ax.text(1.5, 3.25, 'Financial\nMarkets', ha='center', va='center', fontsize=10, fontweight='bold', color='white')
# Main circular flow arrows (top path)
arrow1 = FancyArrowPatch((3, 6), (9, 6), arrowstyle='->', mutation_scale=30,
linewidth=3, color='#4169E1', alpha=0.8)
ax.add_patch(arrow1)
ax.text(6, 6.5, 'Goods & Services', ha='center', va='bottom', fontsize=10, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='lightblue', alpha=0.8))
# Main circular flow arrows (bottom path)
arrow2 = FancyArrowPatch((9, 6), (3, 6), arrowstyle='->', mutation_scale=30,
linewidth=3, color='#FF6347', alpha=0.8, connectionstyle="arc3,rad=0.3")
ax.add_patch(arrow2)
ax.text(6, 5.2, 'Income (Wages, Rent, Interest, Profits)', ha='center', va='top', fontsize=10, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='lightcoral', alpha=0.8))
# Factor markets (households to firms - labor, capital)
arrow3 = FancyArrowPatch((3, 6.5), (9, 6.5), arrowstyle='->', mutation_scale=25,
linewidth=2, color='#32CD32', alpha=0.7, connectionstyle="arc3,rad=0.15")
ax.add_patch(arrow3)
ax.text(6, 7.2, 'Factors of Production\n(Labor, Capital)', ha='center', va='bottom', fontsize=9, fontstyle='italic',
bbox=dict(boxstyle='round', facecolor='lightgreen', alpha=0.7))
# Injections: Investment (financial markets to firms)
arrow_inv = FancyArrowPatch((2.5, 3.5), (9, 6.2), arrowstyle='->', mutation_scale=25,
linewidth=2.5, color='#FF8C00', alpha=0.8)
ax.add_patch(arrow_inv)
ax.text(5, 4.5, 'Investment (I)', ha='center', fontsize=10, fontweight='bold', color='#FF8C00',
bbox=dict(boxstyle='round', facecolor='orange', alpha=0.8))
# Government spending (government to firms)
arrow_gov_spend = FancyArrowPatch((6, 9), (9.5, 6.5), arrowstyle='->', mutation_scale=25,
linewidth=2.5, color='#FF6B6B', alpha=0.8)
ax.add_patch(arrow_gov_spend)
ax.text(8, 7.8, 'Government\nSpending (G)', ha='center', fontsize=9, fontweight='bold', color='#FF6B6B',
bbox=dict(boxstyle='round', facecolor='lightcoral', alpha=0.8))
# Exports (foreign sector to firms)
arrow_exp = FancyArrowPatch((6, 2.5), (9.5, 5.5), arrowstyle='->', mutation_scale=25,
linewidth=2.5, color='#FFD700', alpha=0.8)
ax.add_patch(arrow_exp)
ax.text(8, 3.8, 'Exports (X)', ha='center', fontsize=9, fontweight='bold', color='#8B7355',
bbox=dict(boxstyle='round', facecolor='yellow', alpha=0.8))
# Leakages: Savings (households to financial markets)
arrow_sav = FancyArrowPatch((1.5, 5.5), (1.5, 4), arrowstyle='->', mutation_scale=25,
linewidth=2.5, color='#9B59B6', alpha=0.8)
ax.add_patch(arrow_sav)
ax.text(0.2, 4.75, 'Savings (S)', ha='left', fontsize=9, fontweight='bold', color='#9B59B6',
bbox=dict(boxstyle='round', facecolor='lavender', alpha=0.8))
# Taxes (households to government)
arrow_tax_h = FancyArrowPatch((3, 6.5), (5.5, 9), arrowstyle='->', mutation_scale=25,
linewidth=2.5, color='#FF6B6B', alpha=0.8)
ax.add_patch(arrow_tax_h)
ax.text(4, 7.8, 'Taxes (T)', ha='center', fontsize=9, fontweight='bold', color='#FF6B6B',
bbox=dict(boxstyle='round', facecolor='lightcoral', alpha=0.8))
# Taxes (firms to government)
arrow_tax_f = FancyArrowPatch((9.5, 6.5), (7, 9), arrowstyle='->', mutation_scale=25,
linewidth=2.5, color='#FF6B6B', alpha=0.8)
ax.add_patch(arrow_tax_f)
ax.text(8.5, 7.8, 'Taxes (T)', ha='center', fontsize=9, fontweight='bold', color='#FF6B6B',
bbox=dict(boxstyle='round', facecolor='lightcoral', alpha=0.8))
# Imports (firms to foreign sector)
arrow_imp = FancyArrowPatch((9.5, 5.5), (6, 2.5), arrowstyle='->', mutation_scale=25,
linewidth=2.5, color='#FFD700', alpha=0.8)
ax.add_patch(arrow_imp)
ax.text(8, 3.8, 'Imports (M)', ha='center', fontsize=9, fontweight='bold', color='#8B7355',
bbox=dict(boxstyle='round', facecolor='yellow', alpha=0.8))
# Government transfers (government to households)
arrow_trans = FancyArrowPatch((5.5, 9), (3, 7), arrowstyle='->', mutation_scale=25,
linewidth=2, color='#FF6B6B', alpha=0.7, linestyle='--')
ax.add_patch(arrow_trans)
ax.text(4, 8.2, 'Transfers', ha='center', fontsize=8, fontstyle='italic', color='#FF6B6B')
# Add legend
legend_elements = [
mpatches.Patch(color='#4169E1', alpha=0.8, label='Goods & Services Flow'),
mpatches.Patch(color='#FF6347', alpha=0.8, label='Income Flow'),
mpatches.Patch(color='#FF8C00', alpha=0.8, label='Injections (I, G, X)'),
mpatches.Patch(color='#9B59B6', alpha=0.8, label='Leakages (S, T, M)'),
]
ax.legend(handles=legend_elements, loc='upper right', fontsize=9, framealpha=0.9)
# Add formula
ax.text(0.5, 11, 'Equilibrium Condition:\nInjections (I + G + X) = Leakages (S + T + M)',
fontsize=11, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='yellow', alpha=0.9),
verticalalignment='top', family='monospace')
plt.tight_layout()
display(fig)
plt.close(fig)
print(f"\n📊 **Circular Flow of Income Analysis**")
print(f"{'='*70}")
print(f"Main Flows:")
print(f" • Households → Firms: Goods & Services (consumption)")
print(f" • Firms → Households: Income (wages, rent, interest, profits)")
print(f" • Households → Firms: Factors of Production (labor, capital)")
print(f"{'='*70}")
print(f"Injections (add money to flow):")
print(f" • Investment (I): Firms spending on capital goods")
print(f" • Government Spending (G): Government purchases")
print(f" • Exports (X): Foreign spending on domestic goods")
print(f"{'='*70}")
print(f"Leakages (remove money from flow):")
print(f" • Savings (S): Household savings in financial markets")
print(f" • Taxes (T): Government tax collection")
print(f" • Imports (M): Spending on foreign goods")
print(f"{'='*70}")
print(f"Equilibrium Condition:")
print(f" Injections = Leakages")
print(f" I + G + X = S + T + M")
print(f"{'='*70}")
print(f"✅ When Injections > Leakages: Economic activity increases")
print(f"✅ When Leakages > Injections: Economic activity decreases")Gross Domestic Product (GDP)
GDP is the most important measure of economic activity. It represents the total value of all goods and services produced in an economy during a period (typically a year or quarter).
GDP Components: GDP can be measured in three ways, all of which should give the same result:
Expenditure Approach: GDP = Consumption (C) + Investment (I) + Government Spending (G) + Net Exports (X - M)
This approach measures GDP by adding up all spending on final goods and services. Consumption is spending by households. Investment is spending by firms on capital goods (machinery, buildings, inventory). Government spending is spending by governments. Net exports are exports minus imports.
Let's visualize GDP components and their relationships:
Python exercise
#| label: gdp-components
#| fig-cap: "GDP Components: Breakdown by Expenditure Approach"
#| fig-width: 14
#| fig-height: 8
#| 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 GDP breakdown (in trillions)
total_gdp = 25.0
consumption = 17.0 # 68% of GDP
investment = 4.5 # 18% of GDP
government = 4.0 # 16% of GDP
exports = 2.5
imports = 3.0
net_exports = exports - imports # -0.5 (trade deficit)
# Verify: C + I + G + (X - M) = GDP
components = [consumption, investment, government, net_exports]
component_labels = ['Consumption\n(C)', 'Investment\n(I)', 'Government\n(G)', 'Net Exports\n(X - M)']
colors = ['#4169E1', '#FF6347', '#32CD32', '#FFD700']
# Create figure
fig, axes = plt.subplots(1, 2, figsize=(16, 8))
fig.suptitle('GDP Components: Expenditure Approach Breakdown', fontsize=16, fontweight='bold')
# Plot 1: Pie Chart
ax1 = axes[0]
# Use absolute values for pie chart (negative net exports shown as positive for visualization)
pie_values = [consumption, investment, government, abs(net_exports)]
pie_labels = ['Consumption\n(C)', 'Investment\n(I)', 'Government\n(G)', f'Net Exports\n({net_exports:+.1f})']
explode = (0.05, 0.05, 0.05, 0.1) # Slightly explode all slices
wedges, texts, autotexts = ax1.pie(pie_values, labels=pie_labels, colors=colors, autopct='%1.1f%%',
startangle=90, explode=explode, textprops={'fontsize': 11, 'fontweight': 'bold'})
# Make percentage text larger
for autotext in autotexts:
autotext.set_color('white')
autotext.set_fontsize(12)
autotext.set_fontweight('bold')
ax1.set_title('GDP Composition by Component', fontsize=13, fontweight='bold')
# Plot 2: Bar Chart
ax2 = axes[1]
bars = ax2.bar(range(len(component_labels)), components, color=colors, alpha=0.8,
edgecolor='black', linewidth=1.5)
ax2.set_xlabel('GDP Component', fontsize=12, fontweight='bold')
ax2.set_ylabel('Amount ($ Trillions)', fontsize=12, fontweight='bold')
ax2.set_title('GDP Components: Absolute Values', fontsize=13, fontweight='bold')
ax2.set_xticks(range(len(component_labels)))
ax2.set_xticklabels(component_labels, fontsize=11, fontweight='bold')
ax2.grid(True, alpha=0.3, linestyle='--', axis='y')
ax2.axhline(y=0, color='black', linestyle='-', linewidth=1)
# Add value labels on bars
for i, (bar, val) in enumerate(zip(bars, components)):
height = bar.get_height()
pct = val / total_gdp * 100
ax2.text(bar.get_x() + bar.get_width()/2., height + (0.1 if height > 0 else -0.3),
f'${val:.1f}T\n({pct:.1f}%)',
ha='center', va='bottom' if height > 0 else 'top',
fontsize=10, fontweight='bold')
# Add total GDP line
ax2.axhline(y=total_gdp, color='red', linestyle='--', linewidth=2, alpha=0.7, label=f'Total GDP: ${total_gdp:.1f}T')
ax2.legend(loc='upper right', fontsize=10)
plt.tight_layout()
display(fig)
plt.close(fig)
print(f"\n📊 **GDP Components Analysis**")
print(f"{'='*60}")
print(f"Total GDP: ${total_gdp:.2f} trillion")
print(f"{'='*60}")
print(f"Components (Expenditure Approach):")
print(f" Consumption (C): ${consumption:.2f} trillion ({consumption/total_gdp*100:.1f}%)")
print(f" Investment (I): ${investment:.2f} trillion ({investment/total_gdp*100:.1f}%)")
print(f" Government Spending (G): ${government:.2f} trillion ({government/total_gdp*100:.1f}%)")
print(f" Net Exports (X - M): ${net_exports:.2f} trillion ({net_exports/total_gdp*100:.1f}%)")
print(f" - Exports (X): ${exports:.2f} trillion")
print(f" - Imports (M): ${imports:.2f} trillion")
print(f"{'='*60}")
print(f"Verification: C + I + G + (X - M) = ${sum(components):.2f}T")
print(f"{'='*60}")
print(f"✅ Consumption is typically the largest component (60-70%)")
print(f"✅ Investment is the most volatile component")
print(f"✅ Net exports can be positive (surplus) or negative (deficit)")Income Approach: GDP = Wages + Interest + Rent + Profits
This approach measures GDP by adding up all income earned in production. Every dollar of production creates a dollar of income, so these two approaches should be equal.
Production Approach: GDP = Sum of Value Added at Each Stage of Production
This approach measures GDP by adding up the value added at each stage of production. Value added is the difference between a firm's sales and its purchases from other firms.
Real vs. Nominal GDP: Nominal GDP measures output at current prices. Real GDP measures output at constant prices, adjusting for inflation. Real GDP is more useful for measuring economic growth because it reflects actual changes in output, not just price changes.
GDP Per Capita divides GDP by population, giving average output per person. GDP per capita is a measure of living standards - higher GDP per capita generally means higher living standards.
GDP Growth is the rate of change in real GDP. Positive growth means the economy is expanding. Negative growth (recession) means the economy is contracting. Sustained growth over time is crucial for improving living standards.
Limitations of GDP: GDP doesn't measure everything. It doesn't account for:
- Non-market production (housework, volunteer work)
- Environmental quality
- Income distribution
- Quality of life factors
- Underground economy
Despite these limitations, GDP remains the best single measure of economic activity and is closely watched by financial markets.
Unemployment
Unemployment represents unused labor resources. Understanding unemployment is crucial because it affects people's lives, government policy, and financial markets.
Types of Unemployment:
Frictional Unemployment occurs when people are temporarily between jobs or looking for their first job. This is normal and healthy - it reflects people searching for better opportunities.
Structural Unemployment occurs when there's a mismatch between workers' skills and available jobs. When industries decline (like manufacturing in developed countries), workers may lack the skills needed for new industries (like technology). This type of unemployment is more serious and requires retraining or relocation.
Cyclical Unemployment occurs during economic downturns. When the economy contracts, firms lay off workers, creating unemployment. This type of unemployment is what monetary and fiscal policy try to reduce.
Natural Rate of Unemployment is the unemployment rate that exists when the economy is operating at full capacity. It includes frictional and structural unemployment but not cyclical. The natural rate varies over time and across countries.
Measuring Unemployment: The unemployment rate is the percentage of the labor force that is unemployed. The labor force includes people who are employed or actively seeking work. It excludes people who are not working and not looking for work (like students, retirees, or discouraged workers).
Costs of Unemployment: Unemployment has significant costs:
- Economic Costs: Lost output and income
- Social Costs: Poverty, crime, social unrest
- Individual Costs: Lost income, reduced skills, psychological effects
Unemployment affects financial markets because it affects consumer spending, corporate profits, and government policy. High unemployment often leads to lower interest rates (as central banks try to stimulate the economy) and lower stock prices (as corporate profits decline).
Economic Growth
Economic growth is the increase in real GDP over time. Sustained economic growth is crucial for improving living standards and is a primary goal of economic policy.
Sources of Economic Growth:
Labor: More workers or more hours worked increases output. Population growth and immigration can increase the labor force.
Capital: More physical capital (machinery, buildings, infrastructure) increases productivity and output. Investment in capital is crucial for growth.
Technology: Better technology increases productivity - the same inputs produce more output. Technological progress is perhaps the most important source of long-term growth.
Human Capital: Education and training increase workers' productivity. Investment in human capital is crucial for growth.
Institutions: Good institutions (rule of law, property rights, stable government) encourage investment and growth. Poor institutions hinder growth.
The Production Function relates output to inputs:
Where Y is output, A is technology (total factor productivity), K is capital, L is labor, and F is a function combining capital and labor. This equation shows that output depends on technology, capital, and labor.
Let's visualize the production function and growth accounting:
Python exercise
#| label: production-function
#| fig-cap: "Production Function: Y = A × F(K,L) with Growth Accounting"
#| 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 mpl_toolkits.mplot3d import Axes3D
from IPython.display import display
# Production function: Y = A × K^α × L^(1-α)
# Cobb-Douglas form with constant returns to scale
A = 1.0 # Technology/TFP
alpha = 0.3 # Capital share (typically 0.3-0.4)
# Create grid for capital (K) and labor (L)
K = np.linspace(1, 100, 50)
L = np.linspace(1, 100, 50)
K_grid, L_grid = np.meshgrid(K, L)
# Production function: Y = A × K^α × L^(1-α)
Y = A * (K_grid ** alpha) * (L_grid ** (1 - alpha))
# Create figure with multiple subplots
fig = plt.figure(figsize=(16, 12))
fig.suptitle('Production Function: Y = A × F(K,L) - Output, Capital, and Labor Relationships',
fontsize=16, fontweight='bold')
# Plot 1: 3D Surface of Production Function
ax1 = fig.add_subplot(2, 2, 1, projection='3d')
surf = ax1.plot_surface(K_grid, L_grid, Y, cmap='viridis', alpha=0.8, linewidth=0, antialiased=True)
ax1.set_xlabel('Capital (K)', fontsize=11, fontweight='bold', labelpad=10)
ax1.set_ylabel('Labor (L)', fontsize=11, fontweight='bold', labelpad=10)
ax1.set_zlabel('Output (Y)', fontsize=11, fontweight='bold', labelpad=10)
ax1.set_title('Production Function: Y = A × K^α × L^(1-α)', fontsize=12, fontweight='bold')
fig.colorbar(surf, ax=ax1, shrink=0.5, aspect=20, pad=0.1, label='Output (Y)')
ax1.view_init(elev=30, azim=45)
# Plot 2: Output vs. Capital (holding labor constant)
ax2 = fig.add_subplot(2, 2, 2)
L_fixed = 50
Y_vs_K = A * (K ** alpha) * (L_fixed ** (1 - alpha))
ax2.plot(K, Y_vs_K, 'b-', linewidth=2.5, label=f'Labor = {L_fixed:.0f}', alpha=0.8)
L_fixed2 = 75
Y_vs_K2 = A * (K ** alpha) * (L_fixed2 ** (1 - alpha))
ax2.plot(K, Y_vs_K2, 'g-', linewidth=2.5, label=f'Labor = {L_fixed2:.0f}', alpha=0.8)
ax2.set_xlabel('Capital (K)', fontsize=12, fontweight='bold')
ax2.set_ylabel('Output (Y)', fontsize=12, fontweight='bold')
ax2.set_title('Output vs. Capital (Holding Labor Constant)', fontsize=13, fontweight='bold')
ax2.grid(True, alpha=0.3, linestyle='--')
ax2.legend(loc='best', fontsize=9)
# Plot 3: Output vs. Labor (holding capital constant)
ax3 = fig.add_subplot(2, 2, 3)
K_fixed = 50
Y_vs_L = A * (K_fixed ** alpha) * (L ** (1 - alpha))
ax3.plot(L, Y_vs_L, 'r-', linewidth=2.5, label=f'Capital = {K_fixed:.0f}', alpha=0.8)
K_fixed2 = 75
Y_vs_L2 = A * (K_fixed2 ** alpha) * (L ** (1 - alpha))
ax3.plot(L, Y_vs_L2, 'orange', linewidth=2.5, label=f'Capital = {K_fixed2:.0f}', alpha=0.8)
ax3.set_xlabel('Labor (L)', fontsize=12, fontweight='bold')
ax3.set_ylabel('Output (Y)', fontsize=12, fontweight='bold')
ax3.set_title('Output vs. Labor (Holding Capital Constant)', fontsize=13, fontweight='bold')
ax3.grid(True, alpha=0.3, linestyle='--')
ax3.legend(loc='best', fontsize=9)
# Plot 4: Growth Accounting - Contribution of Each Factor
ax4 = fig.add_subplot(2, 2, 4)
# Simulate growth over time
years = np.arange(0, 20, 1)
initial_Y = 100
initial_K = 50
initial_L = 50
# Growth rates
g_A = 0.02 # Technology growth: 2% per year
g_K = 0.03 # Capital growth: 3% per year
g_L = 0.01 # Labor growth: 1% per year
# Calculate cumulative growth
A_t = A * (1 + g_A) ** years
K_t = initial_K * (1 + g_K) ** years
L_t = initial_L * (1 + g_L) ** years
# Output using production function
Y_t = A_t * (K_t ** alpha) * (L_t ** (1 - alpha))
# Growth accounting decomposition
# Y growth = A growth + α × K growth + (1-α) × L growth
growth_tech = g_A * 100
growth_capital = alpha * g_K * 100
growth_labor = (1 - alpha) * g_L * 100
total_growth = growth_tech + growth_capital + growth_labor
categories = ['Technology\n(A)', 'Capital\n(α × g_K)', 'Labor\n((1-α) × g_L)', 'Total Growth']
contributions = [growth_tech, growth_capital, growth_labor, total_growth]
colors_growth = ['purple', 'blue', 'green', 'red']
bars = ax4.bar(range(len(categories)), contributions, color=colors_growth,
alpha=0.7, edgecolor='black', linewidth=1.5)
ax4.set_xlabel('Growth Component', fontsize=12, fontweight='bold')
ax4.set_ylabel('Contribution to Growth (%)', fontsize=12, fontweight='bold')
ax4.set_title('Growth Accounting: Contribution of Each Factor', fontsize=13, fontweight='bold')
ax4.set_xticks(range(len(categories)))
ax4.set_xticklabels(categories)
ax4.grid(True, alpha=0.3, linestyle='--', axis='y')
ax4.axhline(y=0, color='black', linestyle='-', linewidth=1)
# Add value labels
for i, (bar, contrib) in enumerate(zip(bars, contributions)):
height = bar.get_height()
ax4.text(bar.get_x() + bar.get_width()/2., height + 0.1,
f'{contrib:.2f}%', ha='center', va='bottom',
fontsize=10, fontweight='bold')
plt.tight_layout()
display(fig)
plt.close(fig)
# Create second figure showing output growth over time
fig2, ax = plt.subplots(figsize=(14, 8))
ax.plot(years, Y_t, 'b-', linewidth=3, marker='o', markersize=6, label='Total Output (Y)', alpha=0.8)
ax.plot(years, A_t * 50, 'purple', linewidth=2, linestyle='--', label='Technology Component (A)', alpha=0.7)
ax.plot(years, K_t, 'g-', linewidth=2, linestyle='--', label='Capital (K)', alpha=0.7)
ax.plot(years, L_t, 'orange', linewidth=2, linestyle='--', label='Labor (L)', alpha=0.7)
ax.set_xlabel('Years', fontsize=12, fontweight='bold')
ax.set_ylabel('Value (Index: Year 0 = 100)', fontsize=12, fontweight='bold')
ax.set_title('Production Function Growth Over Time: Y = A × K^α × L^(1-α)', fontsize=14, fontweight='bold')
ax.grid(True, alpha=0.3, linestyle='--')
ax.legend(loc='best', fontsize=10)
# Add growth rates annotation
ax.text(0.02, 0.98, f'Growth Rates:\ng_A = {g_A*100:.1f}% (Technology)\ng_K = {g_K*100:.1f}% (Capital)\ng_L = {g_L*100:.1f}% (Labor)\n\ng_Y ≈ {total_growth:.2f}% (Output)',
transform=ax.transAxes, fontsize=10, fontweight='bold',
bbox=dict(boxstyle='round', facecolor='yellow', alpha=0.9),
verticalalignment='top', family='monospace')
plt.tight_layout()
display(fig2)
plt.close(fig2)
print(f"\n📊 **Production Function Analysis**")
print(f"{'='*70}")
print(f"Production Function: Y = A × F(K, L)")
print(f" where Y = Output (GDP)")
print(f" A = Technology/Total Factor Productivity (TFP)")
print(f" K = Capital stock")
print(f" L = Labor force")
print(f" F(K,L) = Function combining capital and labor")
print(f"{'='*70}")
print(f"Growth Accounting:")
print(f" Growth of Y = Growth of A + α × Growth of K + (1-α) × Growth of L")
print(f" where α = Capital share (typically 0.3-0.4)")
print(f"{'='*70}")
print(f"Example Growth Decomposition:")
print(f" Technology Growth (g_A): {g_A*100:.2f}%")
print(f" Capital Growth (g_K): {g_K*100:.2f}% → Contribution: {growth_capital:.2f}% (α × g_K)")
print(f" Labor Growth (g_L): {g_L*100:.2f}% → Contribution: {growth_labor:.2f}% ((1-α) × g_L)")
print(f" Total Output Growth (g_Y): {total_growth:.2f}%")
print(f"{'='*70}")
print(f"✅ Technology (TFP) is the key driver of long-term growth")
print(f"✅ Capital and labor contribute according to their shares")
print(f"✅ Growth accounting explains economic growth sources")Growth Rates are typically expressed as annual percentage changes. A 3% growth rate means the economy is 3% larger than the previous year. Small differences in growth rates compound over time - a 3% growth rate doubles the economy in about 24 years, while a 2% growth rate takes about 35 years.
Convergence is the tendency for poorer countries to grow faster than richer countries, catching up over time. This occurs because poorer countries can adopt existing technologies, while richer countries must invent new ones. However, convergence is not guaranteed - it requires good institutions, education, and policies.
Economic growth affects financial markets because it affects corporate profits, interest rates, and asset prices. Higher growth typically leads to higher stock prices (as profits increase) and higher interest rates (as demand for credit increases).
In Module 3: Economics Foundations
- Introduction
- Microeconomics Basics: Individual Decisions and Market Behavior
- Macroeconomics Fundamentals: The Economy as a Whole
- Supply and Demand: The Foundation of Price Determination
- Market Equilibrium: When Supply Meets Demand
- Inflation and Deflation: The Value of Money Over Time
- GDP and Economic Indicators: Measuring Economic Health
- Economic Policy and Central Banking
- Global Economic Systems
- End-of-Module Assessment