Shelves Filling, Shelves Emptying

Keynesian cross · equilibrium · planned spending · inventories

In the town of Wexmoor firms produce goods worth Y (output, which is also the town's income; millions of crowns per year). Buyers plan to spend

PE(Y) = C + I + G, \qquad C = c_0 + c_1 \, (Y - T)

where I is the investment firms plan, G government purchases and T a fixed tax. When output is larger than planned spending, the goods nobody buys stay on the shelves: inventories rise unplanned by Y - PE(Y). When output is smaller, shelves are emptied and the change is negative. Output is in equilibrium when it equals planned spending, so there is no unplanned inventory change.

Write cross(c0, c1, I, G, T, Y0) that returns a tuple (Y_star, inventory_change): the equilibrium output, and the unplanned inventory change Y_0 - PE(Y_0) if firms produce Y0 instead.

To see the cross, make a list ys of outputs and a list pe of planned spending at each of them, then press Run with plot(ys, ys, label="Y") and plot(ys, pe, label="PE"): the two lines meet at the equilibrium.

Examples

Input:  c0 = 50, c1 = 0.8, I = 100, G = 120, T = 100, Y0 = 1000
Output: (950.0, 10.0)
Explanation: at Y = 1000 households consume 50 + 0.8 * 900 = 770, so planned spending is
770 + 100 + 120 = 990 and 10 of the 1000 produced pile up. At Y = 950 planned spending is
50 + 0.8 * 850 + 220 = 950 exactly.

Input:  c0 = 50, c1 = 0.8, I = 100, G = 120, T = 100, Y0 = 800
Output: (950.0, -30.0)

Constraints

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

Goals

  • Write planned spending as a function of output
  • Solve the equilibrium condition output = planned spending in closed form
  • Read a gap between output and planned spending as unplanned inventory change
Starting Python…