After a long slump, the interest rate in Eskar has fallen to zero, and the central bank wonders whether printing more money will help. Output Y is in millions of base-year crowns per year, the interest rate r is a fraction (5 % is 0.05), T is a fixed tax, G government purchases, M the money supply and P the price level, which stays fixed. The goods market clears as usual: Y = C + I + G with C = c_0 + c_1 \, (Y - T) and I = i_0 - i_1 \, r.
The money market has a floor: nobody lends at a negative rate, because holding money pays zero. Real money demand is k \, Y - h \, r, and the rate is
so when money demand at a zero rate, k Y, is no more than the real money supply M / P, people simply hold the extra money and the rate stays at 0. The economy is at the one pair (Y, r) where both markets hold (the equilibrium).
Write trap_policies(e, dG, dM) that returns a dict with four entries:
"base": the equilibrium(Y, r)ofe;"fiscal": the equilibrium(Y, r)after addingdGtoG(nothing else changed);"monetary": the equilibrium(Y, r)after addingdMtoM(nothing else changed,Gas ine);"escape_G": the largest rise inG(frome's value) that still leaves the equilibrium rate at0;0if the rate is already above0.
The tests build each economy with the helper economy(c0, c1, T, i0, i1, G, k, h, M, P), which returns the dict {"c0": c0, "c1": c1, "T": T, "i0": i0, "i1": i1, "G": G, "k": k, "h": h, "M": M, "P": P}; you may use it too.
To see why one policy moves output and the other does not, make a list ys of outputs, compute the rate on the IS line and on the floored LM curve at each, and press Run with plot(ys, is_rates, label="IS") and plot(ys, lm_rates, label="LM").
Examples
Input: e = economy(100, 0.75, 100, 300, 2000, 200, 0.5, 4000, 2400, 2), dG = 50, dM = 200
Output: {"base": (2100.0, 0.0), "fiscal": (2300.0, 0.0), "monetary": (2100.0, 0.0), "escape_G": 75.0}
Explanation: at r = 0 the goods market clears at 525 / 0.25 = 2100, where money demand
is 1050, less than the 1200 supplied, so the rate stays 0. Extra money changes nothing;
50 more of G raises output by the full 50 * 4. The rate starts to rise when output
passes 1200 / 0.5 = 2400, which takes 0.25 * 300 = 75 more of G.
Input: e = economy(100, 0.75, 100, 300, 2000, 200, 0.5, 4000, 2400, 2), dG = 150, dM = -600
Output: {"base": (2100.0, 0.0), "fiscal": (2550.0, 0.01875), "monetary": (1950.0, 0.01875), "escape_G": 75.0}
Explanation: 150 more of G is more than 75, so the economy leaves the trap and part of
the rise is crowded out. A large cut in money also pulls the rate above zero.
Input: e = economy(100, 0.75, 100, 300, 2000, 200, 0.5, 4000, 1300, 2), dG = 100, dM = 200
Output: {"base": (1700.0, 0.05), "fiscal": (1900.0, 0.075), "monetary": (1800.0, 0.0375), "escape_G": 0.0}
Constraints
- answers are compared with a tolerance of
1e-6; do not round
Goals
- Solve an IS-LM model whose LM curve has a floor at a zero interest rate
- Compare fiscal and monetary policy inside and outside the trap
- Find how far purchases must rise before the rate leaves zero