Mathematical Economics

I’ll demonstrate a Mathematical Economics example by solving and visualizing the Cobb-Douglas Production Function, which is fundamental in economic analysis.

We’ll analyze optimal production levels and elasticity.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

# Define global parameters
A = 1.0 # Total factor productivity
alpha = 0.3 # Output elasticity of capital
beta = 0.7 # Output elasticity of labor

def cobb_douglas(K, L):
"""
Cobb-Douglas Production Function
Y = A * K^α * L^β
"""
return A * (K**alpha) * (L**beta)

def marginal_products(K, L):
"""Calculate marginal products of capital and labor"""
MPK = A * alpha * (K**(alpha-1)) * (L**beta)
MPL = A * beta * (K**alpha) * (L**(beta-1))
return MPK, MPL

# Create data points
K = np.linspace(0.1, 10, 100)
L = np.linspace(0.1, 10, 100)
K_grid, L_grid = np.meshgrid(K, L)

# Calculate production
Y = cobb_douglas(K_grid, L_grid)

# Calculate marginal products for a specific point
K_point = 5
L_point = 5
MPK, MPL = marginal_products(K_point, L_point)

# Create plots
fig = plt.figure(figsize=(15, 10))

# 3D Production Surface
ax1 = fig.add_subplot(221, projection='3d')
surf = ax1.plot_surface(K_grid, L_grid, Y, cmap='viridis')
ax1.set_xlabel('Capital (K)')
ax1.set_ylabel('Labor (L)')
ax1.set_zlabel('Output (Y)')
ax1.set_title('Cobb-Douglas Production Surface')
fig.colorbar(surf)

# Production Contour Plot
ax2 = fig.add_subplot(222)
contour = ax2.contour(K_grid, L_grid, Y, levels=15)
ax2.clabel(contour, inline=True, fontsize=8)
ax2.set_xlabel('Capital (K)')
ax2.set_ylabel('Labor (L)')
ax2.set_title('Production Isoquants')

# Returns to Scale Analysis
K_scale = np.linspace(0.1, 10, 100)
Y_original = cobb_douglas(K_scale, K_scale)
Y_doubled = cobb_douglas(2*K_scale, 2*K_scale)

ax3 = fig.add_subplot(223)
ax3.plot(K_scale, Y_original, label='Original Scale')
ax3.plot(K_scale, Y_doubled/2, 'r--', label='Doubled Inputs/2')
ax3.set_xlabel('Input Scale')
ax3.set_ylabel('Output/Scale')
ax3.set_title('Returns to Scale Analysis')
ax3.legend()
ax3.grid(True)

# Marginal Products Analysis
MPK_curve = A * alpha * (K_scale**(alpha-1)) * (5**beta)
MPL_curve = A * beta * (K_scale**alpha) * (5**(beta-1))
ax4 = fig.add_subplot(224)
ax4.plot(K_scale, MPK_curve, label='MPK (L=5)')
ax4.plot(K_scale, MPL_curve, label='MPL (L=5)')
ax4.set_xlabel('Capital (K)')
ax4.set_ylabel('Marginal Products')
ax4.set_title('Marginal Products Analysis')
ax4.legend()
ax4.grid(True)

plt.tight_layout()
plt.show()

# Print economic analysis
print(f"\nEconomic Analysis at K={K_point}, L={L_point}:")
print(f"Output: {cobb_douglas(K_point, L_point):.2f}")
print(f"Marginal Product of Capital: {MPK:.2f}")
print(f"Marginal Product of Labor: {MPL:.2f}")
print(f"Returns to Scale: {alpha + beta:.2f}") # Should be 1.0 for constant returns

Let me explain this economic analysis in detail:

  1. Cobb-Douglas Production Function:

    • Form: $Y = A \times K^α \times L^β$
    • $A$ = Total factor productivity (set to $1$)
    • $α$ = Capital elasticity ($0.3$)
    • $β$ = Labor elasticity ($0.7$)
    • Exhibits constant returns to scale ($α + β = 1$)
  2. Visualization Components:

    • 3D Production Surface:

      • Shows how output ($Y$) varies with capital ($K$) and labor ($L$)
      • Demonstrates diminishing returns
    • Production Isoquants:

      • Contour lines showing combinations of $K$ and $L$ that yield same output
      • Convex shape reflects substitutability between inputs
    • Returns to Scale Analysis:

      • Compares original production with scaled inputs
      • Shows constant returns to scale property
    • Marginal Products Analysis:

      • Shows $MPK$ and $MPL$ curves
      • Demonstrates diminishing marginal returns

Economic Analysis at K=5, L=5:
Output: 5.00
Marginal Product of Capital: 0.30
Marginal Product of Labor: 0.70
Returns to Scale: 1.00
  1. Economic Insights:

    • Diminishing returns:
      Additional units of either input yield decreasing additional output
    • Input substitutability:
      Multiple input combinations can achieve same output
    • Constant returns to scale:
      Doubling both inputs doubles output
    • Marginal productivity:
      Shows contribution of each additional unit of input
  2. Practical Applications:

    • Production planning
    • Resource allocation
    • Investment decisions
    • Scale economy analysis

This model helps economists and business analysts:

  • Optimize production inputs
  • Understand productivity relationships
  • Make investment decisions
  • Analyze economic efficiency