We propose an econometric framework for estimating capital shortfalls of bank holding companies (BHCs) under pre-specified macroeconomic scenarios. To capture the nonlinear dynamics of bank losses and revenues during periods of financial stress, we use a fixed effects quantile autoregressive (FE-QAR) model with exogenous macroeconomic covariates, an approach that delivers a superior out-of-sample forecasting performance compared with the standard linear framework. According to the out-of-sample forecasts, the realized net charge-offs during the 2007-09 crisis are within the multi-step-ahead density forecasts implied by the FE-QAR model, but they are frequently outside the density forecasts generated using the corresponding linear model. This difference reflects the fact that the linear specification substantially underestimates loan losses, especially for real estate loan portfolios. Employing the macroeconomic stress scenario used in CCAR 2012, we use the density forecasts generated by the FE-QAR model to simulate capital shortfalls for a panel of large BHCs. For almost all institutions in the sample, the FE-QAR model generates capital shortfalls that are considerably higher than those implied by its linear counterpart, which suggests that our approach has the potential for detecting emerging vulnerabilities in the financial system.