Essays in International Economics and Macroeconomics with Frictions