The Auctioneer Calls Out Prices

tatonnement · excess demand · numeraire · iteration · convergence

Nobody in a market economy knows the equilibrium prices in advance. Walras pictured an auctioneer who calls out prices, listens to how much of each good people want, and raises the price of what is short and lowers the price of what is left over, before any trade happens. This groping toward equilibrium is called tatonnement.

Households trade m goods. Household i owns e_{ij} units of good j and has Cobb-Douglas tastes with positive weights w_{ij}: at prices p its income is \sum_j p_j e_{ij}, and it spends the share w_{ij} / \sum_k w_{ik} of it on good j. The excess demand z_j is total demand for good j minus the total amount E_j = \sum_i e_{ij} that exists.

The auctioneer starts at the given prices (good 1, index 0, is the numeraire and starts at price 1) and repeats:

  1. Compute every z_j at the current prices. If every relative excess demand |z_j| / E_j is below tol, stop and return (prices, rounds), where rounds counts the adjustments made so far.
  2. If max_rounds adjustments have already been made, give up and return None.
  3. Adjust every price at once, using the excess demands from step 1: p_j \leftarrow p_j \,(1 + \text{step} \cdot z_j / E_j).
  4. Divide every price by the new p_1, so the numeraire is back at 1. That completes one round.

Write tatonnement(weights, endowments, prices, step, tol, max_rounds).

Examples

Input:  weights = [[2, 3], [1, 1]], endowments = [[20, 0], [0, 60]], prices = [1, 1],
        step = 0.5, tol = 1e-6, max_rounds = 1000
Output: ([1.0, 0.40000042], 17)
Explanation: at equal prices wool is short (90% more is wanted than exists) and apples
are left over, so apples get cheaper relative to wool, round after round, toward 0.4.

Input:  the same, with max_rounds = 10
Output: None

Input:  the same, with prices = [1, 0.4] and max_rounds = 10
Output: ([1, 0.4], 0)
Explanation: these prices already clear both markets.

Constraints

  • answers are compared with a relative tolerance of 1e-6; do not round

Goals

  • Adjust prices in proportion to relative excess demand, following a stated rule exactly
  • Renormalise prices after every step so the numeraire keeps the price 1
  • Stop on a tolerance or give up after a budget of rounds
Starting Python…