TY - GEN AB - We study optimal monetary policy in an analytically tractable Heterogeneous Agent New Keynesian model with rich cross-sectional heterogeneity. Optimal policy differs from a Representative Agent bench-mark because monetary policy can affect consumption inequality, by stabilizing consumption risk arising from both idiosyncratic shocks and unequal exposures to aggregate shocks. The tradeoff between consumption inequality, productive efficiency and price stability is summarized in a simple linear-quadratic problem yielding interpretable target criteria. Stabilizing consumption inequality requires putting some weight on stabilizing the level of output, and correspondingly reducing the weights on the output gap and price level relative to the representative agent benchmark. <p><p>Code for peer-reviewed article published in American Economic Review. AD - Bank of Canada AD - European University Institute AD - Federal Reserve Bank of New York AU - Acharya, Sushant AU - Challe, Edouard AU - Dogra, Keshav DA - 2023-06-19 DO - 10.3886/E184261V1 DO - DOI ID - 1258 LA - eng N2 - We study optimal monetary policy in an analytically tractable Heterogeneous Agent New Keynesian model with rich cross-sectional heterogeneity. Optimal policy differs from a Representative Agent bench-mark because monetary policy can affect consumption inequality, by stabilizing consumption risk arising from both idiosyncratic shocks and unequal exposures to aggregate shocks. The tradeoff between consumption inequality, productive efficiency and price stability is summarized in a simple linear-quadratic problem yielding interpretable target criteria. Stabilizing consumption inequality requires putting some weight on stabilizing the level of output, and correspondingly reducing the weights on the output gap and price level relative to the representative agent benchmark. <p><p>Code for peer-reviewed article published in American Economic Review. PB - American Economic Association PY - 2023-06-19 T1 - Code for: Optimal Monetary Policy According to HANK TI - Code for: Optimal Monetary Policy According to HANK Y1 - 2023-06-19 ER -