Essays on the Spanish macroeconomy