{'fraction_non_alphanumeric': 0.02761018509050005, 'fraction_numerical': 0.012342775334901319, 'mean_word_length': 4.855047299724584, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 9, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Fiscal Stimulus Under Sovereign Risk

The excess procyclicality of fiscal policy is commonly viewed as a central malaise in emerging economies. We document that procyclicality is more pervasive in countries with higher sovereign risk and provide a model of optimal fiscal policy with nominal rigidities and endogenous sovereign default that can account for this empirical pattern. Financing a fiscal stimulus is costly for risky countries and can render countercyclical policies undesirable, even in the presence of large Keynesian stabilization gains. We also show that imposing austerity can backfire by exacerbating the exposure to default, but a well-designed "fiscal forward guidance" can help reduce the excess procyclicality.


Introduction
There is a long-standing view that fiscal policy should play a stabilizing role in business cycles, especially when there are constraints on monetary policy. The textbook Keynesian argument is that by spending more in a recession, the government can prop up aggregate demand and help to mitigate the rise in unemployment. Yet, few governments in practice follow this prescription. 1 As shown in Figure 1, the recent Eurozone crisis provides another emblematic example in this regard. While facing a severe recession and mounting unemployment, governments in Southern European countries reduced spending significantly. This contraction in spending occurred despite their inability to use monetary policy, which left fiscal policy as the only instrument available for macroeconomic stabilization. In this paper, we show that sovereign risk can reverse the traditional argument for expansionary fiscal policy during a recession, and therefore rationalize the empirical evidence on the different patterns of cyclicality in fiscal policy observed around the world. Our theory lies in a fundamental conundrum that governments encounter when facing a recessions under sovereign risk: Should the government trigger a stimulus to mitigate the recession at the expense of higher sovereign spreads, or should it follow austerity to reduce the probability of a debt crisis, even if this means a more severe recession? 2 A key contribution of our paper is to explicitly model this conundrum by presenting an analysis of optimal fiscal policy in 1 a Keynesian framework under sovereign risk and characterizing the resulting trade-offs. Our quantitative results show that financing fiscal stimulus is costly for risky countries and can render countercyclical policies undesirable, even in the presence of large Keynesian stabilization gains.
The paper begins by presenting empirical evidence that sovereign default risk is a key predictor of the cyclicality of fiscal policy. Using data for a sample of around 100 countries, we document that countercyclical fiscal policies are rare in countries with high sovereign risk, measured by either sovereign credit ratings or the frequency of default. Half of the countries with low sovereign risk have a countercyclical government spending policy, but only 20% of countries with high risk exhibit such a policy. Moreover, in countries with high sovereign default risk, the correlation between government spending and GDP is between 30% and 50% higher than countries with low sovereign risk. These differences are not driven by income per capita or other macroeconomic or institutional factors identified in previous literature as relevant drivers of fiscal procyclicality.
We build a theoretical framework to study the role of sovereign risk in determining optimal fiscal policy over the business cycle. We consider a small open economy in which the government borrows externally. We first construct a benchmark environment under which Keynesian policies would be optimal, absent the risk of sovereign default. To this end, we incorporate two key elements that have been identified in theory as providing an important scope for fiscal stabilization. First, we consider nominal rigidities, in the form of downward nominal wage rigidity, and a fixed exchange rate regime. As in the classic Mundell-Fleming argument, an increase in government spending entails only limited crowding-out effects and is effective for reducing involuntary unemployment. Second, we consider households that are hand-to-mouth and face an uninsurable idiosyncratic risk of unemployment. The environment features potentially large fiscal multipliers and substantial welfare gains from fiscal stabilization policy. Such gains emerge from the stimulus effect on output and from the reduction in inequality.
A calibrated version of this model for the Spanish economy shows that when the government can commit to repaying the debt, fiscal policy is essentially Keynesian: During recessions, the government increases spending that is financed by external borrowing and stabilizes involuntary unemployment. In this setting, optimal government spending has a −0.8 correlation with economic activity, and unemployment volatility is an order of magnitude smaller than that observed in the data.
Incorporating default risk drastically changes the desirability of a Keynesian fiscal stimulus. We study the role of default risk by relaxing the assumption that the government can commit to repaying external debt, as in Eaton and Gersovitz (1981). A debt-financed stimulus raises the probability of a sovereign default in the future and therefore increases sovereign spreads.
As a result, fiscal policy now faces a trade-off between the Keynesian benefits of fiscal stimulus and the costs of higher sovereign spreads, which has been at the heart of the popular austerityversus-stimulus debate.
Quantitatively, despite the large Keynesian benefits from fiscal stimulus, default risk can overturn the nature of optimal fiscal policy. In the economy calibrated to match debt and spread levels in the data, we find that optimal policy is strongly procyclical, with a 0.7 correlation with output. This value is close to the one observed in the data for Spain and most economies with substantive default risk, and contrasts with the large negative correlation that characterizes economies without default risk. Moreover, the observed volatility in unemployment increases by an order of magnitude relative to the economy without default risk and is close to the one observed in the data.
Although the optimal fiscal policy is overall procyclical, the model displays strong state dependence, by which the response of government spending is non monotonic with respect to the level of sovereign debt. When the stock of debt is relatively low, government spending expands in recessions as the Keynesian benefits outweigh concerns about sovereign risk. When the stock of debt is very high, it is optimal for the government to default and redirect resources toward spending rather than repaying debt. For intermediate values of debt, the optimal response is characterized by austerity, since the government tends to reduce government spending to mitigate the rise in borrowing costs and reduce the probability of a debt crisis. An important implication of this state dependence is that recessions turn out to be more severe when preceded by high levels of debt. These results help to rationalize the empirical evidence provided by Romer and Romer (2019) that countries with more "fiscal space" suffer less severe recessions.
Finally, we use the model to study the desirability of austerity programs. A common premise is that austerity programs enforced, for example, by the IMF can help correct distorted incentives and ensure debt sustainability. We argue, however, that the balance between austerity and default incentives is delicate. We show that although cutting spending during a recession tends to be optimal for the government, imposing a sudden austerity program can backfire by precipitating the government to default. The intuition for these unintended consequences is that additional fiscal constraints imposed on a government can make debt repayment less attractive and push the government to default, even under circumstances in which the government would find it optimal to repay absent any constraints.
On the other hand, we show that an austerity program that constrains future spending can be beneficial. By promising less spending in the future, the government, in effect, promises lower debt accumulation and reduces future incentives to default. The result is that current borrowing costs are reduced for the government, which facilitates an expansionary fiscal policy during a recession. We refer to this policy as a form of "fiscal forward guidance," which is analogous to the classic forward guidance in monetary policy. The mechanism we highlight, however, is different, as it operates through sovereign spreads and the trade-off between stimulus and sovereign risk rather than through intertemporal substitution. 3 Importantly, we establish that the desirability of fiscal forward guidance does not hinge on a state-contingent fiscal adjustment. In addition, we show that if a state-contingent spending rule is feasible, it should specify more aggressive cuts in states tomorrow with intermediate income states. Larger cuts when income is very low are not optimal because they can exacerbate higher spreads today. Larger cuts when income is very high are also not optimal, because they deliver modest reductions in spreads ex ante and larger distortions ex post.
Related Literature. Our paper is related to several strands of the literature. First, the paper relates to the New Keynesian literature that studies the role of government spending as a macroeconomic stabilization tool. In this literature, nominal rigidities create a scope for fiscal policy to manage aggregate demand. This role becomes especially important in the presence of constraints on monetary policy, which arise in particular from a fixed exchange rate or a zero lower bound. Some recent influential examples in both open and closed economies include Gali and Monacelli (2008), Eggertsson (2011), Christiano, Eichenbaum and Rebelo (2011), Werning (2011), Woodford (2011, Nakamura and Steinsson (2014), Michaillat and Saez (2018), and Farhi and Werning (2017). 4 We contribute to this literature by incorporating sovereign risk, a central argument in policy discussions on the merits of fiscal stimulus. In addition to characterizing how sovereign risk shapes the optimal conduct of fiscal policy, we show that accounting for sovereign risk is key to understand the observed procyclicality of fiscal policy as well as the importance of fiscal space in determining the severity of recessions. Second, our model of sovereign risk follows the literature on sovereign default in the tradition of Eaton and Gersovitz (1981), Aguiar and Gopinath (2006), and Arellano (2008). A particularly relevant paper is Cuadra, Sanchez and Sapriza (2010), which was the first to establish that fiscal policy is procyclical in a canonical sovereign debt model with flexible prices. Other contributions in a similar vein are Arellano and Bai (2017), Aguiar and Amador (2011), and Balke and Ravn (2016). These papers do not consider nominal rigidities and hence do not incorporate the traditional stabilization benefits that underpin fiscal stimulus. 5 An early 3 As shown by Farhi and Werning (2017), in the New Keynesian model, future spending can be more powerful than current policy changes-a "fiscal forward guidance puzzle." See Canzoneri, Cao, Cumby, Diba and Luo (2018) for further work on this topic. The classic references on forward guidance in monetary policy are Krugman (1998), Eggertsson and Woodford (2003), and Werning (2011). 4 Related to this literature, a vast body of work empirically studies the effect of changes in government spending on the economy. See Ramey (2019) for a recent survey. 5 In Balke and Ravn (2016), there is unemployment due to search and matching frictions, but government spending affects employment through wealth effects on search efforts, not through aggregate demand, as in our setup. A common element we share with their work is that our model also features household heterogeneity and an insurance channel from fiscal policy.
contribution that incorporates nominal rigidities in the canonical sovereign default model is that of Na, Schmitt-Grohé, Uribe and Yue (2018). Focusing on the optimal exchange rate policy, they show that the model can account for the "twin Ds" phenonomenon (i.e., the joint occurrence of large devaluations and sovereign defaults). The focus of our paper, instead, is on the optimal fiscal policy in the context of a fixed exchange rate. Our contribution is to provide the first analysis of the trade-off between fiscal stimulus and sovereign risk, and show how this shapes the conduct of fiscal policy over the business cycle.
Our results on the macroeconomic and welfare effects of fiscal rules are related to an active ongoing literature. In our setup, the future path of government spending affects investors' expectations of future deficit and alters current bond prices. From a normative point of view, the potential benefits from rules arise because of the debt-dilution effects generated by long-term debt, as emphasized in Chatterjee and Eyigungor (2015), Hatchondo, Martinez and Sosa-Padilla (2016), and Aguiar, Amador, Hopenhayn and Werning, 2019. 6 We advance this literature by providing two results. First, we show that fiscal rules are particularly desirable during times of distress. Second, rules that impose too aggressive spending cuts can backfire by raising incentives to default and worsening spreads.
Our paper is also to a literature that studies how increases in sovereign spreads can translate into higher borrowing costs for the private sector and negatively affect economic activity. Important examples include Yue (2009), Broner, Erce, Martin andVentura (2014), Corsetti, Kuester, Meier andMuller (2013, 2014), Gourinchas, Philippon and Vayanos (2017), and Bocola (2016). Our framework includes both the costs of endogenous sovereign default risk and the potential Keynesian benefits of fiscal stimulus, and we characterize both theoretically and quantitatively the policy trade-off that emerges in this setup. A common element we share with Gourinchas et al. (2017) is the importance on the level of debt and fiscal consolidation in determining the magnitude of downturns.
Finally, our paper is related to the literature that has studied the difference in the cyclicality of fiscal policy between emerging and advanced economies. Several studies have documented how fiscal policies are more procyclical in emerging economies than in developed economies (see, for example, Gavin and Perotti, 1997;Talvi and Vegh, 2005;Kaminsky et al., 2004;Ilzetzki and Végh, 2008, among others). We contribute to this literature, first by 6 In a similar vein, Hatchondo, Roch and Martinez (2017) compare the welfare performance of debt and spread rules using an endowment economy model with long-term debt, while Anzoategui (2018) evaluates the macroeconomic effects in a production economy, as we do, but using empirically estimated rules. A different mechanism studied by Gonçalves and Guimaraes (2015) allows the government to choose spending in all future states of nature and through this channel reduce future temptation to default. In Lorenzoni and Werning (2019), instead, sufficiently responsive fiscal rules are shown to reduce the exposure to multiplicity. Fiscal rules have also been shown to counteract political economy distortions (Alesina and Tabellini, 1990;Azzimonti, Battaglini and Coate, 2016;Alfaro and Kanczuk, 2017). Halac and Yared (2017) and Dovis and Kirpalani (2017) study reputation mechanisms under which the government cannot commit to enforcing fiscal rules.
providing empirical evidence that sovereign risk is a key predictor of the cyclicality of fiscal policy, and second by providing a theory with endogenous default risk that can explain the empirical patterns. We view our explanation as complementary to other explanations based on political economy or institutional elements. 7 The paper is organized as follows. Section 2 presents empirical facts documenting the relationship between sovereign risk and fiscal policy. Section 3 presents the model of optimal fiscal policy in the presence of default risk and nominal rigidities. Section 4 presents the main policy trade-off. Section 5 presents the quantitative analysis of the optimal fiscal policy. Section 6 studies fiscal austerity programs. Section 7 concludes.

Empirical Facts
We provide descriptive evidence documenting that countries with higher sovereign default risk tend to have a more procyclical government spending policy. This relationship is not driven by income differences or other macroeconomic and institutional factors identified in the previous literature as important drivers of fiscal procyclicality.

Data
We measure the cyclicality of government spending and sovereign default risk for a sample of around 100 countries for the period 1990-2016. To measure the cyclicality of government spending, we use data from World Development Indicators (WDI), a dataset compiled from officially recognized international sources of data on government spending (variable "General government final consumption expenditure") and GDP for a large set of countries. 8 Table 1 presents summary statistics of the cyclical behavior of government spending around the world. We compute second moments using the cyclical component of per capita variables in constant local currency, detrending variables with the HP filter and a smoothing parameter of 100. The first two columns of Table 1 show that government spending tends to display large and persistent business cycle fluctuations. Most countries display a larger volatility in government spending than in economic activity. The third column of Table 1 shows summary statistics 7 For instance, Talvi and Vegh (2005), Alesina, Campante and Tabellini (2008), and Ilzetzki (2011) study the role of political distortions in explaining fiscal procyclicality. Another related explanation has been the "voracity effect," (e.g. Tornell and Lane, 1999), the quality of institutions and fiscal rules (Galí andPerotti, 2003, Frankel, Vegh andVuletin, 2013), financial development (Aghion and Marinescu, 2007) and inequality and social polarization (Woo, 2009). 8 The original dataset contains information on government spending and GDP during the period 1990-2016 for 167 countries. We dropped countries that were missing more than half of the values on government expenditure for the period 1990-2016 or countries with discontinuous data, leading to a sample of 122 countries, of which 98 have data available on credit ratings. The countries included in the sample are detailed in Appendix Table 6.
for our variable of interest, the correlation between government spending and output. In most countries, government spending is procyclical, with a median correlation of 0.28 between government spending and output. The cyclicality of government spending displays fairly large dispersion across countries, ranging from −0.3 in the 5th percentile to 0.78 in the 95th percentile, which we exploit in our empirical analysis.
, and corr(G, Y ) denote, respectively, the ratio of the standard deviation of government spending to the standard deviation output, the first-order autocorrelation of government spending, and the correlation between government spending and output. We compute moments using the cyclical component of per capita variables in constant local currency, detrending variables with the HP filter and a smoothing parameter of 100. The countries included are detailed in Appendix Table 6. For details on the data see Section 2.
To measure the degree of sovereign default risk faced by countries, we use data on credit ratings from Standard & Poor's. Eighty percent of the countries in our sample (98 countries) have received a sovereign credit rating at some point during the period of study. Appendix Table 7 shows that the cyclical patterns of government spending for the subsample with available credit ratings are similar to those of the full sample. To measure the degree of sovereign risk in a country, we focus on the lowest credit rating that a sovereign ever received in the period of analysis. With this variable, we want to measure how close a country was to experiencing a sovereign default. We later show similar results for a measure of default risk based on the occurrence of default episodes or the number of default episodes that the country experienced. Figure 2 shows the distribution of our measure of sovereign credit risk across countries. This distribution is characterized by a large mass of countries (62% of the sample) in a middle region of credit ratings, having received ratings no higher than A but always maintaining ratings of at least B, and a smaller mass of countries either in a low default risk region, always receiving a rating above A (20% of the countries), or in a high default risk region, having received a rating below B (16% percent of the countries).

Empirical Findings
Panel (B) of Figure 2 shows a positive relationship between the procyclicality of government spending and sovereign default risk, using the data described in the previous subsection. Countries with higher credit ratings tend to be more countercyclical. For instance, countries that received ratings below CCC display an average correlation of more than 0.6 between government spending and GDP, whereas countries that were always rated AAA tend to display countercyclical government spending, with an average correlation of −0.1.
To measure the relationship between procyclicality and sovereign risk, we estimate the regression where fiscal procyclicality i is the correlation between government spending and output from country i, sovereign risk i is a vector measuring the sovereign risk of country i, X i is a vector of country-level controls (discussed in detail later) and ε i is a random error term. In our baseline specification, we include in the vector sovereign risk i two dummy variables: medium risk, defined as a dummy variable that takes the value of 1 if a country ever had a rating below A but above B, and high risk, defined as a dummy variable that takes the value of 1 if a country ever had a rating below B. The omitted group includes countries with low default risk, measured by the fact that they always received sovereign ratings above or equal to A. Our coefficients of interest, β medium and β high , associated respectively with the variables medium risk and high risk, measure how much larger the correlation is between government 8 spending and output for countries with medium and high default risk relative to those with low default risk. Table 2 shows the results from estimating regression (1) with different sets of controls X i . The first column shows the relationship with no controls, which indicates that countries with high and medium default risk tend to have, respectively, 0.46 and 0.3 higher procyclicality than countries with low default risk. To understand this result, Appendix Tables 8-10, which include detailed data by country, show that the average correlations between government spending and GDP for high-and medium-risk countries, are, respectively, 0.41 and 0.3, whereas lowrisk countries are acyclical on average. Moreover, countercyclical fiscal policies are rarely observed in high-and medium-risk countries (the 25th percentile depicts an average positive correlation between government spending and GDP), whereas half of low-risk countries depict countercyclical policies, with prominent examples being the United States (−0.28 correlation between government spending and GDP), France (−0.6), and Sweden (−0.23).
Although low-income countries tend to have higher default risk (see Appendix Table 12), Table 2 shows that the relationship between fiscal procyclicality and default risk is not driven by the well-documented relationship between per capita income levels and fiscal procyclicality (also observed for our sample, as shown in Appendix Table 11). In particular, columns (1)-(3) of Table 2 show that the relationship between sovereign default risk and fiscal procyclicality is similar without controls than when we include log(GDP) per capita in PPP as a control variable, or when we control for dummies measuring whether the country is rich, emerging or poor. 9 The last column of Table 2 shows that the relationship between sovereign default and fiscal procyclicality is not driven by other macroeconomic and institutional controls that have been identified in the literature as important drivers of fiscal procyclicality (see, for example, Woo, 2009;Céspedes and Velasco, 2014;Guerguil, Mandon and Tapsoba, 2017). In particular, in this specification we include the following variables in the vector of controls X i : rule of law, measured by the average ranking from the WDI for the period 1990-2016; education inequality, measured by the standard deviation of the percentage of population enrolled by school level (data source: Barro and Lee, 1996); fiscal rule measured by the number of years with a fiscal rule from the International Monetary Fund; average fuel production and average trade openness as a percentage of GDP (source: WDI), and output volatility, measured as the 9 We define the dummy variables of poor, emerging, and rich countries with the thresholds defined in Uribe and Schmitt-Grohé (2017). According to their classification, a country is poor if the geometric average of its GDP per capita in PPP during the period 1990-2009 is less than $3,000 USD, emerging if it is between $3,000 USD and $25,000 USD, and rich if it above $25,000 USD. Other income controls, such as a polynomial of income, lead to similar results. standard deviation of output for the period 1990-2016 (source: WDI). 10 Appendix Table 13 shows the estimated coefficients associated with these additional variables.
High Risk 0.46 * * * 0.45 * * * 0.43 * * * 0.56 * * * (0.11) (0.12) (0.16) (0.14) Medium Risk 0.30 * * * 0.29 * * * 0.26 * 0.31 * * * (0.08) (0.10) (0.14) (0.10) where fiscal procyclicality i denotes the correlation between government spending and output from country i, medium risk i is a dummy variable that takes the value of 1 if country i ever had a rating below A but above B, high risk i is a dummy variable that takes the value of 1 if country i ever had a rating below B, X i is a vector of country-level controls, and ε i is a random error term. Standard errors are shown in parentheses. Column (1) estimates the empirical model without controls. Column (2) includes as controls the log of the average GDP per capita in PPP. Column (3) includes as controls dummies measuring whether the country is rich or emerging, using the thresholds defined in Uribe and Schmitt-Grohé (2017). Column (4) includes the following additional controls in the vector X i : rule of law, measured by the average ranking from the WDI for the period 1990-2016; education inequality, measured by the standard deviation of the percentage of population enrolled by school level (data source: Barro and Lee, 1996); fiscal rule, measured by the number of years with a fiscal rule (source: IMF); average fuel production and average trade openness, as a percentage of GDP (source: WDI); and output volatility, measured as the standard deviation of output for the period 1990-2016 (source: WDI). Tables 14 and 15 show that the relationship between fiscal procyclicality and sovereign default is robust to using other measures of sovereign default risk. Table 14 uses a dummy variable if the country ever defaulted during the period 1990-2014. The estimated coefficient is positive and statistically significant, and indicates that countries that defaulted during the period are characterized by a correlation between government spending and output that is around 0.2 percentage points larger than those countries that did not default during the period. Table 15 shows that similar results are obtained if we use the number of default events experienced by each country.

Finally, Appendix
It is worthwhile to highlight that the evidence presented in this section is descriptive and not aimed at being causal. This descriptive evidence uncovers a strong relationship between fiscal procyclicality and sovereign default risk that can guide theories that include both of these elements. In the next section, we present a model of optimal fiscal policy that generates a higher procyclicality of government spending for countries subject to default risk, in line with the empirical patterns we documented.

Model
We study fiscal policy in a small open economy model with nominal rigidities and sovereign default risk. Households are endowed with one indivisible unit of labor and a stochastic stream of tradable goods. Firms have access to a technology to produce nontradable goods using labor. The government spends toward a nontradable public good, which is financed with a fixed income tax rate and external borrowing, in the form of non-state-contingent bonds. The government is benevolent and lacks commitment to repay. On the nominal side, wages are downwardly rigid, which gives rise to the possibility of involuntary unemployment and income inequality. Monetary policy follows a fixed exchange rate regime, or equivalently, the economy is a member of a currency union.

Households
There is a unit continuum of households indexed by j. Households' preferences over private and public consumption are given by where c jt denotes private consumption of household j in period t, g N t denotes public spending in nontradable goods, β ∈ (0, 1) is the subjective discount factor, and E t denotes the expectation operator conditional on the information set available at time t. 11 We assume constant relative risk aversion utility functions for private and public consumption with the same risk aversion coefficient 1), and that the consumption good is a composite of tradable (c T ) and nontradable (c N ) goods, with a constant elasticity of substitution (CES) aggregation technology where ω ∈ (0, 1) and ξ > 0 is the elasticity of substitution between tradable and nontradable goods.
Households are endowed with one indivisible unit of labor. Because of the presence of downward wage rigidity and rationing (to be described below), each household's actual hours worked is given by h jt ∈ {0, 1}, which is taken as given by the individual household. Each period households receive a tradable endowment y T t and profits from the ownership of firms producing nontradable goods Π N t . We assume that y T t is stochastic and follows a stationary first-order Markov process. In addition, households face a tax T t (h jt ) (transfer if negative). This tax is contingent on their idiosyncratic employment status h jt , reflecting the availability of unemployment insurance. As is standard in the sovereign debt literature, we assume that households do not have direct access to financial markets, and we focus on a government that centralizes the choices of borrowing and repayment. 12 Households' sequential budget constraint, expressed in domestic currency, is therefore given by where P T t , P N t denotes the price of tradables and nontradables in units of domestic currency, W t denotes the wage in domestic currency, and Y t (h jt ) denotes the household's disposable income, which depends on aggregate variables and the idiosyncratic employment status h jt . The left-hand side of equation (3) includes total consumption expenditures, and the right-hand side includes all sources of revenues net of taxes from the government.
The households' problem consists of choosing c T t and c N t to maximize (2) given the sequence of state-contingent prices The optimality conditions of this problem yield the equilibrium price of nontradable goods as a function of the ratio between tradable and nontradable consumption: preferences, the relative consumption of tradables to nontradables consumption depends only on the relative price between these two goods.

Firms
Firms are competitive and have access to a decreasing returns to scale technology to produce nontradable goods with labor: where y N t denotes output of nontradable goods in period t, h d t denotes labor input hired by firms, and F (h) = (h d ) α . Firms' profits each period are then given by The optimal choice of labor h d t equates the value of the marginal product of labor and the wage rate, all expressed in domestic currency:

Government
The government determines public spending, external borrowing, and default decisions, subject to a predetermined tax scheme. In terms of monetary policy, we assume that the government follows a fixed exchange rate policy e t =ē. Alternatively, one can think of the economy as being part of a currency union. 13 External borrowing and budget constraint. In terms of borrowing, the government has access to long-term bonds with a deterministic decay rate Martinez, 2009, Chatterjee andEyigungor, 2012). In particular, a bond issued in period t promises to pay δ(1 − δ) j−1 units of the tradable good in period t + j, for all j ≥ 1. Hence, debt dynamics is given by where b t is the stock of bonds due at the beginning of period t, and i t is the stock of new bonds issued in period t. The government trades these long-term bonds with competitive international lenders, further explained below. Debt contracts cannot be enforced, and each period, the government may decide to default.
The government's default entails two costs. The first cost is that the government is excluded from financial markets for a stochastic number of periods. Denote by ζ t a variable that takes the value of 1 if the government can issue bonds in period t, and zero otherwise. Its evolution is given by where χ t = 0(1) if the government repays (defaults) in period t, and ϑ t ∈ {0, 1} is a random variable that takes the value of 1 in period t when the government reenters financial market, which occurs with probability θ. 14 The second cost is a utility loss for households ψ χ (y T ), which we assume to be increasing in tradable income. This utility loss can be seen as capturing various default costs related to reputation, sanctions, or misallocation of resources. 15 The government's sequential budget constraint during each period in which it has access to debt markets is given by where e t is the nominal exchange rate and q t is the price of the bond in units of foreign currency. In equilibrium the bond price will depend on the current shock, as well as on the government debt choice. The budget constraint (8) indicates that tax revenues and new debt issuance have to finance public spending and the repayment of outstanding debt obligations. When the government is in financial autarky, its budget constraint collapses to Tax scheme. We assume that the government has a limited ability to raise tax revenues.
The tax scheme has three components: taxes, transfers, and unemployment insurance. Tax revenues are a fixed proportion τ ∈ (0, 1) of households' total income. The government provides lump-sum transfers T t ≥ T . In our quantitative analysis, we rule out lump-sum taxes by setting T = 0.
Finally, in the unemployment insurance scheme the government taxes each employed household with τ e t units of domestic currency in period t and transfers τ u t units of domestic currency to each unemployed household. Absent labor disutility and moral hazard associated with unemployment insurance, an optimal insurance mechanism would equalize the disposable income for employed and unemployed households. Effectively, this would lead to a representativeagent economy with complete markets for idiosyncratic risk. To preserve meaningful heterogeneity, we assume an imperfect insurance scheme. For simplicity, we assume that this scheme is such that the disposable income of employed and unemployed households is proportional to each other, with κ ∈ [0, 1]. A value of κ = 1 represents the case with complete insurance. We require that unemployment insurance is self-financed, which implies that where h t ≡ j∈[0,1] h jt dj denote aggregate hours worked. Given that we are allowing for lumpsum transfers, the assumption that unemployment insurance is self-financed is relevant only insofar as it prevents the government from levying taxes on net with the insurance. Equations (10) and (11) define the path of state-contingent taxes {τ e t , τ u t } ∞ t=0 for any period t under the insurance scheme.
The assumed tax scheme implies that the government budget constraint in periods in which it has access to debt markets can be expressed as Effectively, the tax scheme implies that the government can only raise revenues as a proportion of income. Similarly, while excluded from credit markets, the government budget constraint is

Foreign Lenders
Sovereign bonds are traded with atomistic, risk-neutral foreign lenders. In addition to investing through the defaultable bonds, lenders have access to a one-period riskless security paying a net interest rate r. By a no-arbitrage condition, equilibrium bond prices are then given by Equation (12) indicates that, in equilibrium, an investor has to be indifferent between selling a government bond in period t at price q t and keeping the bond until next period bearing the risk of default. In case of repayment next period, the payoff is given by the coupon δ plus the market value q t+1 of the non-maturing fraction of the bonds. In case of default, the price q t+1 is equal to zero since we assume no recovery of defaulted bonds. Equation (12) will play a critical role when we turn to the optimal fiscal policy. If lenders anticipate a fiscal policy in the future that will make default more likely, they will demand lower bond prices, or equivalently higher bond returns, to compensate for a higher default risk. Similarly, if the government wants to run a debt-financed stimulus, this will increase the future default probability and reduce the current bond price today. In turn, if a default in the future is relatively more likely (e.g., because the economy is in a recession), the government will find it more costly to finance an expansionary fiscal policy.

Wage Rigidity and Competitive Equilibrium
In equilibrium, the market for nontradable goods clears: where c N t ≡ j∈[0,1] c N jt dj. We assume that the law of one price for tradable goods holds, that is, where P T, * t denotes the price of the tradable good in foreign currency, assumed to be constant and normalized to one. Using the households' budget constraint (3) and the definition of the firms' profits and market clearing condition (13), the resource constraint of the economy can be rewritten as where c T t ≡ j∈[0,1] c T jt dj. For the labor markets, we assume there exists a minimum wage in nominal terms, W , such that 16 The existence of a minimum wage gives rise to a non-Walrasian labor market. We follow the notion of equilibrium in models with rationing (e.g., Barro and Grossman, 1971;Drèze, 1975;Benassy, 1975;Schmitt-Grohé and Uribe, 2016) to determine the labor market allocations and prices. We assume that aggregate hours worked are the minimum between labor demand and labor supply, If h t < 1, it has to be that W t = W . If W t > W , the aggregate amount of hours worked equals the aggregate endowment of labor. These conditions can be summarized as When wage rigidity is binding, we assume that there is a random allocation of hours across households every period. This means that every household has a probability h t of being employed every period. This lottery is realized at the beginning of each period after the aggregate shock is realized.
A competitive equilibrium, for a given set of government policies, is then defined as follows.
Definition 1 (Competitive Equilibrium). Given initial debt b 0 and ζ 0 , and sequences of solves firm's problem.
2. Government policies satisfy the government budget constraint and the law of motion for ζ t satisfies equation (7).
5. The law of one price for tradable goods holds.

Optimal Fiscal Policy
We now study Markov equilibria in which the government chooses policies sequentially and without commitment. We consider a benevolent and utilitarian government, which chooses fiscal policies to maximize households' welfare, subject to implementability conditions. As mentioned above, we focus on a fixed exchange rate regime, which leaves fiscal policy as the central instrument for macroeconomic stabilization. 17 Welfare criterion. The objective of the government is to maximize the average expected lifetime utility of households: dj is the social period utility from private consumption. Notice that here we are using u(·) to denote u(c T , c N ) = U (c(c T , c N )). The following result establishes how, in our environment, the social period utility from private consumption admits an aggregation result, in the sense that U t (.) can be expressed as a function of only aggregate variables. Lemma 1. The social period utility from private consumption can be expressed as Lemma 1 indicates that the expression for welfare that would prevail in a representative-agent economy is modified to allow for inequality concerns, which can be summarized entirely in the term Ω(.). This result is useful because it implies that welfare can be evaluated based on a minimum but critical departure from a representative agent economy. For a given aggregate consumption bundle {c T t , c N t }, welfare is decreasing in the unemployment rate and in the dispersion of consumption between unemployed and employed agents, governed by the degree of unemployment insurance. These results follow since ∂Ω(.) ∂ht > 0 and ∂Ω(.) ∂κ > 0. Furthermore, a reduction in the unemployment rate leads to higher welfare, the bigger this dispersion in consumption is ∂Ω(.) ∂ht∂κ < 0.
Government problem. Every period in which the government enters with access to financial markets, it evaluates the lifetime utility of households if debt contracts are honored against the lifetime utility of households if they are repudiated. Given the current states, (y T , b), the government problem with access to financial markets can be formulated in recursive form as follows: where V R (y T , b) and V D (y T ) denote, respectively, the value of repayment and the value of default. The value of repayment consists of maximizing the utility flow, adjusted by inequality, plus the expected continuation value. The constraints are given by the resource constraint, the government budget constraint, and the wage rigidity that characterizes the labor market. 18 subject to We have used in this formulation that in any equilibrium with allocations (c T t , h t , g N t ), the relative price of nontradable to tradable goods can be expressed as as obtained by combining households' optimality condition (4) and market clearing condition (13). In addition, we denote by w ≡ W e the wage rigidity parameter in terms of tradable goods and by q(y T , b ) the bond price schedule, taken as given by the government.
The value of default, in turn, is given by Notice that in the problem under default, once the lump-sum transfers are set, this determines the level of spending and employment via the government budget constraint and the labor market conditions.
Equilibrium under optimal government policies.
} be the optimal policy rules associated with the government problem. A Markov-perfect equilibrium is then defined as follows.
2. The bond price schedule satisfies

Fiscal Policy Trade-Offs
In this section, we articulate the trade-off between stimulus and austerity that the government faces. We show how an increase in spending can to help reduce unemployment and expand output in a recession, in line with the Keynesian channel, and how these benefits have to be balanced with sovereign default risk concerns. This result will provide theoretical guidance to interpret the empirical findings of Section 2 when we turn to the quantitative simulations.

Stimulus versus Austerity: An Analytical Decomposition
We begin by examining the first-order condition with respect to g N in the government problem (19). Using µ and η to denote, respectively, the Lagrange multipliers associated with the wage rigidity constraint and the government budget constraint, we obtain where u N (c T , c N ) ≡ ∂u(c T In the presence of nominal rigidities, a second term in (21) emerges because private consumption is not completely crowded out by public consumption when there is slack in the labor markets. In this case, an increase in one unit of government spending in nontradables leads to a rise in the price of non-tradables that increases the value of the marginal product of labor by (∂P N t /∂g N t )F (h), which, in turn, relaxes the wage rigidity constraint that has a marginal utility benefit µ t . Essentially, the increase in government spending generates an increase in nontradable output, and hence private consumption does not fall one to one with government spending. 19 It is also worth highlighting that with nominal rigidities, the limited insurance against unemployment at the idiosyncratic level implies a welfare adjustment in the Samuelson term (i.e., the Ω(h) factor). When spending rises, employed households end up paying higher taxes than unemployed agents, and this implies that crowding out effect on nontradable consumption falls disproportionately more for these households. On the other hand, the increase in g N applies to all households equally. Because Ω(h) is increasing in h, this means that a a higher unemployment entails a lower cost from the crowding out in nontradable consumption. Effectively, when some unemployed households become employed as a result of the stimulus, this reduces the gap in inequality across households, and this calls for a more expansionary fiscal policy.
To shed light on the benefits from the stimulus term, we can turn to the first-order condition with respect to h t , to obtain an expression for the Lagrange multipliers on the wage rigidity constraint µ. Assuming h < 1, we have Equation (22) shows that whenever there is slack in the labor market, the shadow benefit from relaxing the wage rigidity constraint arises from the higher amount of output available for consumption and the reduction in inequality. These two objects are captured by the first two terms on the right-hand side of (22). In addition, two additional terms interact with the government budget constraints: an adjustment in the tax base because tax revenues are proportional to output, and a price effect that occurs because the increase in employment modifies the relative price at which the government makes purchases. These are, respectively, the third and fourth terms on the right-hand side of (22).
Let us now focus on the austerity term on equation (21). When the government faces financing frictions, there are additional costs from spending that go beyond the potential crowding-out effects of private consumption. The last term in equation (21) indicates the marginal utility cost of how an increase in spending tightens the government budget constraint. If the government spends one additional unit, it directly tightens the budget constraint by p N , which is the cost for the government to provide the extra unit of public goods. In addition, two general equilibrium effects arise from the increase in p N that results from the increase in spending. First, the increase in the price raises the inframarginal units of spending, and this tightens the budget constraint by At the same time, an offsetting general equilibrium effect occurs because the increase in g N also raises the amount of tax revenues (due to revenues representing a fraction of total income). The overall marginal utility cost of tightening the government budget constraint is given by the product of the sum of these three terms and η, the Lagrange multiplier on the government budget constraint.
We argue next that the austerity term depends critically on the degree of default risk. We have the following Euler equation for borrowing where λ t denotes the Lagrange multiplier with respect to the resource constraint of tradables in period t. This condition says that the marginal benefit from borrowing today is equated to the marginal cost of repaying the debt tomorrow. Borrowing one unit of resources today helps to relax today's government budget constraint and increase the amount of tradable resources, which has an overall marginal utility benefit of λ t + η t . By the same token, repaying the debt tomorrow has the opposite effects, as captured by the term λ t+1 + η t+1 on the righthand side. Importantly, the overall trade-off is guided by how the bond price changes in response to higher debt ( ∂qt ∂b t+1 ), which, in turn, depends on how much the government raises the degree of default risk by increasing the amount of debt. Notice that while a lower bond price reflects that the government will pay in fewer states of nature tomorrow, it still faces higer default costs, which represent a deadweight loss for the economy. If the bond price falls sharply when the government borrows more, this means that for the given expected marginal utility costs from repayment and for a given λ t , there is a larger shadow cost from tightening the government budget constraint today, η t . In turn, as indicated by equation (21) a higher η makes the austerity term bigger. Put it simply, if the bond price falls significantly, the government obtains fewer resources for the same amount of debt issuances, making stimulus less desirable.

Simple example
Under some simplifying conditions, we can provide a sharp characterization of fiscal policy that sheds further light on the different dimension of fiscal policy discussed above. In particular, under lump-sum taxes and a linear production function, we show in the next proposition that the government finds it optimal to adjust spending to implement an allocation with full employment at all times.
Proposition 1 (Benefits of Fiscal Stimulus). If there is a linear production function (α = 1) and the government has access to lump-sum taxes (T = −∞), then full employment is optimal: h t = 1 for all t.
This proposition highlights the effectiveness of fiscal policy to stabilize the economy. With a linear production function, for a given level of tradable consumption, the value of the fiscal multiplier ∆yt ∆g N t is one, meaning that whenever there is unemployment, an increase in spending does not lead to a crowding out of private consumption. To see this, notice that when the economy features unemployment, given the firms' first-order condition for labor demand, it must be that p N = w. Using market clearing conditions and households' optimization, we arrive at For a given c T , an increase in spending needs to be accommodated by a one-to-one increase in nontradable output. The linearity of the production function is key for this result. When the production function features decreasing returns, firms require a higher price to increase production, and hence this leads to a fall in private consumption of nontradables, which implies a fiscal multiplier below one.
From a normative standpoint, this implies that, as stated in Proposition 1, thanks to the unit multiplier, the government eliminates any unemployment as long as it is able to raise funds frictionlessly. In effect, fiscal stimulus is a free lunch in this case, and the government spends until there is no slack in labor markets. It is worth noting that the result holds even if there is no value from public spending (i.e., if government spending is wasteful). Because the reduction in the fraction of unemployed households reduce inequality and improve aggregate welfare, increasing spending until implementing full employment is optimal, even if v(g N ) = 0.
A natural question that follows is, how should the government adjust spending through the business cycle to ensure that the economy is at full employment. The next corollary shows that if tradable consumption comoves positively with the endowment of tradables (as would typically be the case in incomplete market models), the government follows a countercyclical fiscal policy.
Corollary 1 (Countercyclical Fiscal Policy). Under the assumptions of Proposition 1, given states {b, y T } and {b,ỹ T } such that c T (b, y T ) > c T (b,ỹ T ), it follows that g N (b,ỹ T ) > g N (b, y T ).
The intuition for this corollary is that a low tradable endowment generates a contraction in aggregate demand and requires a higher amount of spending to reduce the slack in the labor market.

Counterfactual Experiment
The previous section underscores the key trade-off the government faces in the model. Raising spending when there is slack in the labor market leads to an increase in output, whereas financing the spending with debt leaves the government more exposed to default risk. To shed light on how the government chooses the actual optimal level of spending, we conduct a perturbation exercise in which we allow the government to choose a level of spending that is different from the optimal one. The idea is to trace how output and sovereign spreads would differ if the government were to choose a different level of spending.
Let us describe the experiment in more detail. We study how a change in spending today, taking as given all future policies and value functions as defined in the Markov equilibrium, affects current allocations and prices. To balance the changes in spending, we assume the government adjusts the debt level and transfers to satisfy the budget constraint. Formally, in terms of the government problem (19), rather than maximizing with respect to the entire set of allocations, we fix an arbitrary level of government spending and solve optimally for the remaining allocations conditional on that level of spending. Our model simulations will be based on the optimal level of spending chosen by the government, but it is instructive to consider alternative values of spending to understand the optimal choice. 20 The results of this experiment are shown in Figure 3, using the parameter values of the calibrated economy that we will describe in Section 5. As initial values for the states, we assume that tradable endowment income is at its unconditional mean and current debt is 10% above its average (results are qualitatively similar for other states). In each panel, the solid dot indicates the level of the variable of interest at the optimal level of government spending, which, as panel (a) shows, achieves the maximum welfare (i.e., at the optimum, the utility value coincides with V (b, y T )). The blue lines trace the values of all variables if the government were to choose the alternative value of spending, which delivers strictly lower utility values.
As Figure 3 shows, an increase in government spending stimulates economic activity. The increase in spending raises the price of nontradables (panel b) and lowers unemployment (panel a). Essentially, the increase in demand for nontradable goods raises the relative price and leads firms to produce more in equilibrium. This is part of the standard channel from fiscal  Notes: In this figure, the blue lines indicate the current repayment levels in the default model of utility, unemployment, nontradable consumption, relative price of nontradables, spreads, and debt, as a function of current government spending, given that current tradable income is set to its unconditional mean and current debt is 10% above its average level. From next period on, allocations and value functions are given by the Markov equilibrium. Dots indicate the equilibrium levels associated with optimal government spending.
policy in open economies and is consistent with a large empirical literature (e.g. Monacelli and Perotti, 2010, Ilzetzki, Mendoza and Végh, 2013, Miyamoto, Nguyen and Sheremirov, 2019. 21 A more subtle effect that emerges here from the fact that wages are only downwardly rigid is the asymmetry and the state dependency of the expansionary effect on output, as will become more clear below (see Born, D'Ascanio, Müller and Pfeifer, 2019 for evidence on this asymmetry). One can also see that since nontradable consumption increases together with government consumption (panel c), the fiscal multiplier is larger than one. Relative to Proposition 1, the fiscal multiplier is bigger than one because spending is debt financed (panel h) rather than tax financed, in line with the results from Farhi and Werning (2017). Figure 3 is that the increase in government spending leads to an increase in spreads. Such increase reflects the higher risk of future default associated with higher debt levels. This increase in spreads is a key factor deterring the government from providing sufficient stimulus to attain full employment.

An important observation from panel (e) of
Overall, we have shown in this section how the presence of nominal rigidities and sovereign risk create an austerity-stimulus trade-off for the government. When there is slack in the labor market, spending helps to stimulate the economy. Investors, however, anticipate that the increase in spending and borrowing makes the government more prone to default. As a result, they are only willing to purchase government bonds at lower prices, and this makes stimulus less desirable. In the quantitative section that follows, we will show how the level of debt and income shocks are key to shaping the conduct of fiscal policy over the business cycle.

Calibration
To characterize the aggregate dynamics under the optimal fiscal policy, we calibrate the model to match key moments of the Spanish economy and use a year as the model period. We calibrate the model to Spain because, as mentioned in the introduction, the recent Eurozone crisis provides a prototypical example of the main mechanisms featured in our model: a sharp increase in unemployment and sovereign default risk, and a currency peg that leaves fiscal policy as the only instrument for macroeconomic stabilization. The model is solved numerically using value function iteration. For details on the solution method, see Appendix C.1.
Functional Forms. As mentioned in Section 3, we assume constant relative risk aversion utility functions for private and public consumption, a CES aggregator for tradable and nontradable goods, and an isoelastic production function. These functional forms imply four relatively standard parameters on preferences and technology {σ, ψ g , ξ, α}. For the cost of default, we assume the following functional form: with ψ y χ > 0, which has been used in related literature to match the bond spread dynamics observed in the data (see Bianchi, Hatchondo and Martinez, 2016;Chatterjee and Eyigungor, 2012, for related functional forms on default costs).
Parameter Values. All selected parameter values used in the baseline calibration are shown in Table 3. We choose a subset of parameters according to predetermined values and then choose the rest of the parameters to match key moments in the data. Data used for moments targeted in the calibration are detailed in Appendix C.2.
In the group of predetermined parameters, we set the coefficient of relative risk aversion to σ = 2 and the elasticity of substitution between tradable and nontradable goods to ξ = 0.5, which is in the range of values considered in the literature; 22 the share of tradables in the consumption aggregator to ω = 0.3, which implies a ratio of tradable output to total output of around 20%, in line with the data for Spain in the period of analysis; and the labor share from the nontradable sector to α = 0.75, following the estimate in Uribe (1997). For the unemployment insurance, we set the ratio of the consumption of unemployed households to that of employed households to κ = 0.7, which is in line with the average expenditure on nondurable goods and services during unemployment estimated by Chodorow-Reich and Karabarbounis (2016) for the United States. 23 Finally, we estimate the parameters ρ and σ for the stochastic process of y T t using Spanish national accounts data for agriculture and manufacturing sectors, log-quadratically detrended. This estimation yields ρ = 0.78 and σ y = 0.029.
For the parameters related to the debt market, we set the international risk-free rate r equal to 2%, which is roughly the average annual gross yield on German 5-year government bonds; the maturity parameter δ = 0.184, to generate an average bond duration of five years, in line with the OECD data for Spain over the period 2000-2010; 24 and the reentry probability θ = 0.18, to generate an average autarky spell of six years, which is close to the average resumption of financial access reported by Gelos, Sahay and Sandleris (2011) over the period 1980-2000 for 150 developing countries. 22 This parameterization implies that the intertemporal elasticity of substitution equals the intertemporal elasticity of substitution, and hence the marginal utility of tradables and nontradables is separable. Another useful implication is that the amount of public spending, according to the Samuelson rule, does not depend on debt nor on y T . 23 In Spain, the monthly benefit amount is 70% of the monthly base over the first six months and 50% thereafter until the unemployment spell reaches two years, as indicated by the Servicio Público de Empleo Estatal. 24 The Macaulay duration of a bond with price q and our coupon structure is given by The debt level in the model is computed as the present value of future payment obligations discounted at the risk-free rate r. Given our coupon structure, we thus have that the debt level is given by The six remaining parameters are calibrated to match six moments from the data. 25 Targeted moments are detailed in Table 3 and are informative of the default risk in the economy, unemployment, and government spending, which are the key components of the trade-off faced by fiscal policy. The first three moments speak to the amount of default risk in the economy. These moments are the average Spanish public external debt-to-GDP ratio of 22.8%, and the average and volatility of Spanish bond spreads of 1.05% and 1.4%, respectively. Although all parameters affect all moments in our calibration, these three moments are mostly governed by the discount factor β and the parameters on the default cost function ψ 0 χ and ψ y χ . The second group of moments is linked to government spending and taxes. We target the mean 25 The parameters and moments reported in this subsection correspond to those that result from calibrating the model with optimal fiscal policy with default risk. To compute the business cycle statistics, we run 10,000 Monte Carlo simulations of the model with 10,000 periods each and construct 1,000 subsamples of 32 periods of financial access. The number of periods for each subsample is chosen to roughly match the number of years in our sample period 1980-2012. To avoid dependence on initial conditions, we disregard the first 1,000 periods from each simulation. Also, in our model the borrower regains access to credit with no liabilities after defaulting, whereas in the data countries typically do so, carrying a positive amount of debt settled at a restructuring stage. We therefore impose that our candidate subsamples cannot be preceded by reentry episodes for less than four years. To analyze the economy with no default risk (in the next subsection) we re-calibrate the discount factor and the tax rate so that this economy is comparable with the data in terms of external debt and government spending. Also, given the high persistence in the debt dynamics, we run longer simulations for 140,000 periods. After disregarding the initial 100,000 periods, we construct 100,000 subsamples, allowing for 2, 000 periods between consecutive subsample time intervals.
Spanish government spending over GDP of 18%, and the ratio of the volatility of government spending to the volatility of output of 2. These moments are mostly influenced by the weight of the government good in the utility function, ψ g , and the income tax rate, τ . Finally, we calibrate w to be consistent with the surge in unemployment during the episode of high sovereign spreads. In the data, the increase in unemployment in Spain in 2011 relative to 2009-2010 was about 2.5%. Accordingly, we set w so that the average increase in unemployment in the two years before a default is 2.5%. This yields w = 3.068. Appendix Table 16 shows that our calibrated model approximates the targeted moments fairly well. 26

Fiscal Policies over the Business Cycle
In this section we study how default risk shapes optimal fiscal policy over the business cycle. To do so, we first consider an economy in which we shut down default risk, and then show how incorporating default risk changes the nature of the optimal fiscal policy response. We calibrate the two economies to match the same data targets, with the exception of spreads, whiich are, of course, zero for the risk-free economy. 27 Countercyclical fiscal policy with no default risk. Table 4 reports key business cycle moments of the economy with risk-free debt and compares them with their data counterparts. 28 The main result is that in the absence of default risk, optimal fiscal policy is countercyclical, with a correlation of −0.81 between government spending and GDP. This result stems from the countercyclicality of the benefits of fiscal stabilization stressed in Section 4. This model prediction is in sharp contrast to the procyclical behavior of government spending observed for Spain (0.46 in our sample) and, more generally, contrasts with the behavior we documented for economies with medium and high default risk. However, it is qualitatively consistent with the countercyclicality of economies with the highest credit ratings, as shown in Figure 2. Table  4 also shows that, thanks to the effective stabilization role of fiscal policy, the fluctuations of unemployment are small: one order of magnitude smaller that those observed in the data for Spain.
The key takeaway from these simulations is that when the government can finance spending with external risk-free borrowing, there are large gains from stabilization that lead to strong 26 An exception is the volatility of spreads, which the model falls short in replicating that observed in the data. As discussed in Aguiar, Chatterjee, Cole and Stangebye (2016), this is a common challenge faced by the canonical sovereign debt model. 27 Essentially, we choose the same parameter values as in our baseline economy (detailed in Table 3), except for the discount factor and utility of government spending, which we set to match the same average debt-to-GDP and government-spending-to-GDP ratios as in our baseline economy, and the parameters governing the default costs, which are set to large enough values to ensure that the economy never defaults for the targeted debt levels.
28 Time series for public and private consumption and GDP are log-quadratic detrended.
Notes: This table reports business cycle statistics for the data and the models with risk-free and risky debt. Bond spreads are computed as the differential between the annual sovereign bond return and the annual risk-free rate. The variables GDP and y denote total output at constant and current prices, respectively.
countercyclical fiscal policies. These policies are inconsistent with the data for Spain and for economies with sovereign risk, which tend to follow procyclical fiscal policies. We show next that default risk can provide an explanation for the observed empirical patterns.
Procyclical fiscal policy with default risk. The last column of Table 4 shows the business cycle statistics for our baseline economy with default risk. The main result is that government spending is procyclical, with a correlation of 0.72 with output. This table shows that the resulting fluctuations in unemployment are also more aligned with the data.
The sharp contrast between the conduct of fiscal policy in the risk-free economy and the economy with default risk can be clearly seen in Figure 4. This figure displays the optimal policy function for government spending for the two economies. As the figure shows, optimal government spending with risk-free debt, depicted by the solid red line, is monotonically decreasing with income. In contrast, optimal government spending with defaultable debt, depicted by the dashed blue line, features lower spending for small levels of income the To understand the optimal procyclicality in the economy with risky debt, Figure 5 shows two key objects we discuss in the context of the optimal policy tradeoffs in Section 4. Panel (a) shows the fiscal multiplier, defined as the increase in output from a marginal increase in government spending, as a function of tradable endowment. As the figure shows, the fiscal multiplier is positive when income is low and becomes zero once the economy is at full employment. Panel (b) shows the increase in spreads that result from the increase in external debt to finance one unit of government spending. A key property illustrated in the figure is that the marginal financial cost is larger when income is low. This property stems from the fact that periods with low income are periods in which incentives to default are higher (Arellano, 2008). Overall, this figure shows that although in bad times the fiscal multipliers are larger, the fact that the financial cost is also larger implies that the government chooses to cut spending and follow a procyclical fiscal policy.
It is important to highlight that departing from the optimal fiscal policy under default risk can entail large welfare costs. To show this, we replace the optimal countercyclical spending with a benchmark Samuelson rule that specifies a constant g N over the business cycle and evaluate the welfare costs from following this rule as opposed to the optimal one. Our results show that the average welfare cost is 3.5% of permanent consumption. 30 Moreover, the welfare costs are significantly larger for states with high debt and relatively low levels of income. This is because in these states the sovereign default risk of the economy is higher, and by following a constant spending rule the economy becomes over exposed to the risk of a default. Welfare costs are also larger for lower y T in low-debt states, where the government spends more than prescribed by the Samuelson rule so as to reduce unemployment and stabilize the economy. In contrast to Lucas (1977), macroeconomic stabilization entails significant welfare consequences.
Overall, the quantitative analysis of the model shows that default risk can account for the procyclicality observed in the data in economies with sovereign default risk. This is in spite of the fact that we constructed an economy with large fiscal multipliers that create an important scope for fiscal stabilization. 31

The Debt Dependence of Optimal Fiscal Policy
In this section we show that default risk considerations lead to an important state dependency in the optimal fiscal policy. In particular, the government's optimal response to shocks depends crucially on the country's level of debt. To illustrate this debt state dependence, we consider a one-standard-deviation drop in tradable endowment and simulate the model forward under the expected path of income, starting from two initial levels of debt, one that is 25% below the steady-state level ("low debt") and another that is 25% above the steady-state level ("high debt"). 32 Figure 6 shows the results of this exercise. The figure reports the differences in macroeconomic variables and spreads under the negative shock compared to the economy without the shock. The dotted black line corresponds to the economy that starts with low debt. In this case, the government chooses an expansionary path for government spending and borrowing (panels (b) and (c) respectively). Facing low default risk, the government resorts to a fiscal stimulus that virtually prevents any increase in unemployment (panel (f)).
In sharp contrast, the solid red line in Figure 6 shows that when initial debt levels are high, the government chooses to contract government spending and reduce debt levels. Because the negative shock triggers an increase in sovereign risk, the government finds it too costly to engage in an expansionary fiscal policy. The increase in spreads that would result from the increase in borrowing makes the stimulus too costly. This scenario is characterized by a large increase in unemployment (around 8 percentage points) resulting from the contraction in both public and private consumption.
The state dependency of the optimal fiscal policy predicted by the model is consistent with important empirical observations. As shown by Romer and Romer (2019) countries use fiscal policy tools more aggressively during recessions when these episodes are preceded by relatively low debt-to-GDP ratios. By the same token, countries that have higher "fiscal space"are able to better mitigate the effects of recessionary shocks. Interestingly, the model is also consistent with the dynamics of government spending for Spain in recent years. When the Great Recession hit, government debt did not exceed 20% of GDP. In line with our model, the Spanish government responded by a fairly aggressive fiscal stimulus. At that time, borrowing costs remained quite modest and government spending kept rising (see Figure 1). In 2011-2012, there was a new slump in economic activity, but the situation was quite different. Facing mounting spreads, the Spanish government decided to cut spending following the austerity  Figure 6: Impulse Responses to y T for Different Initial Debt Levels.
Notes: This figure shows the responses of tradable endowment, unemployment, government spending, debt, spreads, and tradable consumption when y T drops one standard deviation from its unconditional mean in period 1. The vertical axis units are deviations from the unshocked path. Solid red lines correspond to initial debt set to 75% of the steady-state level; dashed blue lines correspond to initial debt equal the to steady-state level. The vertical axis units are median deviations from the unshocked paths. prescription of our model. 33 33 The optimal policy from the model as well as the implications for output are also broadly consistent with the behavior of Greece, which first contracted spending significantly around 2010, and then ultimately entered into default. In line with these results, Gourinchas et al. (2017) find that the Greek crisis was particularly severe because of the high level of debt that generated a contraction in government spending.

Fiscal Programs
In this section, we explore the effects of alternative fiscal programs imposed by a third party. Our analysis is motivated by the fact that many governments are often asked to engage in austerity programs, sometimes in exchange for some financial assistance. 34 We examine spending cuts imposed today and in the future, and argue that they can have very different implications.

Current spending cuts
The first counterfactual experiment we consider is a simple cut in current government spending imposed by a third party. If the government wishes to remain in good credit standing, it has to follow an exogenously imposed amount of spending. The government can still choose to default, in which case it can freely choose the amount of transfers and spending. We assume that the intervention lasts for only one period. In the following period, the equilibrium reverts to the Markov equilibrium, in which the government optimally chooses all policies.
Our main result regarding this experiment is that imposing current spending at least weakly deteriorates the incentives to repay. Proposition 2 formalizes this result.

Proposition 2.
Consider an initial level of debt b and a shock y T . If the government finds it optimal to default under no fiscal program, it also finds it optimal to default when there is an imposed cut on current government spending. Moreover, there exists a spending cut such that the government defaults with an imposed spending cut but not without it.
The proof of this proposition follows from the fact that restricting current government choices in good credit standing reduces the value of repaying for the government and therefore makes default more attractive. An important implication is that imposing a spending cut can trigger a default, even under circumstances in which the government would find it optimal to repay absent any constraints.
When is forced austerity more likely to backfire? To address this question, we examine the spending cut that would push the government to default. Specifically, we compute what would be the amount of current government spending as a fraction of the Samuelson level that would make the government indifferent between repaying and defaulting. The left panel of Figure 7 shows that when income is low, a low level of austerity is sufficient to precipitate default. For high income, the government does not find default very attractive, and would therefore choose to remain in good credit standing even with substantial cuts imposed on spending. Similarly, as shown in the right panel, the lower the current debt, the less sensitive the repayment decision is to imposed spending cuts.
These findings shed light on the design of fiscal rules we will be exploring in the next section. If the government is close to default, imposing austerity (beyond the optimal amount chosen by the government) can be harmful. Importantly, both the government and investors are ultimatlely worse off. On the other hand, if the government is relatively further away from defaulting, even a moderate spending cut would not trigger default. Moreover, the spending cut reduces debt accumulation and future incentives to default. In this case, investors who hold government bonds would benefit ex post as the market value of the outstanding government debt rises. Notes: This figure shows the percentage difference relative to the Samuelson level of current public spending that would make the government indifferent between repaying its debt and defaulting, as a function of current y T , given current debt equal to the average level (left panel), and as a function of debt, given y T set to its unconditional mean (right panel). From next period on, allocations are assumed to take the equilibrium levels.

Fiscal Forward Guidance
We now investigate an alternative form of fiscal consolidation based on future spending cuts. We refer to this policy as "fiscal forward guidance." Two questions we address. First, can spending cuts imposed in the future improve welfare? And second, how should the spending cuts be designed?
The experiment we consider imposes cuts on next-period government spending (g N t+1 ). In period t, the government continues to choose all available policies, while in the next period, the government chooses borrowing and repayment subject to the restriction that the spending cut is implemented. We also assume that lump-sum transfers remain fixed at their optimal levels and that in the period after the consolidation (t+2), the economy reverts to the Markov equilibrium.
We consider two forms of fiscal forward guidance depending on whether future cuts are predetermined or allowed to be contingent on the state of nature tomorrow. Different from the current spending cuts analyzed above, we will show that a reduction in next-period spending can generate positive effects on the economy. Less spending in the future implies less debt accumulation, which reduces incentives to default in the future and allows the government to borrow more cheaply today-and, in turn, render stimulus less costly.
The non-state-contingent austerity program specifies a fixed percentage cut in spending relative to the optimal level, regardless of the state of nature tomorrow. On the other hand, the state-contingent austerity program allows for the possibility that spending cuts are contingent on the level of economic activity. In particular, we consider a spending cut that is active only when total income y, given by y T + p N y N , is within a subset of future income values. Both the size of the constant spending cut within the subset and the subset itself are selected to maximize welfare.
The advantage of the state-contingent austerity program that spending cuts can be targeted to the "right" state tomorrow. As it turns out, we find that it is optimal to promise a spending cut only for intermediate values of next-period income (see Appendix Figure 11). If income is sufficiently low, a spending cut can push the government to default tomorrow (for the reasons explained above), which would increase rather than decrease sovereign spreads today. It is also not optimal to promise a spending cut if income is excessively high tomorrow. The reason is that when income is very high, the interest rate at which the government borrows is closer to the risk-free rate and becomes fairly insensitive to lower debt accumulation. As a result, promising a cut in these states will generate a distortion in the allocation of resources across private and public consumption, with modest gains in terms of lower spreads today.
For each case, we look for the optimal spending cut given the initial conditions considered. We focus on an initial value of debt of 20% above the mean and an income equal to its unconditional mean. 35 For the non-state-contingent case, the optimal cut is 3%. For the state-contingent cut, the optimal cut reaches 4%. Under a state-contingent cut, the promised cut is larger because it is implemented only in states in which it is beneficial. Moreover, in line with the mechanisms highlighted above, the income states in which it is optimal to promise the spending cut are between 22% below the unconditional mean of output and 3% above the unconditional mean of total income. Figure 8 shows the welfare gains of implementing these austerity programs for a range of spending cuts. (For the state-contingent cut, we keep the interval for total income at [−0.22%, 0.03%] from its mean level.) Welfare gains are measured as the percentage increase in current private consumption that households are willing to give up to implement the austerity 35 Appendix Figure 10 shows how welfare gains vary with the current state for non-state-contingent cuts. Notes: This figure shows the welfare gains for non-state-contingent (dashed blue line) and state-contingent (solid red line) spending cuts next period, as a function of the size of the spending cut. State-contingent spending cuts are implemented if total income y ≡ y T + p N y N lies within the range [y, y], where y and y are set to 22% below and 3% above average total income, respectively. Welfare gains are expressed as (percentage) increases in current total consumption under the optimal policy regime to be indifferent to the corresponding austerity measure. The current state features debt equal to 20% above its mean and tradable income given by its unconditional mean.
program. The dashed blue line shows the welfare gain from non-state-contingent cuts, and the solid red line shows the gain for state-contingent cuts. The maximum welfare gains are, respectively, 0.075% and 0.088% for the non-state-contingent and state-contingent programs. Notice that although both programs require commitment to execute the spending cut, these results show that even a 1-year-ahead commitment can be very effective in providing more scope for stimulus. To the extent that fiscal budgets, once approved, are difficult to change, this assumption does not seem very strong.
To shed light on the sources of these welfare gains, in Table 5 we show the impact of these future austerity programs on today's key macro variables. The table shows that the nonstate-contingent spending cut allows the government to borrow more cheaply and facilitates stimulus, which in turn helps to reduce unemployment. In particular, spreads drop by 0.1% despite the increase in borrowing, and unemployment is reduced by almost 0.3 percentage points relative to the no-austerity plan. Notably, relative to the baseline economy, the risk of observing a default in the next period actually rises by 0.1% with the austerity program, but then it drops 1.41% in the following period. Under a state-contingent austerity plan, the government engages in even more stimulus, further reducing unemployment and achieving higher welfare gains.
To sum up, we find that in the midst of a recession with high sovereign default risk, there is a significant role for an austerity program that involves future spending cuts. An important qualification is that the program cannot be too aggressive, as it risks increasing Notes: Initial response of key variables and welfare gains for different austerity measures. These measures are a promised spending cut next period in all states (column 1) and a current spending cut (column 2), both of 3%. Column 3 corresponds to a promised spending cut of 4% next period only if total income y ≡ y T + p N y N lies within the range [y, y], where y and y are set to 22% below and 3% above average total income, respectively. Welfare gains are expressed as the (percentage) increases in current total consumption that would leave households indifferent between remaining under the baseline policy and switching to the alternative. Variations in p N , debt, c T , and g N are reported as percentages relative to optimal baseline levels without any austerity measure. The current state features debt equal to 20% above its mean and tradable income y T given by its unconditional mean.
default incentives and worsening borrowing conditions today. Hence the program needs to be carefully designed, given the projections of expected economic activity. In particular, the more protracted the recession, the more delayed the spending cuts should be. Moreover, the desirability of fiscal forward guidance can vary with the initial conditions. The general lesson is that the more sensitive the borrowing costs are, the higher the potential benefits from fiscal forward guidance.

Conclusion
We examine how sovereign risk matters for the conduct of fiscal policy. Empirically, we show that high sovereign risk is associated with more procyclical fiscal policies. We develop a theoretical framework that integrates Keynesian features and sovereign risk concerns that are consistent with this pattern. Consistent with the findings of Romer and Romer (2019), we also show that an economy with low government debt, is less likely to experience severe recessions.
On the normative front, we offer a framework that articulates the fundamental conundrum faced by fiscal policy in a severe downturn: Should a government increase spending to ease the recession at the expense of higher spreads, or should it cut spending to reduce exposure to a debt crisis, even if that deepens the recession? Our quantitative findings show that for relatively high levels of debt, austerity tends to be optimal, even in the presence of large fiscal multipliers. At the same time, our framework also shows how imposed austerity programs can backfire by increasing a country's incentives to default. We instead argue that programs of fiscal forward guidance-an alternative that combines current stimulus with future fiscal austerity-can be desirable during recessions.  Table 6 with credit ratings data available during the period 1990-2016, and used in the regression of Section 2. The variables σ G /σ Y , corr(G t , G t−1 ), and corr(G, Y ) denote, respectively, the ratio of the standard deviation of government spending to the standard deviation output, the first-order autocorrelation of government spending, and the correlation between government spending and output. We compute moments using the cyclical component of per capita variables in constant local currency, detrending variables with the HP filter and a smoothing parameter of 100. For details on the data, see Section 2.  Notes: This table shows the correlation between government spending and output for countries in our sample with "medium risk," defined as those that ever had a sovereign credit rating below A but always had a credit rating greater than or equal to B. We compute moments using the cyclical component of per capita variables in constant local currency, detrending variables with the HP filter and a smoothing parameter of 100. For details on the data, see Section 2.
where fiscal procyclicality i is the correlation between government spending and output from country i, Income i is a measure of country's i income per capita, and ε i is a random error term. Standard errors are shown in parentheses. Column (1) (1) shows results from estimating the model fiscal procyclicality i = α + γ X i + ε i , where fiscal procyclicality i is the correlation between government spending and output from country i, and X i contains the following variables: rule of law, measured by the average ranking from the WDI for the period 1990-2016; education inequality, measured by the standard deviation of the percentage of population enrolled by school level (data source: Barro and Lee, 1996); fiscal rule measured by the number of years with a fiscal rule (source: IMF); fuel production and trade openness, measured as a percentage of GDP, averaged over the period of analysis (source: WDI), and output volatility, measured as the standard deviation of GDP for the period 1990-2016 (source: WDI). Column (2) shows the coefficients of the same variables estimated but in an empirical model that also includes the sovereign risk variables, that is, fiscal procyclicality i = α + β medium medium risk i + β high high risk i + γ X i + ε i . For details on the data, see Section 2.
where fiscal procyclicality i is the correlation between government spending and output from country i, default i is a dummy variable that takes the value of 1 if country i ever defaulted during the period 1990-2014 (data source: Uribe and Schmitt-Grohé, 2017), X i is a vector of country-level controls, and ε i is a random error term. Standard errors are shown in parentheses. Column (1) estimates the empirical model without controls. Column (2) includes as controls the log of the average GDP per capita in PPP. Column (3) includes as controls dummies measuring whether the country is rich or emerging, using the thresholds defined in Uribe and Schmitt-Grohé (2017). Column (4) includes the following additional controls in the vector X i : rule of law, measured by the average ranking from the WDI for the period 1990-2016; education inequality, measured by the standard deviation of the percentage of population enrolled by school level, (data source: Barro and Lee, 1996); fiscal rule measured by the number of years with a fiscal rule (source: IMF); average fuel production and average trade openness as a percentage of GDP (source: WDI), and output volatility, measured as the standard deviation of output for the period 1990-2016 (source: WDI). For details on the data, see Section 2. where fiscal procyclicality i is the correlation between government spending and output from country i, default i denotes the number of default episodes experienced by country i during the period 1990-2014 (data source Uribe and Schmitt-Grohé, 2017), X i is a vector of country-level controls, and ε i is a random error term. Standard errors are shown in parentheses. Column (1) estimates the empirical model without controls.
Column (2) includes as controls the log of the average GDP per capita in PPP. Column (3) includes as controls dummies measuring whether the country is rich or emerging, using the thresholds defined in Uribe and Schmitt-Grohé (2017). Column (4) includes the following additional controls in the vector X i : rule of law, measured by the average ranking from the WDI for the period 1990-2016; education inequality, measured by the standard deviation of the percentage of population enrolled by school level (Barro and Lee, 1996, data source:[); fiscal rule, measured by the number of years with a fiscal rule (source: IMF); average fuel production and average trade openness as a percentage of GDP (source: WDI), and output volatility, measured as the standard Deviation of output for the period 1990-2016 (source: WDI). For details on the data, see Section 2.   Note: This figure shows the welfare gains from promising non-state-contingent spending cuts next period of 3%, as a function of tradable income y T (left panel) and as function of debt (right panel). Debt is set to 20% above its average on the left panel and y T is equal to its unconditional mean on the right panel.
Welfare gains are expressed as (percentage) increases in current total consumption under the optimal policy regime to be indifferent with the promised spending cut. % Note: This figure shows the welfare gains from promising spending cuts of 4% for next period whenever total income y ≡ y T + p N y N lies within the range [y, y]. The left panel plots the welfare gains as function of y with y set to 3% above the average total income. The right panel plots the welfare gains as function of y with y set to 22% below the average total income. Welfare gains are expressed as (percentage) increases in current total consumption under the optimal policy regime to be indifferent with the promised spending cut. The current state features debt equal to 20% above its mean and tradable income y T given by its unconditional mean.

Proof of Proposition 2
Proof. Denote by V R,Austerity (y T , b;ḡ N ) the value of repayment under a fiscal program program that imposesḡ N . By definition, we have V R,Austerity (y T , b; 0) = V R (y T , b). Consider (b, y T ) such that the government finds optimal to default under no fiscal program. We have V R (y T , b) < V D (y T ). We have subject to Comparing (26) with (19) in the main text, it follows that V R,Austerity (y T , b;ḡ N ) ≤ V R (y T , b). Since the value of default under the spending cut is unaffected, we can use that V R (y T , b) < V D (y T ), to show that V R,Austerity (y T , b;ḡ N ) < V D (y T ), which completes the first part of the proof. Now consider (b, y T ) such that the government repays under no fiscal program. We have that V R (y T , b) > V D (y T ). Consider a spending cut such thatḡ N is arbitrarily close to zero. Using the Inada condition for the utility of public spending, we have that limḡN →0 V R,Austerity (y T , b;ḡ N ) = −∞. By continuity, it follows that there existsḡ N > 0 such that V R (y T , b) > V D (y T ) > V R,Austerity (y T , b;ḡ N ), completing the proof.

58
C Quantitative Analysis

C.1 Solution Method
Model solution. The model is solved numerically using value function iteration with interpolation. Linear interpolation is used for the endowment and cubic spline interpolation for debt levels. We consider an equidistant grid for tradable endowment of 21 points between 3 standard deviations below and above the unconditional mean. We use 61 gridpoints for debt for the baseline model and 101 for the risk-free debt economy. To compute expectations for continuation values and prices, we use 15 and 11 quadrature points for the endowment realizations, respectively. For each state, conditional on an arbitrary choice of debt, we employ a variant of Brent's method algorithm included in the IMSL library to find the roots of the implementability conditions in the government's problem. To maximize over debt, we then use the UVMIF routine that relies on a quadratic interpolation method. We solve for the optimality conditions under four alternative regimes: with and without a binding wage rigidity constraint, and with and without zero lump-sum government transfers. We then compute welfare under the four regimes. Our solution is given by the allocations that deliver the highest utility.
Welfare gains. For the conditional welfare gains in Subsection 5.2, even though the households' preferences are homothetic, the presence of additive default costs prevents us from applying the standard formula for welfare gains. For that reason, we turn to value function iteration and proceed as follows. We are interested in welfare gains expressed as a permanent increase in private and public consumption that would leave the household indifferent between living in the economy with a Samuelson rule and switching to the economy with the optimal policy. For a given initial state and an arbitrary value for the welfare gain, we iterate on the value functions for the Samuelson rule, keeping policy functions and default strategies fixed. Upon convergence, we calculate the sup norm to the difference between the newly computed Samuelson value function and the value function under the optimal policy evaluated at the selected initial state. If the norm is lower than 1e −5 in absolute value, we stop and report the welfare gain. If instead it is positive and larger than 1e −5 , we reduce the value of the welfare gain and iterate again on the value function. Otherwise, we increase the welfare gain and iterate again. We repeat this procedure for all the initial states of interest. For unconditional welfare gains, we proceed in a similar fashion integrating over all states by using an asymptotic distribution of (y T , b) and ζ, constructed by taking the associated state from the 10, 000th period in each of 10, 000 simulations.

C.2 Data Used in the Calibration
The following data were used in the model's calibration for Spain: