# F5-conf-01 — Competitive equilibrium of a two-agent, two-good exchange economy ## Question What is the Walrasian equilibrium of a pure exchange economy with two agents A and B? Both have Cobb–Douglas utility u_i = α_i ln x1 + (1−α_i) ln x2 and good 2 is the numeraire (p2 = 1). The quantities to find are the relative price p = p1/p2, the allocation, the excess demand for good 1 at that price, and the Walras' law residual. The closed-form price is then checked against an independent numerical root-finder. ## Data and exclusions - `data/endowments.csv` (2 rows; `n_input_rows`): A = (8, 2), B = (4, 8). All values are strictly positive, with no missing values and no duplicate agents. - `data/parameters.csv` (4 rows; `n_input_rows`): α_A = 0.4, α_B = 0.6. It also records aggregate endowments of 14.0 (good 1) and 10.0 (good 2). - **Data issue (`data_issues`):** the summary sheet gives 14.0 units of good 1 in total, but the individual endowments add up to 8 + 4 = 12. The good-2 total (10) is consistent. TASK.md names `endowments.csv` as the primary data, and market clearing only makes sense if the aggregates match what is in the agents' budgets. I therefore used the sums of the individual endowments: `aggregate_endowment_good1` = 12.0 and `aggregate_endowment_good2` = 10.0. The summary-sheet figure of 14 was not used. - No agents were excluded (`out/exclusions.csv`): 2 agents read, 0 removed, `n_analysed` = 2. No random numbers are used (`random_seed` = null). ## Method **Assumptions behind the closed form:** 1. Cobb–Douglas preferences with 0 < α_i < 1. 2. Strictly positive endowments, so every income m_i = p·e1_i + e2_i is positive and demands are interior: x1_i = α_i m_i / p and x2_i = (1−α_i) m_i. 3. Prices are normalised so that p2 = 1. Setting aggregate excess demand for good 1 to zero, Σ_i α_i (p e1_i + e2_i) = p E1, gives p* = Σ_i α_i e2_i / (E1 − Σ_i α_i e1_i). Here that is (0.4·2 + 0.6·8) / (12 − (0.4·8 + 0.6·4)) = 5.6 / 6.4. With Cobb–Douglas demands z1(p) is strictly decreasing in p, so the equilibrium is unique. **Numerical validation (the baseline check):** Brent's method (`scipy.optimize.brentq`, tolerance 1e-14) finds the root of the aggregate excess demand z1(p), which is built directly from the agents' demand functions. The bracket starts at [1e-6, 1] and the upper end is doubled until z1 changes sign. The closed-form formula is not evaluated in this step. ## Results - Equilibrium price p1/p2 = 0.875 (`price_ratio_p1_over_p2`, stored as 0.8749999999999999 in floating point). - Allocation: - Agent A: x1_A = 4.1143 (`x1_A`), x2_A = 5.4 (`x2_A`). - Agent B: x1_B = 7.8857 (`x1_B`), x2_B = 4.6 (`x2_B`). - Totals: good 1 sums to 12 (`aggregate_endowment_good1`) and good 2 sums to 10 (`aggregate_endowment_good2`), so both markets clear. - Excess demand for good 1 at p* is 0.0 (`excess_demand_good1`). The Walras' law residual p·z1 + z2 is 0.0 (`walras_law_residual`). - The numerical root is 0.875 (`price_ratio_numerical`). It differs from the closed form by about 1e-16, which is floating-point precision. - Further checks in `out/state/checks.md`: both budgets bind (A: 9.0, B: 11.5), and both agents' marginal rates of substitution equal p*. - `feasibility` = "complete". ## Uncertainty This is a deterministic theory exercise, so there is no sampling uncertainty. The only numerical error is floating-point round-off, about 1e-16 (compare `price_ratio_p1_over_p2` with `price_ratio_numerical`). The real source of uncertainty is in the inputs: if the summary-sheet total of 14 were correct and the individual endowments wrong, the formula would give p = 5.6/8.4 ≈ 0.667. The script prints this as a diagnostic, but it is not a results key and I do not report it as an estimate. Taking 14 at face value would also mean 2 units of good 1 belong to nobody's budget, which breaks the bookkeeping that Walras' law depends on. ## Limitations and open issues - I resolved the endowment discrepancy (12 vs 14) by treating the individual endowments as authoritative. If the summary sheet is in fact correct, then at least one individual endowment is wrong, and the equilibrium cannot be identified without knowing which one. - The numerical validation covers only the price, as a root of z1 within a bracketing interval. It confirms that the formula is solved correctly for these parameters; it does not test whether the model assumptions themselves hold. - The closed form holds only under the stated assumptions: interior Cobb–Douglas demands, strictly positive endowments, and the normalisation p2 = 1.