{'fraction_non_alphanumeric': 0.030293566520924423, 'fraction_numerical': 0.00882861672992841, 'mean_word_length': 4.723429121407947, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Efficient Bailouts?

We develop a quantitative equilibrium model of financial crises to assess the interaction between ex-post interventions in credit markets and the buildup of risk ex ante. During a systemic crisis, bailouts relax balance sheet constraints and mitigate the severity of the recession. Ex ante, the anticipation of such bailouts leads to an increase in risk-taking, making the economy more vulnerable to a financial crisis. We find that moral hazard effects are limited if bailouts are systemic and broad-based. If bailouts are idiosyncratic and targeted, however, this makes the economy significantly more exposed to financial crises.


Introduction
In the aftermath of the 2008-2009 financial crisis, a heated debate on the desirability of bailouts has taken center stage in discussions of financial regulatory reform. Many argue that bailouts are often necessary to prevent a complete meltdown of the financial sector, which would otherwise bring an extraordinary contraction in output and employment. An alternative view argues that bailouts are costly for taxpayers and create incentives to take on even more risk ex ante, thereby sowing the seeds for future crises. Consistent with this second view, the Dodd-Frank Act has introduced stricter limits on the government's ability to conduct bailouts, for example, by restricting emergency lending programs to those of "broad-based eligibility." 1,2 How does the expectation of bailouts affect the stability of the financial sector and the real economy? Should public funds be used to bail out the financial sector? If desirable, how should bailouts be designed and how important are policies to prevent excessive risk-taking?
To address these questions, we develop a quantitative equilibrium in which credit frictions generate scope for bailouts during a financial crisis, but where the anticipation of bailouts generates more risk-taking before the crisis actually hits. We study the optimal intervention in this framework and evaluate its macroeconomic and welfare effects. Our main result is that bailouts have an important stabilizing role despite moral hazard effects, provided that these bailouts are conducted during a systemic crisis and are broad-based rather than targeted to particular institutions.
Our model features a continuum of identical firms that face two frictions in its capacity to finance investment. First, debt contracts are not enforceable, giving rise to a collateral constraint that limits the amount that firms can borrow. Second, an equity constraint imposes a minimum dividend payment that firms must make each period. In the stochastic steady state of the model, firms are able to finance the desired level of investment during normal economic conditions. However, when leverage is sufficiently high and an adverse financial shock hits the economy, firms are forced to cut down on investment, leading to a protracted recession. Anticipating that such episodes are costly, firms behave in a precautionary manner during normal times, balancing the desire to increase borrowing and investment today with the risk of becoming financially constrained in the future.
These credit crunches are socially inefficient, and this inefficiency creates a scope for bailouts. A transfer from households to firms would raise their net-worth and allow them to invest more, which in turn would benefit the households by raising future wages and dividends along the economic recovery. Moreover, we show that the competitive equilibrium is constrained-inefficient.
Even if the planner is not able to transfer resources from households to firms to directly alleviate the equity constraint, a pecuniary externality calls for policy intervention during a credit crunch. When firms hire workers, they do not internalize that by doing so they raise wages paid by other firms, which in turn drags down their profits and their ability to invest when equity constraints are binding. As a result, a social planner that is constrained by the same frictions as the private economy demand less labor, leading to higher investment and a stronger recovery from a credit crunch.
We study the optimal decisions of a government that provides debt relief to firms; that is, the government pays a fraction of firms' debt, financed by payroll taxes on firms. We label this policy "systemic bailouts" or equivalently "broad-based bailouts," because they are contingent on the realization of an aggregate (systemic) event and they apply to all institutions rather than being targeted to a few firms. Debt relief distorts ex-ante borrowing incentives: an individual firm has an incentive to borrow more because the transfer it will receive in the future is increasing in their individual debt whereas the taxes it will pay in the future (to finance the bailouts) do not depend on its choices.
If the government has access to debt taxes, the government uses both bailouts to stabilize firms' net-worth ex post and taxes on debt to offset the incentives to overborrow ex ante. Moreover, the government problem is time consistent. On the other hand, if the government does not have prudential policies, a classic time inconsistency problem in bailout policies arises. Ex post, bailouts relax balance sheet constraints, thereby speeding up the recovery from a credit crunch. Ex ante, however, the anticipation of such bailouts induces overborrowing, which makes the economy more vulnerable to a financial crisis. The desirability of bailouts depend on the balance between the ex-post benefits and the ex-ante costs.
In the quantitative investigation, we use data for the US economy as a reference, matching unconditional moments for leverage, volatility of investment, and the frequency of financial crises. We find that conditional on a crisis, optimal bailouts are on average 5 percentage points of GDP. Moreover, the multiplier effects of bailouts are large: a bailout of one percentage point of GDP in a crisis comparable to the Great Recession can lead to cumulative output gains of about 1.5 percentage points. Moreover, the multiplier effects are state-dependent as the effectiveness depends on the severity of the crisis. Bailouts also result in financial constraints becoming frequently more binding, and as a result the unconditional differences in the severity of financial crises ends up being similar with and without bailouts.
A central quantitative result is that the moral hazard effects depend critically on the way bailouts are implemented. If government bailouts are broad-based, the lack of prudential policies makes little difference for borrowing decisions as well as for the incidence and severity of financial crises. This occurs despite optimal bailouts being large and having substantial effects on the economy. Instead, bailouts that depend entirely on idiosyncratic firm decisions, what we label "idiosyncratic bailouts," lead to significantly more overborrowing and make crises more severe.
For example, during crises, the investment collapse that occurs with the idiosyncratic bailout policy is about 20 percentage points larger than with the systemic bailout policy.
The key reason why systemic bailout policies generate little moral hazard is because these bailouts are contingent on a systemic crisis and not on individual firm decisions. That is, if an individual firm becomes financial constrained, it is not granted a bailout unless the rest of the economy is also financially constrained. Because the probability of a financial crisis is exogenous to the individual firm and is a small probability event in our calibration due to the precautionary savings effect, the anticipation of bailouts do not modify much borrowing decisions. In contrast, with the idiosyncratic bailout policy, the firm directly internalizes how borrowing decisions affect debt relief policies and significantly raises leverage to take advantage of bailouts.
We emphasize that the welfare gains from systemic bailouts occur not only ex post but also ex ante. That is, even if systemic bailouts generate more risk-taking, this is to a large extent an optimal response to the insurance provided by the government. In contrast, the welfare losses that result from the anticipation of idiosyncratic bailouts can be large.
is more closely related to Keister (2012). He studies a Diamond-Dybvig economy and shows that commitment to a no-bailout policy induces banks to remain too liquid from a social point of view and may increase the vulnerability to a bank-run. Our main contribution to this literature is to provide a quantitative framework to assess the effects that bailouts have over financial stability.
In recent work, Gertler, Kiyotaki, and Queralto (2012) develop a model in which banks have access to debt and equity financing and investigate the moral hazard effects of credit policy. They restrict attention to macro dynamics around a "risk-adjusted steady state" in which financial constraints are always binding. In contrast, we study full equilibrium dynamics in a stochastic steady state in which binding financial constraints only bind occasionally. We also complement their work by characterizing and solving for the optimal bailout policy and prudential policy to avoid excessive risk-taking.
This paper is also related to a growing literature on how macroprudential policy can be used to reduce the level of financial fragility. 5 In particular, Jeanne and Korinek (2011) study a stylized three-period model with a fire-sale externality and show that there is scope for both ex-ante and ex-post policy intervention. 6 The inefficiency in this literature relates to the effects of an intertemporal reallocation of wealth of leveraged borrowers on prices affecting borrowing constraints. In contrast, the basic scope for ex post policy here arises because of the effects of intratemporal reallocations of wealth between households and firms on future production capacity. In particular, we point to a pecuniary externality involving the effects of wages on firms' equity constraints. Finally, the role for prudential policy in our setup is due purely to the need to offset moral hazard effects of bailouts.
The remainder of the paper is organized as follows: Section 2 presents the analytical framework; Section 3 analyzes the optimal intervention; Sections 4 and 5 present the quantitative analysis; Section 6 discusses the conclusions; the appendix contains the proofs and additional details.

Model
The model economy is populated by firms and workers, who are also the firms' shareholders. Firms issue bonds in world capital markets at an exogenous interest rate and face both borrowing constraints and equity constraints in their capacity to finance investment. We begin by describing the decisions made by different agents in the economy, and then we discuss the general equilibrium.
6 In a dynamic model of entry and exit in the export sector, Caballero and Lorenzoni (2014) obtain similar results involving both ex-ante and ex-post policies targeting the real exchange rate. Jeanne andKorinek (2011), andBenigno, Chen, Otrok, Rebucci, andYoung (2012) also present conditions under which ex-post policies alone can achieve first-best outcomes.

Households
There is a continuum of identical households of measure one that maximize where c t is consumption, n t is labor supply, β is the discount factor. The utility function u(·) has the constant relative risk aversion (CRRA) form and G(n) = n 1+ 1 ǫ 1+ 1 ǫ governs the disutility of labor, where ǫ is the Frisch elasticity of labor supply. The composite of the utility function has the Greenwood-Hercowitz-Huffman (GHH) form, eliminating wealth effects on labor supply. The advantage of these preferences is that they deliver realistic responses of employment during a credit crunch without introducing frictions in labor markets that would complicate the analysis.
Households do not have access to bond markets, and they are the firms' shareholders. At the beginning of the period, they hold s t shares of firms that pay d t dividends and have a market price p t , collect wages w t and use funds to buy consumption and purchase firms' shares. Their budget constraint is The first-order conditions for n t and s t+1 are n t :: s t+1 :: where u ′ (t) ≡ u ′ (c t − G(n t )). Iterating forward on (4) and imposing a no-bubble condition yields the result that in equilibrium, the price of shares must be equal to where m t,t+j ≡ (β j u ′ (c t+j − G(n t+j )))/(u ′ (c t − G(n t ))) represents the jperiod-ahead stochastic discount factor, and m t+1 will represent the one-period-ahead stochastic discount factor.

Corporate Entities
There is a continuum of identical firms of measure one that operate a production function F (z, k, h) = zk α h 1−α that combines capital, k, and labor, h, to produce a final good. Productivity, z t , follows a first-order Markov process.
Firms start the period with k t units of capital, and b t units of debt, pay dividends, d t , issue one-period non-state contingent debt, b t+1 , and invest in physical capital, i t . Accordingly, their budget constraint is where w t is the wage rate, and R t is the gross interest rate. Implicit in the budget constraint is the fact that firms cannot issue new shares (we normalize the total number of shares to 1). However, they can adjust retained earnings by cutting dividend payments and servicing debt subject to the constraints that will be described below.
Firms have the following capital accumulation technology: where δ is the depreciation rate and ψ(k t , k t+1 ) is a convex cost of adjusting the stock of capital. Adjustment costs are introduced to improve the quantitative performance of the model in terms of the volatility of investment. Moreover, they also play an important role in making crises more costly, as the sharp disinvestment that occurs during crises takes some real resources. We assume that the gross interest rate is determined exogenously in international markets. This assumption deserves some comments. On the one hand, the empirical evidence provides exhaustive evidence that foreign credit plays a key role in credit booms and bust in both developed and emerging markets (see, e.g., Reinhart andRogoff, 2009, andMendoza andTerrones, 2008). For example, Mendoza and Quadrini (2009) document that about one-half of the surge in net credit in the US economy since the mid-1980s was financed by foreign capital inflows. In addition, Warnock and Warnock (2009) show that foreign purchases of US bonds have an economically large and statistically significant impact on interest rates. Furthermore, Justiniano, Primiceri, and Tambalotti (2014) argue that supply shocks driven by foreign borrowing are important in accounting for the dynamics of housing prices, interest rates, and credit in the US economy. On the other hand, a limitation from our quantitative analysis that will use the US economy as the main reference is that our model would not feature a feedback from deleveraging to low interest rates, as was observed in the US financial crisis. Still, to accommodate the observed positive comovement between interest rates and borrowing, we will assume a positive correlation between interest rates and financial shocks that will deliver endogenously that deleveraging episodes are accompanied by low interest rates. 7 In addition to issuing intertemporal bonds, b t , firms raise funds with an intraperiod loan to finance working capital at a zero interest rate. As in Jermann and Quadrini (2012), working capital is required to cover the cash flow mismatch between the payments made to shareholders, workers, and bondholders at the beginning of the period and the realization of revenues F (z, k, h) at the end of the period. Firms' total borrowing capacity is limited by a fraction κ t of the capital stock: The parameter κ t is stochastic and represents a financial shock that alters exogenously the borrowing capacity of firms. As shown by Jermann and Quadrini (2012), this shock provides important improvements in the quantitative performance of DSGE models. 9 A possible interpretation of such shocks relates to disruptions in financial intermediaries, which become more constrained in their ability to lend or become more concerned with the riskiness of the corporate sector, as in Christiano, Motto, and Rostagno (2014). In the model simulations, we will show that when firms carry significant amounts of debt, a negative financial shock will trigger a binding credit constraint and produce a credit crunch with features that are similar to those in the data. Besides the borrowing constraint, firms in our model face an equity constraint, which will play a crucial role in our analysis. Without any constraints on equity financing, the shadow value of external funds would be equal to one in our model: resources would have the same value across firms and households. In addition, firms would be able to finance the desired level of investment by raising equity and the model would fail to reproduce the evolution of real and financial variables in the data. Furthermore, there is vast empirical evidence that documents the prevalence of equity frictions (see, e.g., Leary and Michaely, 2011 for a study of empirical determinants of the costs of issuing equity and Shleifer and Vishny, 1997 for a survey).
Ideally, we would prefer to model financial costs of raising equity endogenously, resorting to corporate finance theories about why it is costly to issue equity. 10 Since our goal is to build a model that is sufficiently simple for theoretical analysis, yet quantitatively rich enough to take to the data, we do not pursue this approach. Specifically, we assume that firms need to satisfy a lower bound on dividend payments given by A special case isd = 0, which restricts dividends to be non-negative and is a widely used limited liability constraint. The case withd > 0 captures the fact that there are benefits associated with 8 Jermann and Quadrini (2012) derive this constraint endogenously from an imperfect enforceability problem. We implicitly assume that the liquidation value of capital is set at book value rather than market value, thereby turning off a fire-sale externality mechanism (see e.g. Bianchi and Mendoza, 2010). We make this assumption purposefully to focus on the inefficiency that arises from reallocation of funds between households and firms (see also Jeanne and Korinek (2011) and Stavrakeva (2015) for an analysis of bailouts with fire-sale externalities) 9 Christiano, Eichenbaum, and Trabandt (2015) also attribute a primary role to fluctuations in the cost of working capital during the Great Recession.
10 A leading motivation for frictions on equity financing is private information about investment opportunities. For example, in Myers and Majluf (1984), good firms may find it optimal not to issue equity when they are pooled with those of lower quality. dividend payments besides the purely pecuniary benefits for shareholders. The idea of the benefits from dividend smoothing goes back to Lintner (1956), and a large corporate-finance literature has followed investigating agency problems and information asymmetries that can rationalize this behavior. In addition, Brav, Graham, Harvey, and Michaely (2005) found that firms are willing to raise external capital or forego positive NPV investments to avoid cutting dividends. We take thē d as a primitive of the environment, which has the limitation that we abstract from how shocks or policies might affect the nature of the equity constraint, but allows us to streamline the analysis and build a parsimonious model for a quantitative analysis. 11 Firms' objective is to maximize shareholder value at each point in time. That is, their problem is to maximize s t (p t + d t ) or, equivalently, E t ∞ j=0 m t,t+j d t+j , iterating forward on (4). Below we analyze the firm optimization problem in recursive form.

Recursive Problem and Optimality Conditions
The aggregate state vector of the economy is given by X = {K, B, s}, where s = {κ, z, R} is the vector of shocks. Let V (k, b, X) denote the cum-dividend market value of the firm that starts with k units of capital and b bonds when the aggregate state is X. 12 The optimization problem for firms can be written recursively as d ≥d.
(η) 11 Philippon and Skreta (2012) is an interesting study that investigates how bailout policies should be designed in a stylized model of crises resolution, when there are equity frictions due to private information.
12 Notice that if initial debt is high enough, firms would face an empty budget set. The maximum level of debt that firms can service is given by In equilibrium, this implies that firms will choose (k, b) ∈ Θ(X) where Let us denote the Lagrange multipliers on the budget constraint, borrowing constraint, and equity constraint as λ t , µ t , and η t . The optimality condition with respect to dividends indicates that the value of one more unit of funds exceeds one when the equity constraint binds: The optimality condition for labor demand equates the marginal benefits from higher production to the marginal cost, which includes the wage and the tightening effect on the working capital constraint There are also two Euler intertemporal conditions that relate the marginal benefit from distributing one unit of dividends today with the marginal benefit of investing in the available assets and distributing the resulting dividends in the next period. The Euler equations for bonds are capital are respectively b t+1 :: and complementary slackness conditions are given by In the absence of financial constraints on borrowing and dividend payments, the firm would be indifferent at the margin between equity and debt financing. Notice that when the equity constraint binds, however, there is a positive wedge between the benefits from investing in bonds or capital and the marginal cost of cutting dividends today to finance the increase in capital and bonds. Moreover, the expectation of a binding equity constraint tomorrow leads to higher benefits from asset accumulation. When the collateral constraint binds, there is a positive wedge between the marginal benefit of borrowing one more unit and distributing it as dividends in the current period and the marginal cost of cutting dividends in the next period to repay the debt increase.
In section 4, we will provide a numerical characterization of the region of the state space when these two constraints bind and will show that the two constraints will often bind at the same time. Intuitively, both constraints impose a limit on a firm's funding ability. A binding equity constraint forces higher levels of borrowing for given investment choices. Similarly, a tighter constraint on borrowing puts pressure on the firms to finance with equity and reduce dividend payments up to the limit.
The two Euler equations (11) and (12) can be combined to deliver the excess return on capital relative to bonds that we denote by This expression indicates that excess returns can be decomposed into a liquidity premium that is proportional to the Lagrange multiplier on the borrowing constraint and a risk premium that relates the covariance of returns with the stochastic discount factor. Unlike the standard formula for the risk premium, however, this formula incorporates the Lagrange multiplier on the equity constraint, in addition to the marginal utility of consumption component, which implies that the value from future asset payments includes not only the marginal utility gains from consuming those payments but also the gains from relaxing the equity constraint. This expression will be useful as we show below how the realization of bailouts as well as the anticipation of bailouts affect investment and financial decisions. 13

Competitive Equilibrium
The competitive equilibrium for a small open economy that borrows from abroad at an exogenous interest rate can be constructed in the usual form. Market clearing in the labor market requires Market clearing in equity markets requires Combining these two market clearing conditions with the households' budget constraint (2) and the firms' budget constraint (5), we obtain the resource constraint for the economy: The recursive competitive equilibrium can be defined as follows: Definition 1. A recursive competitive equilibrium is given by firms' equity value V (k, b, X) and policies d (k, b, X),ĥ(k, b, X)k(k, b, X),b(k, b, X) ; households's policies {ŝ(s, X),ĉ(s, X),n(s, X)}; a stochastic discount factor m(X, X ′ ); prices {w(X), p(X)}; and a law of motion of aggregate variables X ′ = Γ(X), such that: (i) households solve their optimization problem; (ii) firms' policies and firms' equity value solve (45a); (iii) markets clear in the equity market (ŝ(1, X) = 1) and the labor market (ĥ(K, B, X) =n(1, X)); (iv) the stochastic discount factor for firms is given by the household's marginal rate of substitution m(X, is consistent with individual policy functions and stochastic processes for κ, R, and z. In a deterministic steady state with βR < 1, the collateral constraint is always binding. 14 Away from the deterministic steady state, the collateral constraint is only occasionally binding, as precautionary savings effects lead firms to accumulate less debt. On the other hand, the equity constraint would typically not be binding in steady state. To see this, notice that if one sets steady state level of debt to zero and assuming θ = 0, one obtains using the fact that F is constant returns to scale, d ss = αF (z ss , k ss , h ss ) − k ss δ. 15 For typical values of α, δ and capitaloutput ratio, the return on capital is enough to finance investment. Considering the stochastic steady state, however, the equity constraint will bind with positive probability as states where the firm pays down significant amounts of debt or increase heavily investment may lead firms to hit the lower bound on dividend payments.

Normative Analysis
In this section, we first show that the competitive equilibrium is constrained-inefficient. Then, we study various bailout policies financed with payroll taxes and assess the role of prudential policies.

Constrained Efficiency
Let us start the normative analysis by characterizing constrained efficiency in this economy. For simplicity, let us assume there is no working capital constraint, i.e., θ = 0. (This does not affect the theoretical results but makes notation more intensive; the appendix derives all results with θ > 0.) We will show that there is a pecuniary externality that involves how the market wage affects firms' profits and the tightness of the equity constraint.
We consider a benevolent social planner that chooses labor allocations on behalf of firms and lets all remaining markets clear competitively. Formally, the planner maximizes expected lifetime 14 In the absence of a borrowing constraint, u ′ (c t )(1 + η t ) would grow at rate (1)/(βR). In addition, absent an equity constraint, the economy would converge to a steady state with a constant capital-output ratio equal to α (β −1 −1+δ) and consumption would converge to zero. If βR = 1, the steady state for capital is still pinned down by α (β −1 −1+δ) , but consumption is constant and the steady state value of debt depends on initial conditions. 15 The value ofd that makes the equity constraint binding at steady state in the general case can be computed using the following expressions: utility subject to feasibility (18), and implementability constraints given by households' first-order conditions (3) and (4), firms' first-order condition with respect to bonds (11) and capital (12), complementary slackness conditions (13-14), labor market clearing (16), and stock market clearing (17). As we show in Appendix B, implementability constraints (4) and (11-14) are slack, and hence the problem can be reduced according to the following proposition.
Notice that the marginal disutility of labor appears in the equity constraint, which has been substituted by wages. Unlike firms that are atomistic, the planner internalizes how changes in labor demand affect wages, which in turn affect the tightness of the equity constraint. This is the key pecuniary externality that justifies policy intervention. 16 The first-order condition with respect to h illustrates how the constrained-efficient allocations differ from the competitive equilibrium: The left-hand side of (20) represents the benefits from increasing employment, which are given by the marginal product of labor. The right-hand side of (20) represents the costs from raising employment, which is composed of two terms. The first term is given by the disutility of labor. The second term constitutes the key pecuniary externality: raising one unit of employment raises wages by G ′′ (h) and reduces profits by G ′′ (h)h, thereby making the equity constraint tighter, which has a shadow value of ηt u ′ (t)+ηt expressed in consumption goods. Private firms do not internalize these effects, and as a result they over-demand labor. As we will show below, this externality in Employment Competitive Equilibrium

∆ Firms Surplus in Monopsonistic Economy
Demand for Labor in Monopsonistic Economy It is also useful to contrast the optimality condition (20) in the constrained-efficient equilibrium with the one that would characterize an economy with a firm that is a monopsonist in the labor market. In this case, the firm also internalizes how labor demand affects wages, but it does so to maximize private benefit, leading to the following condition: By noting that the market power term is larger than the externality term, since (η t )/(u ′ (t)+η t ) < 1, it follows that the economy with a monopsonist leads to too little employment relative to the constrained-efficient allocations. Intuitively, the planner finds it optimal to create a labor wedge to reduce wages and prop up profits, but it does so to maximize welfare and hence does not constrain labor demand as much as the monopsonist who seeks to maximize private profits. Figure 1 provides a graphical illustration of the inefficiency in a partial equilibrium setup. The Harberger triangle represented by the BCE area denotes the second-order welfare loss of restricting employment below the competitive equilibrium. The shaded ABCD area represents the increase in profits that firms obtain in the constrained-efficient allocations, which results in a more relaxed equity constraint that leads to higher investment and higher future employment. Notice that the ABCD area is lower than the FGHI area that denotes the increase in firms' profits in the monopsonist economy.
Key to generating the pecuniary externality is the presence of the equity constraint and the fact that profits are decreasing in wages. The equity constraint generates an undercapitalization of firms in the decentralized equilibrium. When the equity constraint binds, funds are more valuable within the firms than within households. Households would not be willing to unilaterally transfer funds to firms because they only perceive the cost from doing so-or, relatedly, they are not willing to take a paycut or work for free. Instead, a social planner recognizes that the shift in labor allocations turns prices in favor of the firm, relaxes equity constraints across the corporate sector, and in turn benefits the household through higher dividends and higher wages in the future.
We would like to note that while this pecuniary externality is derived in a context with a Walrasian labor market, the key forces are likely to be present in various other settings. As long as labor supply is not perfectly elastic, wages vary with aggregate labor, and this affects the balance sheet of the firm through payroll. 17 For example, with search frictions, the outside value for an unemployed agent would depend on the aggregate demand for labor (i.e., the vacancies post by firms), and hence the same externality would be operating on the decision to post vacancies. Intuitively, if firms post fewer vacancies, this would lower wages, raise the firm surplus, and relax their equity constraints. Furthermore, long-term labor contracts might mitigate but not eliminate the wage adjustment in response to aggregate labor demand. Empirically, there is abundant evidence using disaggregated data that wages are procyclical (Bils, 1985), even when focusing on those that are already employed (Solon, Barsky, and Parker, 1994). Recent work by Schoefer (2015) also presents micro-evidence of the effect of wages on firms' investment and hiring decisions, which is at the core of the mechanism of this paper.
Before concluding this section, we note that Appendix B.5 shows that the same theoretical result generalizes to the case in which firms can issue equity at a cost.

Optimal Policy
Motivated by the previous section that showed that the competitive equilibrium is constrainedinefficient, we consider a Ramsey planner that chooses a set of tax instruments to achieve the best competitive equilibrium.
We assume that the government does not have access to lump sum taxes/transfers across firms and households. To capture bailout policies, we endow the government with a "debt relief policy" whereby the government pays a non-negative fraction γ SB t < 1 of individual private debts, and finances it with a linear payroll tax τ h t on all firms. 18 We use the superscript SB to indicate that the debt relief is a systemic bailout policy (i.e., γ SB t is a function only of aggregate states). 17 On the other hand, if demand is perfectly inelastic or if after-tax wages are sticky, then the planner can achieve a first-order gain without the second-order welfare loss that arises because of the labor wedge introduced. 18 The debt relief is natural in the context of our model given that highly leveraged firms underinvest when hit by adverse shocks that make financial constraints binding. Some form of debt relief is widely used by governments during crises.
Alternatively, one can also refer to these bailouts as broad-based because by construction the bailout is not targeted to any individual firm.
In the baseline policy experiment, we endow the government with a prudential tax on borrowing (τ b t ) that is rebated lump sum to firms (T t ), but we also study the case in which the government does not have access to the prudential tax. In addition, we will contrast the results with debt relief policies that are a function of individual firms' leverage.
With these policies, firms' budget constraints become The first-order condition with respect to b t+1 and n t yields Note that from (23), the private cost of borrowing at time t is reduced by a factor of (1 − γ SB t+1 ) in a state t + 1 in which the government provides debt relief. Notice that as of time t, the bailout is uncertain as it depends on the shock realized at t + 1, in addition to firms' aggregate choices.
The household budget constraint remains unchanged, as again we assumed that the government cannot extract resources from households and transfer them to firms.
The government balances the budget constraint period by period: 19 Given these policies, we can now formally define the regulated competitive equilibrium and the Ramsey problem.
Central to this equivalence result is the fact that by choosing a sequence of taxes on debt, the planner can control borrowing decisions and offset incentives to take excessive risk due to the debt relief policy. 20 In addition, the proposition indicates that capital accumulation is not distorted in the sense that private and social incentives are aligned. 21 Since the problem of the constrained-efficient planner (SP) is time consistent, the Ramsey problem is also time consistent.
Given proposition 2, the effectiveness of policy depends on the strength of the pecuniary externality uncovered in equation (20). To gauge the empirical importance of this externality, proposition 3 presents a simple characterization of the size of the bailout Proposition 3. The bailout perceived by firms as a fraction of output (i.e., whereη ≡ η u ′ (c) represents the shadow value from relaxing the equity constraint in real units.
Interestingly, the bailout depends on the product of two parameters of the model that are fairly well measured in the data, that is, the labor share and the elasticity of labor supply, in addition to the shadow cost of equity, which is an endogenous object in the model. The bailout is decreasing in the labor share because, the higher the labor share, the bigger the effects of reduction in wages on profits. The bailout is decreasing on the elasticity of labor supply because the higher the elasticity, the bigger the distortion in employment necessary to achieve an increase in firms' profits. In particular, labor supply were perfectly inelastic, the equity constraint could be completely relaxed at no cost. Finally, the bigger the shadow cost of equity, the bigger the benefits from bailouts.
Based on a "sufficient statistic" approach, one can readily compute a back-of-the-envelopecalculation that immediately suggests that the externality can be large. For example, setting the labor share equal to the elasticity of labor supply, and for a small value ofη, we arrive at γ SB t bt Yt ∼η. Using a conservative value for the shadow cost of equity of 5% yields an approximate bailout of 5 percent of output. Of course, in our structural model, the shadow cost of equity is endogenous and depends on firms's production and leverage decisions, which in turn depends on bailout expectations. 20 Similar results on how prudential policies can achieve the commitment solution are present in Farhi and Tirole (2012), Chari and Kehoe (2013) and Jeanne and Korinek (2011). 21 As shown in an earlier version of this paper, if the planner did not have access to a tax on labor, and instead had access to a lump sum tax on households subject to an iceberg cost, the capital accumulation would become distorted relative to the constrained-efficient allocations generating a source of time-inconsistency. Because of the pecuniary externality described above, firms would invest too much on capital since they do not internalize that higher capital stock drives wages up and tightens the equity constraint when it binds.
No Prudential Policies-Next, we analyze the case in which the planner is not endowed with prudential taxes on debt to investigate moral hazard effects. In this case, the trade-off that arises in the design of the optimal policy in the model is that debt relief relaxes the equity constraint ex post, but ex ante it generates overborrowing.
Formally, the Ramsey problem consists of choosing a pair of sequences γ SB t , τ h t ∞ t=0 that delivers the best competitive equilibrium. As we show in Appendix B.3, the optimality condition with respect to debt relief, γ SB t , yields where η p t denotes the Lagrange multiplier on the equity constraint in the Ramsey problem, ζ t constitutes the Lagrange multiplier in the government budget constraint and ξ t constitutes the Lagrange multiplier on the bond Euler equation, as defined in Appendix B. This optimality condition implies that at the optimum, the planner equates the benefits from relaxing the equity constraint by providing debt relief η p t to the marginal utility of public funds (ζ t ) and the cost from overborrowing given by the second term on the right-hand side of (27). 22 The lack of prudential policy generates a time-inconsistency problem for the planner. A commitment to relatively small bailouts, so as to limit the overborrowing distortion ex ante, turns out to be not credible ex post. In a Markov perfect equilibrium-see Appendix B for details-the optimality condition for debt relief would be γ SB t :: When the planner chooses sequentially without commitment, it does not internalize how current debt relief affects previous borrowing decisions and hence simply equates the current benefits of relaxing the equity constraint η p t to the marginal cost of public funds ζ t . As a result, under discretion, the government has incentives to do larger bailouts.
As it turns out, in the quantitative analysis we will show that the moral hazard effects from the systemic bailout policy turn out to be almost negligible, that is, borrowing decisions hardly change at all. It also follows that the time-inconsistency problem is not very severe. 23 It is important to highlight that this result occurs despite the fact that in the simulations, bailouts are 4 percentage points of GDP in an average crisis, as we will show below. The intuition for this result is that firms 22 One can also derive the optimality condition with respect to employment , which again illustrates the higher marginal cost from taxing labor and providing debt relief to firms compared to condition (20) due to the overborrowing effect caused by debt relief. 23 Technically, the fact that prudential policies matter little imply that the dynamic implementability constraint (equation (11)) does not strongly bind in the sense that imposing this constraint have little effects on welfare and allocations. Hence, it does not matter much whether the government chooses at time 0 all policies with commitment or whether it optimizes sequentially without commitment taking as given future policies.
do not receive a bailout unless there is a systemic crisis, which is endogenously a small probability event due to the precautionary savings effect. As a result, the presence of future bailouts does not significantly change their financial decisions. 24 To shed light on this result, we will contrast the systemic bailout policy with an "idiosyncratic bailout policy." The difference between these two classes of bailouts is that in the former, bailouts are non-targeted, that is, they are a function only of aggregate states, while the latter the bailout is targeted, that is, they are only a function of individual states. Formally, with the idiosyncratic bailout policy, the debt relief received by a firm with states (b t The optimality condition with respect to b t+1 carries an additional term relative to (23), the corresponding condition to the systemic bailout policy: The term γ b (t + 1) captures that when firms borrow more, they internalize that the debt relief would be higher (since naturally γ b (t + 1) > 0 in the numerical analysis), and hence they perceive the cost of borrowing to be lower.
To make the comparison as clean as possible, we will show that if we feed the sequence of debt relief policies obtained in Proposition 2, but not the sequence of debt taxes, for both economies, we will find stark differences between the two. That is, let γ SB (B t , K t ) be the debt relief policy obtained in Proposition 2, we solve the competitive equilibrium feeding in γ IB = γ SB in the idiosyncratic bailout case. As we will show below, the systemic bailout policy delivers allocations that are extremely close to the constrained-efficient allocations while the idiosyncratic bailout policy leads to significantly more overborrowing and vulnerability to frequent crises. 26 Various implementations: We close the model section with a discussion on implementation. As is often the case in Ramsey problems, Ramsey outcomes have multiple implementations. For example, the state-contingent tax on debt can be replaced with a combination of state contingent taxes on dividends (or, equivalently, a restriction on dividend payments beyondd) and taxes on capital. Specifically, whenever the tax on debt is strictly positive, a tax on dividends raised today relative to tomorrow is equivalent to a tax on debt. In addition, a tax on capital is needed to correct the distortion on the capital accumulation decision induced by the tax on dividends.
In practice, central banks implement a variety of policies with the aim of facilitating the corporate sector's access to credit. For example, under the Commercial Paper Funding Facility (CPFF), the Federal Reserve expanded eligible collateral to include commercial paper, directly targeting the corporate sector, as in our model. Other policies included in the Troubled Asset Relief Program (TARP) involved equity injections to financial intermediaries. To simplify the analysis, we do not model financial intermediaries and consider only direct bailouts to firms. It is possible, however, to map our setup to a model in which financial intermediaries face the financial frictions that firms face in our model and lend to firms subject to no agency frictions. The crucial factor of our analysis is that this intervention relaxes balance sheets across the economy and mitigates the fall in credit and investment that occurs during crises.

Numerical Solution
The model is solved using a version of the policy function iteration algorithm modified to handle the two financial constraints. Our procedure computes the value of all policy functions over a discrete grid B × K × z × κ × R. These functions are not restricted to follow a specific parametric function; for values outside the grid, we use bilinear interpolation. Using an iterative procedure, we compute the policy functions satisfying the competitive equilibrium conditions at all grid points. This procedure allows us to deal with the well-known complications of non-linearities that arise in incomplete markets. In particular, occasionally binding financial constraints create kinks in the policy functions, which leads to a different behavior of the model depending on how close is the economy to the constraints and to a stationary distribution for state variables that are not confined to a narrow region of the state space.

Calibration
We calibrate the model to a quarterly frequency using data from the US economy. To focus on the post-financial globalization period, our reference period is 1984:Q1-2014:Q4.
Functional Forms-The utility function and the adjustment cost of capital take the following form: Stochastic Processes-The shocks follow a first-order Markov process. We approximate the productivity, financial, and interest rate shocks with 3 states each, which gives a vector of 8 × 1 realizations and an 8 × 8 transition matrix P(s ′ |s). We assume that interest rates and financial shocks follow a joint Markov process independent from TFP. We make this assumption since (i) the cyclical correlation between interest rates and TFP is statistically not different from zero, and (ii) we want to capture that episodes in which financial constraints are relatively tight lead to excess savings and downward pressure on interest rates.
To determine the 4 × 4 transition matrix P ((R ′ , κ ′ )|(R, κ)), we adopt the following 16 restrictions, including the restrictions that probabilities of transitioning from each state add up to one.
First, there are 2 restrictions on π that derive from the process for R that we can obtain directly from the data. Assuming a log AR(1) process for the gross interest rate ln under the stationary distribution. The conditional probabilities for the interest rate are given by Using the ex-post real interest rate on US Treasury bills, we obtainR = 0.025, ρ R = 0.9, σ ς = 0.6%. Second, we impose 2 analogous restrictions for π, now based on the transition matrix for κ. However, because κ is not directly observable in the data, we calibrate the transition matrix for κ to match certain moments from the data, to be described below. These two restrictions on π are The fact that tight financial regimes are associated with low interest rates, as occurred during the Great Recession, suggests a positive correlation between R and κ. Accordingly, conditional on R L (κ L ) realization tomorrow, we set the probability of transitioning to κ L (R L ) to be higher than the probability of transitioning to a period with κ H (R H ). Specifically, we set where ι R , ι κ ≥ 0 are constant parameters that determine the degree of correlation between κ and R. Independence of κ and R would imply ι R = ι κ = 1, whereas perfect positive correlation would imply ι = 0. We set ι κ = 0.01, ι R = 0.5 to deliver a high but not perfect positive correlation between these two shocks. In this way, conditional on a tight financial regime tomorrow, it is 99 percent more likely that R = R L than R = R H , and conditional on R L tomorrow it is 50 percent more likely that κ = κ L than κ = κ H . 27 With these values and given the rest of the parameters of the Markov process, the correlation between these two shocks is 0.4. These 12 equations, together with the 4 restrictions that π(R i ′ , κ j ′ )|(R i κ j ) = 1 ∀i, j, i ′ , j ′ = L, H, complete the 16 restrictions needed to specify P. The two parameters that remain to be set to determine the entire system are π(κ H |κ H ) and π(κ L |κ L ). Based on evidence reported by Borio (2014) that the leverage cycle lasts for 20 years on average, we set the sum of the duration of κ L and κ H to 20 years, that is, (1)/(1 − (π(κ L |κ L )) + (1)/ (1 − π(κ L |κ H )) = 20. To establish the values of π(κ L |κ L ) and π(κ H |κ H ), we will calibrate the model to match the frequency of crises in the data. Appendix D contains the values of the transition matrix. 28 To calibrate the process for productivity, we use Fernald (2012)'s capacity utilization adjusted measure of TFP. Estimating a log AR(1) process for TFP ln(z t ) = (1 − ρ z )z + ρ z ln(z t−1 ) + ε t with ε t ∼ N (0, σ ε ), we obtain σ ε = 0.085, ρ = 0.69. We use a symmetric simple persistent rule so that z L =z − σς √ 1−ρ R , z H =z + σς √ 1−ρ R and Π(z L |z H ) = Π(z H |z L ) = (1 − ρ z )0.5 + ρ z . By independence of TFP and the joint Markov process for (R, κ), we obtain the Markov transition matrix for s as P = Π ⊗ P.
Parameter Values-Parameter values are summarized in Table 1. We need to assign values to 13 parameters that we classify in two sets. The first subset includes parameters that are chosen independently of equilibrium conditions or are calibrated using steady state targets, most of which are typical in the business cycle literature. This subset is given by {α, δ, ǫ, β, θ, χ,z}. The capital share is set to α = 0.36, the depreciation rate is set to δ = 0.025 and the risk aversion σ is set to 2, which are standard values. The Frisch elasticity of labor supply is an important parameter for the pecuniary externality because it determines how much the wage falls with reductions in employment. We set a unitary elasticity ω = 1, which is in the middle range of micro and macro estimates. In addition, given the rest of the parameters, this delivers a standard deviation of output of 1.5 percent, which is close to the standard deviation of output in US data. The value of θ is calibrated to be consistent with an empirical estimate of working capital financing of 13.3 percentage points of GDP, obtained in Bianchi and Mendoza (2015). We normalize the labor disutility coefficient χ and the average value of productivityz so that employment and output are approximately equal to one in the average simulations, which is achieved by setting z = (1)/(k(1 − α)) and χ = ((1 − α)zkα), wherek is the average value of capital.
There are seven remaining κ H , κ L , φ k , β,d, π(κ L |κ H ) . The value of κ H is set high enough so that the collateral constraint never binds when κ takes this value in the stationary distribution, which is guaranteed with κ H = 0.54. The six remaining parameters are set to jointly match a set of six long-run moments for the no-bailout-policy economy. These moments are: (1) an average capital-output ratio of 10; (2) a standard deviation of investment that is 4 times the standard deviation of GDP; (3) an average leverage ratio of 46 percent; (4) three credit crunches occurring every 100 years; (5) a probability of a binding dividend constraint equal to the probability of a binding collateral constraint. While all these parameters affect all the target moments, each parameter has a more significant impact on one particular moment, as we explain below.
The discount factor is set to match a capital-output ratio of 10, which yields β = 0.985. Given the values for δ and α, this value of β would imply a value of 9 for the capital-output ratio at an unconstrained deterministic steady state, but due to precautionary savings, the mean simulated value is about 10 percent higher. The adjustment cost on capital is calibrated to match the the standard deviation of investment relative to output for the reference period, which is equal to 4. This yields φ k = 15. The value of κ L is set to target an average leverage of 46 percent, which yields κ L = 0.47. The choice of a leverage ratio of 46 percent corresponds to the ratio of credit market instruments to assets in our reference period (see Table B102 in the Flow of Funds database).
We calibrate the probability of an adverse financial shock π(κ L |κ H ) to target the frequency of financial crises. We define a financial crisis as an episode in which the fall credit exceeds two standard deviations. Consistent with the empirical literature (e.g. Reinhart and Rogoff, 2009), we target a crisis incidence of 3 every 100 years. This yields π(κ L |κ H ) = 0.01 and implies a duration of κ H of 14 years. Moreover, given the duration of the financial cycle of 20 years, this implies a duration of the κ L regime of 6 years. This is also consistent with the fact that the duration of credit expansions tend to be longer than that of credit contractions (Borio, 2014).
We set the dividend thresholdd, so that the borrowing constraint and the equity constraint bind with the same probability in the long run. We follow this route because it is difficult to pin down from the data whether constraints on equity financing or on borrowing are more pervasive. This yieldsd = 0.068 and probabilities of binding constraints equal to 2 percent. As discussed above, a value ofd > 0 is consistent with much empirical literature that shows that there are non-pecuniary benefits from paying dividends, and that this holds even for financially distressed firms (e.g., Cohen andYagil, 2009, Bond andMeghir (1994)). With this value ofd, the equity constraint is not binding at the steady state. 29 5 Results of the Quantitative Analysis

Firms' Decisions
Before analyzing the macroeconomic and welfare effects of bailouts, we inspect the mechanisms of the model by analyzing firms' behavior across the entire state space (K, B, s). In particular, we start by analyzing in what regions of the state space financial constraints are binding, which, as we showed in Section 3, plays a key role in the normative analysis. (i) no constraint bind, (ii) only the equity constraint binds, (ii) only the borrowing constraint binds, (iv) both the equity and borrowing constraints binds. For a given level of capital, if debt is low enough, neither the equity constraint nor the collateral constraint binds. This is the 'Unconstrained Region'. Starting at a value of K <K, as the initial level of debt increases, the equity constraint becomes binding. That is, firms first exhaust their equity constraint before turning to more debt. Graphically, the region of (K, B) such that the equity constraint binds is labeled with vertical blue lines. As debt is increased further, the collateral constraint also becomes binding. This constitutes the purple region in Figure 2. Further increases in debt render the budget set of firms empty, as their revenue is not enough to service the debt. This state does not occur with positive probability in the model given that firms will not expose themselves to this outcome.

When are financial constraints binding?
Notice that for levels of K <K, the equity constraint starts binding before the borrowing constraint becomes binding as we increase the level of debt, and this reverses for values of K >K. A higher level of capital implies that the value of the firm is higher and shareholders demand higher dividend payments, and hence the firm relies relatively less on equity than debt. The red region indicates the combination of {K, B} such that the borrowing constraint binds, but not the equity constraint.
Shocks to productivity, interest rate and credit alter these regions. The pecking order we described, in which firms first exhaust the equity financing and then borrowing financing generally remains, but the thresholds at which the constraints become binding vary. A lower interest rate increases the binding borrowing region, as a lower interest rate makes borrowing more attractive, together with the fact that optimal investment increases. In addition, a lower interest rate reduces the equity binding region via two effects. For a given level of borrowing, a lower interest rate raises the price of the bonds issued by firms and also increases the demand for dividend payments by shareholders. These shifts in the binding constraints regions would reduce the values ofK andB in the context of Figure 2. TFP shocks have mixed effects on the binding regions. By raising the demand for investment, higher TFP tends to make both constraints more binding. At the same time, higher TFP also leads to higher profits, thereby reducing the need for external financing.

Policy Functions and Laws of Motion
We now analyze the equilibrium policy functions for debt and capital for the economy without intervention and compare it with the economy with the optimal bailout policy, that is, the bailout policy that implements the constrained-efficient allocations. (The role of prudential policies is presented in Section 5.4 where we study the economies with systemic bailout policy and idiosyncratic bailout policy). Figure 3 shows the laws of motion for debt (panels a and b) and capital (panels c and d) in the economy as a function of the current level of debt. That is, we look atb (k, b, {k, b, s}),k(k, b, {k, b, s}). This plot corresponds to an economy in which the current level of capital is approximately equal to the mean value, and productivity and interest rate shocks are one standard deviation below the mean. Since average output is approximately one, all variables can be interpreted as a fraction of quarterly GDP. The left (right) panel corresponds to a positive (adverse) financial shock. The blue straight line corresponds to the competitive equilibrium with a no-bailout policy (NB), and the red broken line corresponds to the optimal bailout policy (OP). Let us first describe the behavior of the economy without intervention.  The credit regime generates sharp changes in the policy functions, as can be seen from comparing the left and right panels. For the tight credit regime, the debt policy function is nonmonotonic on the level of debt. For low values of current debt, the collateral constraint is not binding. In this region, next period debt, b t+1 , is increasing in the current period debt, b t . For b > 4.85, the collateral constraint becomes binding, and next period debt is decreasing in the current debt levels. This shift in the slope occurs because as firms need to sharply cut down on investment (see panel d), the borrowing capacity shrinks.
It is also interesting to note that capital accumulation is decreasing in the level of debt, even when the collateral constraint is not binding. This occurs because a higher level of debt increases the exposure to a binding future constraint, leading to a reduction in the desire to reduce the amount of debt and, consequently, a drop in investment. In other words, a larger amount of debt raises the risk premium and reduces the portfolio allocation to capital, the risky asset (see eq. (15)).
Turning our attention to the effects of bailouts on these laws of motion, we can distinguish between the ex-post effects (i.e., the effects once the bailout is implemented), and the "ex-ante effects" (i.e., the effects before the bailout is implemented). In the terms of the ex-post effects, by providing extra resources to invest in capital, bailouts allow firms to borrow more. The increase in the ability to borrow is apparent in the downward sloping region in Figure 3, panels (b) and (d).
A central aspect of our analysis is how these ex-post responses modify the ex-ante financial decisions. In the region where the financial constraints are not binding, firms also borrow more in the competitive equilibrium with bailouts because there is a lower incentive to accumulate precautionary savings during normal times, since crises become less severe. This effect is markedly stronger when the economy has a positive financial shock and has a relatively large amount of debt, so that a future financial crisis is relatively likely. As a result of the increase in borrowing, financial constraints bind more often.
The anticipation of bailouts also affects capital accumulation, as bailouts change the risk-return trade-off between capital and bonds. By relaxing equity constraints, bailouts make the stochastic discount factor less volatile, reduce the risk premium, and lead to more capital accumulation. Bailouts also have effects on the return on capital. By reducing the contraction in investment, bailouts mitigate the fall in the shadow price of capital, leading to more investment. On the other hand, the contraction in labor arising from the payroll tax to finance the bailout, reduces the marginal product of capital discouraging investment. Overall, the positive effects on capital accumulation prevail, as Figure 3 shows.

Impulse Responses
We now conduct a non-linear impulse response to show how the economy reacts to shocks and how policy shapes these effects.
We focus here on a negative financial shock (the impulse responses to the interest rate and TFP shocks are reported in Appendix A). For this exercise, we set initial values for capital at its mean value, an initial value of debt so that a switch from κ H to κ L leads to a bailout that is one standard deviation above the bailout mean conditional on being positive. Because of the simple shock structure with two values for each, rather than starting the other two shocks at the mean values, we consider all possible combinations of shocks and average them according to the stationary distribution.Starting at those initial values for the shocks, we simulate the shock process for 10,000 times for 30 periods and feed them into the policy functions to produce 10,000 paths for the endogenous variables. 30 We report in Figure 4 the average differences between the paths that start with κ L vis a vis those that start with κ H for the NB economy, and for OP we Notes: Impulse responses are computed via simulations starting at a mean value of capital and a value of debt so that the bailout on impact is one standard deviation above the mean bailout conditional on being positive. All variables are expressed as deviations between the simulated path that starts with with κ L relative to the simulated path for the no-bailout policy economy that starts with κ H . With the exception of η, µ, and bailouts all deviations are in percentage. Bailouts are computed as γ SB t b t and expressed in percentage of GDP.
report the difference of the path for κ L relative to the path with κ H for NB. 31 As Figure 4 shows, employment, output, consumption, and investment all fall on impact when the economy is hit by a negative financial shock. The bailout reaches 2.9 percentage points of GDP. Output falls slightly more with the optimal bailout policy as a result of the distortionary labor tax to finance the bailout, but the recovery is realized much faster. In fact, the output losses measured as the cumulative sum of the deviations from output are 13 percent in the absence of bailouts and this losses are reduced to 8.5 percent for the optimal bailout policy. Given a bailout, γ SB b t , of 2.9 percent, this implies an average multiplier of 1.5.
On the financial side, both dividends and debt fall. Hence, firms substitute debt for equity, as documented by Jermann and Quadrini (2012). The debt reduction is smaller for the OP, however, since bailouts mitigate the fall in capital that serves as collateral and this supports a higher level of credit. The shadow price of capital (Tobin's Q) and wages also fall on impact as they follow the evolution of investment and employment. 32 Note that these impulse responses to financial shocks do not consider the risk-taking effects of bailouts because the state variables are fixed for both economies. Put differently, once bailouts are anticipated, the economy may move to states with higher leverage, and hence shocks will be significantly more amplified. Next, we conduct an experiment that sheds light on these risk-taking effects and the implications for financial crises.

Financial Crises
In this section, we conduct an event analysis to study financial crises and show how the anticipation of bailouts induces more risk-taking and how this affects the severity of financial crises. We examine what an average crisis looks like in terms of the shocks that lead to these episodes and the dynamics of endogenous variables around these episodes, as well as how these dynamics are affected by policy.
We construct comparable event windows for the two economies with the following procedure. First, we simulate the no-bailout economy for 100, 000 periods, discarding the first 500 periods as burn-in, and identify financial crises as episodes in which credit falls by two standard deviations. Second, we construct event windows around the crisis year, denoted date 0, by computing averages for each variable across the entire set of crises. We take 40 periods before and 20 periods after the crisis date (i.e., 10 years before and 5 years after). This procedure produces the NB dynamics plotted as the continuous blue lines in Figure 5. Third, we take the initial bond position at t − 40 of NB and the sequences of shocks that the NB went through in the entire window, and pass them through the policy functions of the OP. Finally, we average in each date the resulting paths for OP to generate dashed red line in Figure 5. The idea of this experiment is that by controlling for the initial state variables and by the sequence of shocks, we can conduct a clean counterfactual experiment. 33 As Figure 5 shows, the credit crunch produces a severe and protracted recession as firms' financial distress propagates to the real economy. In terms of the driving forces (see the three plots at the bottom of Figure 5), the crisis is triggered by a negative financial while TFP plays a fairly modest role. In fact, TFP is on average slightly below trend during crises but many crises in the model do coincide with positive TFP shocks. Interest rates, given the positive correlation with financial shocks, are also low during the crisis episode.
During the crisis, the financial shock tightens not only the borrowing constraint but also the equity constraint as firms seek to reduce equity payouts to mitigate the fall in investment. Output falls on impact because of the working capital constraint, and persistently due to the collapse in 32 Tobin's Q is computed as 1 + ψ/2(k t+1 /k t ) 2 . 33 A similar event analysis is constructed in Bianchi and Mendoza (2015) for the analysis of macroprudential policy. See also Mendoza (2010) for a positive analysis of the impact of collateral constraints in sudden stop economies. investment, which recovers only gradually as adjustment costs prevent a rapid buildup of capital, even after financial constraints cease to bind. Employment follows a similar pattern: it drops on impact as the shadow cost of hiring increases and remains below trend even as the low capital stock reduces the marginal product of labor. After several periods, employment and output remain significantly below average. The magnitudes of crises in the model are comparable to the data from the Great Recession, where the falls in output, employment and investment reached respectively 6, 8 and 28 percent. 34 Perhaps, the main anomaly in the model relative to the data is that the model predicts a strong but very short slump in investment, whereas in the data the contraction was more protracted. The bailout, γ SB t b t is on average about 5 percentage points of GDP. A key observation is that, anticipating future bailouts, OP experiences a much larger increase in leverage at the beginning of the window. While crises are preceded by increases in leverage, (b t+1 )/(k t+1 ), for both NB and OP, the increase in larger is much larger in OP. As it turns out, because of this increase in leverage, OP experiences crises with about the same severity as NB. Hence, the government bailouts help to stabilize the economy ex post, as shown in the impulse responses in Figure 5, but once agents anticipate the bailouts, they increase their leverage and become exposed to crises of about the same intensity.
It is important to recall that in this case, the government is offsetting the moral hazard effects with prudential policy, and hence the increase in leverage is efficient. That is, it reflects the fact that the government is making crises less severe by correcting an externality, and this acts as better insurance for firms. Shutting down prudential policies would cause an even larger increase in leverage than what is socially optimal. As we will show below, the moral hazard effects will depend crucially on whether the bailout is systemic or idiosyncratic.

Moral Hazard: The Role of Prudential Policies
In this section, we ask how critical are policies to prevent excessive risk-taking? Following the same procedure to construct the event analysis from Figure 5, we compare NB and OP with the systemic bailout policy and the idiosyncratic bailout policy. Figure 6 shows the results of this experiment. To be able to zoom better into the differences across policies, the figures narrows the window to 10 periods before the crisis and 5 periods after the crisis.
As Figure 6 shows, there are substantial differences depending on whether the bailout is systemic or idiosyncratic. The economy with the systemic bailout policy differs minimally from the optimal policy, which is consistent with the fact that the tax on debt in the optimal bailout policy case is very low, as panel (f) shows. That is, moral hazard effects are very limited when bailouts are broad-based. On the other hand, the economy with the idiosyncratic bailout policy experiences a significant increase in leverage relative to the optimal bailout policy and as a result experiences a larger crash. In particular, output and investment fall respectively about 9 and 20 percentage points more.
Bailouts are also much larger with the idiosyncratic bailout policy, as panel h shows. In the idiosyncratic bailout case, the bailout reaches 10 percentage points of GDP versus 5 percentage points for the systemic bailout policy. Despite this larger bailout, financial constraints are strongly more binding as reflected in higher Lagrange multipliers for the equity and borrowing constraint (panels k and l). The increased severity in financial crises also leads to twice as high unconditional standard deviation of output. Overall, the key result is that the fact that firms internalize how their borrowing decisions affect future bailouts leads them to borrow more compared to the systemic bailout policy, and this results in higher volatility and more severe crises. 35

Welfare
Next, we compute the welfare gains from policy intervention. We consider the welfare effects of the three cases analyzed above: (a) optimal bailout policy, (b) systemic bailout, and (c) idiosyncratic bailout. We compute the percentage increase in consumption across all ω 0 that leaves a household 35 We note that these results do not rely on issues related to the initial conjecture of the equilibrium in the numerical algorithm (see Appendix C). For example, when we iterate backwards on the systemic bailout policy using the allocations of the idiosyncratic bailout policy as initial guess, we arrive at the same systemic bailout policy equilibrium as if we started from the optimal bailout policy. As we explained above, the difference relative to the multiplicity results in Farhi and Tirole (2012) with risk-neutral bankers is that here the usual forces that make risk-averse agents be more cautious when risk goes up offset the forces toward strategic complementarities introduced by non-targeted bailouts. indifferent between living in an economy with the corresponding government policy and remaining in a no-bailout policy economy. That is, for every possible initial state, we compute where c N B t , n N B t correspond to the policies in the no-bailout policy economy, and the superscript ⋆ corresponds to the economy with a specific bailout policy. Welfare gains, ω 0 , for different policies for an initial value of capital 10 percent below the mean, κ = κ L , R = R L , z = z L Figure 7 shows the comparison of the welfare gains for the three economies for different values of bonds. The welfare gains correspond to a value of capital 10 percent below the mean and shocks such that κ = κ L , z = z L , R = R L . For the optimal policy, welfare gains reach higher values when the economy starts at a high level of debt since it is in such state that bailouts are implemented and mitigate the crisis. In addition, this figure shows that the systemic bailout policy delivers welfare gains that are almost indistinguishable to the optimal policy. This is consistent with the previous section that showed that the absence of prudential policy does not significantly increase financial fragility when bailouts are contingent on a systemic financial crisis.
On the other hand, idiosyncratic bailouts deliver substantial welfare losses for the entire range of bonds. These welfare losses, however, are non-monotonic on the level of debt. Welfare losses reach their minimum when the economy has a high value of debt but has not reached a crisis state. This is because the overborrowing distortion becomes more severe. For even higher levels of debt, however, welfare losses are reduced. This occurs because in a crisis state, there are short-run benefits from bailouts, although these benefits are generally lower than the costs from future distortions in borrowing decisions.

Conclusion
This paper developed a quantitative equilibrium model to examine the macroeconomic and welfare effects of bailouts from both an ex-ante and ex-post perspective. We show that the competitive equilibrium is constrained-inefficient as a result of a pecuniary externality involving the effects of wages on equity constraints. Bailouts are desirable ex post because they alleviate the undercapitalization of firms during a financial crisis, which contributes to accelerating the economic recovery. Ex ante, however, bailout expectations increases the incentives to take more risk.
Our central quantitative finding is that bailouts constitute a powerful stabilizing force ex post, yet generate modest moral hazard effects when appropriately designed. Specifically, if firms perceive that becoming financially distressed does not activate bailouts unless the overall economy is also under financial distress, moral hazard effects are significantly mitigated. As a result, significant gains from bailouts arise both ex ante and ex post. Instead, an idiosyncratic bailout policy targeted to individual agents causes substantial increases in leverage and makes the economy more vulnerable to financial crises.
These results are relevant to ongoing discussions on financial regulatory reform. According to our analysis, there is a valuable role for government intervention in credit markets when these interventions occur during a systemic crisis. In fact, prohibiting bailouts can actually increase financial instability from an ex ante point of view. Bailouts, however, should be broad based rather than targeted to specific institutions, in line with the special provisions introduced in the Dodd-Frank Act. To the extent that governments in practice may way want to deviate ex post from non-targeted bailouts and apply targeted bailouts to systemically important institutions, our findings suggest that a key focus on financial regulations should be on preventing institutions from becoming "too big to fail".
In an attempt to keep our model simple for a theoretical analysis, yet sufficiently rich for a quantitative analysis, we have abstracted from several important features. In order to maintain our focus on how bailouts affect the real economy, we have modeled direct bailouts to the corporate sector. An interesting extension would be to model how bailouts affect the banking channel. Moreover, an important refinement of our work would be to consider idiosyncratic risk on firms in shaping the design of the optimal bailout policy. Finally, it would be desirable to consider how government bailouts may affect the nature of the financial contracts. These are important issues that are left for future research.

A Additional Figures
Lemma 1 (Relaxed Planner Problem). Consider planning problem 1. The last five constraints in this problem do not bind.
Proof: The proof is obtained by showing that the solution to the relaxed planning problem that ignores constraints (Bond Euler Eq.)-(CS2) satisfies these constraints. Deriving first-order conditions of the relaxed problem yield conditions (Bond Euler Eq.),(Capital Euler Eq.),(CS1) and (CS2).
Let the Lagrange Multipliers on the (Resource Constraint), (Equity Constraint) and (Borrowing Constraint) be denoted by β t λ p conditions of the relaxed problem

B.2 Proof of Proposition 2
To show the proof, let us first define the complete Ramsey problem: Problem 2. The Ramsey problem with payroll taxes (τ h t ), debt relief (γ SB t ) and debt tax (τ b t ) rebated lump sum (T t ) consists of solving: There are several steps to see that this is equivalent to Problem SP. The basic idea behind the proof is to show that the implementability constraints in Problem (2) are the same as constraints (SPa),(SPb), and (SPc) in problem (SP).
First notice that substituting the government budget constraint (33g) and (33e) into (33c) yields:d which is the implementability condition (SPa). Second, equation (33b) and (33d) coincide with the resource constraint and the borrowing constraint of the constrained equilibrium. Third, the last 4 constraints (33i)-(33l) can be shown to be slack following the same steps as in the proof of Proposition 1. Finally, given {η t , µ t , p t } required for (33i)-(33l) to hold, notice that for any level of γ SB t+1 = 1, τ b t can be set such that (33h) holds with equality.

B.3 Ramsey Policies without Prudential Taxes
Problem 3. The Ramsey problem with payroll taxes (τ h t ), debt relief (γ SB t ) consists of solving: After substituting (34g) into equation (34l), the optimality condition with respect to γ SB t is γ SB t :: where η p t is the Lagrange multiplier on the equity constraint (34c), ζ t constitutes the Lagrange multiplier in the government budget constraint (34g) and ξ t constitutes the Lagrange multiplier on the bond Euler equation (34h). This is condition (27) in the text. This problem can be expressed solely in terms of price and allocations by obtaining γ SB (34e), (34f), (34c) and substituting (34g) into (34c): where we have also dispensed equation (34j) which can be shown not be binding, following the same steps as in Propositions 1 and 2. In contrast with the Ramsey problem with debt taxes, the bond and capital Euler equations are potentially binding. Notice that while the debt relief policy does not show up explicitly in the capital Euler equation, capital accumulation still affects indirectly borrowing choices, and hence the Euler equation for capital cannot be disposed unlike in Problem (2).
Discretionary optimal bailout policy-Given future debt relief policy γ SB and implied future consumption policies C and labor allocations H, the planner solves the following Bellman equation at each point in time.
Following the same notation for the Lagrange multipliers, the optimality condition with respect to γ SB t is which is condition (28) in the text. It is easy to see that the constraint γ SB t ≥ 0 never binds because after taking first order condition with respect to h, this yields equation (20), that is, the same condition from the constrained-efficient allocations. A Markov perfect equilibrium requires that the policies {c * , h * , γ SB * , µ * , η * } that solve the Bellman equation (

B.4 Proof of Proposition 3
Using the budget constraint of the government and the definition of labor share, dividing by output, and using the definition of labor share, we have that In addition, rearrange (24) and use labor market clearing h t = n t to obtain Using (20), we obtain Substituting Plugging in (43) into (40) yields Dividing equation (44) by u ′ (c t ) and conducting the change of variablesη t = ηt u ′ (ct) , we obtain Finally, with θ = 0 and constant returns to scale, the labor share equals 1 − α, leading to equation (26).

B.5 Constrained Inefficiency with Equity Injections
We allow firms to pay an arbitrarily low dividend, i.e., issue arbitrarily large amounts of equity, while subject to a cost of paying dividends belowd. 38 Formally, denote the resource cost of paying 38 At the expense of more notation, we can allow firms to change the amount of shares s t with analogous results. d dividends by Λ(d) and assume Λ(d) = 0 ∀d ≥d. The problem of the firm becomes The first-order condition w.r.t. d t is This implies that the modified Bond and Capital Euler equations are Following Proposition 1, the planner's problem is s.t.
The optimality condition with respect to h shows that the same externality is at work when firms have access to costly equity issuances:

C Computational Algorithm
Given a set of policies τ h (X), T (X), τ b (X), γ SB (X), the computation of the competitive equilibrium requires solving for functions {B, K, I, M, C, H, d, w, p, η, µ} that satisfy the following conditions.
For an idiosyncratic bailout policy, condition (61) is replaced by.
1. Generate a discrete grid for the economy's bond position G b = {b 1, b 2 , ...b M } and capital G k = {k 1, k 2 , ...k N } and the shock state space G s = {s 1, s 2 , ...s N } and choose an interpolation scheme for evaluating the functions outside the grid of bonds. We use 90 points in the grid for bonds and 40 for capital and interpolate the functions using a piecewise linear approximation.
2. Determine the feasible space for X as follows. First determine the maximum level of debt that firms can service given an aggregate state X as follows Second solve for the feasible set Θ where w(X) = G ′ (H(X)).
(a) Guess a set Θ(X) (b) Compute b max (k, X) (c) Update Θ(X) until convergence (g) Impose both constraints being binding and solve for allocations and prices consistent with this.
6. Evaluate convergence. If sup X x i−j (X)−x i−j+1 (X) < ǫ for x = B, K, I, M, C, H, d, w, p, η, µ we have found the competitive equilibrium. Otherwise, set x i−j (X) = x i−j+1 (X) and j ; j + 1 and go to step 4.

D Transition Matrix
Following the approach described in the calibration, we obtain the following transition matrix P