SPB Git

spb/wp29_uqo

Public

# F5-dev-01 — Cobb–Douglas consumer: closed-form demands with numerical validation

# Question

A consumer with u(x1,x2) = α ln x1 + (1−α) ln x2 maximises utility subject to p1x1 + p2x2 ≤ m, x ≥ 0. We derive the Marshallian demands, the indirect utility and the budget residual at the optimum, and check them against an independent numerical maximisation.

# Data and exclusions

Input: data/parameters.csv (4 rows, n_input_rows; SHA-256 a04798ad…, recorded in validation_details.input_sha256). α = 0.35, p1 = 2.5, p2 = 4.0, m = 120. No missing, duplicated or non-numeric values (data_issues = []). No rows excluded; 4 rows used (n_analysed; see out/exclusions.csv). These are given theoretical parameters, not observed data.

# Method

Assumptions for the closed form to be the unique optimum: 0 < α < 1, p1 > 0, p2 > 0, m > 0 (all hold here). Then u is strictly increasing in each good (local non-satiation ⇒ budget binds), strictly concave on R²₊₊, and satisfies ∂u/∂xi → ∞ as xi → 0 with u → −∞ on the boundary, so the optimum is interior. A strictly concave objective on a convex compact-relevant feasible set has at most one maximiser, so the KKT point is the unique global optimum.

Derivation. Lagrangian L = α ln x1 + (1−α) ln x2 + λ(m − p1x1 − p2x2). FOCs: α/x1 = λp1, (1−α)/x2 = λp2, budget binding. Dividing, MRS = αx2/((1−α)x1) = p1/p2. Substituting into the budget: p1x1 + p2·(1−α)p1x1/(αp2) = m ⇒ p1x1/α = m ⇒ λ = 1/m and x1* = αm/p1, x2* = (1−α)m/p2, v(p,m) = α ln(αm/p1) + (1−α) ln((1−α)m/p2).

Numerical validation (does not use the closed form). At the single parameter point in the file only: (i) bounded Brent maximisation of u(x1, (m−p1x1)/p2) over x1 ∈ (0, m/p1) — this is the reported indirect_utility_numerical; (ii) a 999,999-point interior grid on the budget line; (iii) 2-D SLSQP on u with the inequality budget constraint and non-negativity bounds (does not impose that the budget binds). No randomness is used (random_seed = null). Code: out/analysis.py.

# Results

  • x1* = 16.8 units of good 1 (x1_demand); x2* = 19.5 units of good 2 (x2_demand).
  • v = 2.9182520128635305 utils (indirect_utility).
  • Budget residual = 0.0 currency units (budget_identity_residual).
  • MRS at optimum = 0.625 = p1/p2 = 0.625 (mrs_at_optimum, price_ratio).
  • Expenditure share of good 1 = 0.35 = α (expenditure_share_good1).
  • Numerical maximum utility = 2.9182520128635305 (indirect_utility_numerical), identical to the closed form in double precision (validation_details.abs_diff_utility_closed_vs_brent = 0). Brent maximiser x1 = 16.8000002 (validation_details.brent_x1, |diff| ≈ 2.3e-7, validation_details.abs_diff_x1_closed_vs_brent). Grid and SLSQP agree (validation_details.grid_utility, validation_details.slsqp_utility); SLSQP leaves zero budget slack (validation_details.slsqp_budget_slack), confirming the budget binds.
  • feasibility = "complete".

# Uncertainty

This is a deterministic theoretical exercise; there is no sampling uncertainty. The only uncertainty is numerical: optimiser tolerance gives x1 errors of order 1e-7 (validation_details.abs_diff_x1_closed_vs_brent). Utility differences are 0 to machine precision because u is flat (second-order) near the optimum, so utility agreement is a weaker test than the agreement of the maximisers.

# Limitations and open issues

  • Validation covers only the single parameter point (α=0.35, p1=2.5, p2=4, m=120); the general formula is supported by the analytical derivation, not by a numerical sweep.
  • The grid maximiser coincides exactly with 16.8 because 16.8 is a grid node (step 4.8e-5, validation_details.grid_step_x1); this is a coincidence of the grid, not extra precision.
  • The closed form does not apply for α ∉ (0,1) or non-positive prices/income; the script would then report null for the closed-form keys.
  • Extra diagnostic keys are stored under validation_details in results.json beyond the required keys.
Files · main
Menu

Theme