This dissertation investigates several key macroeconomic topics with the use of econometric and machine learning techniques. The dissertation includes three chapters. In the first chapter, I develop a medium-scale DSGE model with real wage rigidities and financial intermediaries experiencing endogenous capital constraint and liquidity mismatch. Labor market frictions help to mitigate an endogenous labor supply insurance against fluctuations in consumption. Anticipated idiosyncratic bank runs and possibility of direct investment fix cyclical properties of financial leverage and allows explaining banks’ balance sheet dynamics over crisis. The probability of a bank run depends on bank balance sheet and endogenous assets prices. Anticipations o...