Essays on macroeconomics and finance