Essays on macroeconomics and housing markets