Essays in macroeconomics and economic geography