Optimal Monetary and Macroprudential Policies for Financial Stability in a Commodity-Exporting Economy

We develop a model to analyze the optimal combination of macroprudential and monetary policies in a small open commodity-exporting economy. Unlike a closed economy, where monetary and macroprudential policies tend to be substitutes, in a small open economy the optimal policy mix depends on the specifics of shocks and economic structure. Monetary and macroprudential policies tend to be complements when the degree of pass-through of credit spreads into marginal costs and prices is sufficiently high, or when a credit boom is caused by a commodity boom, a fraction of consumers lacks access to financial markets, and the government follows a fiscal policy rule. The two policies are substitutes when the complementarity between domestic and imported production inputs is sufficiently high.


Introduction
The question of how a benevolent policymaker should respond to business-cycle fluctuations is one of the most fundamental in macroeconomics. This paper studies macroeconomic stabilization policies in a small open economy, such as Russia, where commodities, such as oil, metals, or wheat, compose a significant part of exports. World prices of primary commodities are determined in international markets. Therefore, commodity export prices are perceived as exogenous by a small open commodity-exporting economy.
Furthermore, world prices are difficult to predict. A rise in exogenous world commodity export prices can suppress a country's risk premium and lead to a credit boom, as documented in Shousha (2016). Empirical evidence in Gourinchas and Obstfeld (2012) and Schularick and Taylor (2012) suggests that credit booms are good predictors of financial crises. Nevertheless, private agents in a commodity-exporting economy may be myopic and assign a zero probability to a systemic financial crisis in the aftermath of a credit boom. A benevolent policymaker, however, may be more foresighted and correctly estimate the probability of a crisis. This paper studies possible reactions of monetary and macroprudential policies in response to a temporary commodity export price shock that, by igniting a credit boom, can lead to a systemic crisis. We also take for granted that a commodity-exporting economy has an established fiscal policy rule, which is a common practice among commodity exporters.
To model an oil-exporting economy, we use a simple three-period New Keynesian general equilibrium model of a small open economy (SOE) based on Lorenzoni (2014). In the first period, the economy rests in the initial steady state. A representative private agent maximizes a utility function that depends on private consumption and labor. Production of domestic differentiated nontradable consumption goods requires private agent's labor and an imported homogeneous intermediate input. For simplicity, oil-export revenue is given as an exogenous flow of income expressed in foreign currency that requires no labor input. The small open economy trades with the rest of the world in risk-free one-period discount bond denominated in foreign currency. Fiscal authorities are also endowed with non-zero international bond holdings, i.e. a "sovereign wealth fund." There is no uncer-tainty in the steady state.
In the second period, the economy is hit by an unanticipated shock. We consider two sources of shocks: an exogenous world oil price shock and a credit growth shock. The first disturbance is a shock in oil-export revenue that is modeled as a one-time change in the exogenous flow of income denominated in foreign currency. This change is unexpected both for private agents and for policy authorities. We assume that a fraction of domestic differentiated goods producers cannot change their optimal prices. Price stickiness is required for modeling the effects of monetary policy, which is given as a short-term (oneperiod) interest rate set by monetary authorities. Fiscal policy authorities conduct their policy according to an established rule by taxing private agents' oil income. To model nontrivial effects of fiscal policy, two types of consumers are introduced. A fraction of consumers are Ricardian with access to financial markets. Others are non-Ricardian: They can neither borrow nor save and act as "hand-to-mouth" workers.
Aside from monetary and fiscal policies, the third instrument is macroprudential policy. To explain nontrivial effects of macroprudential policy, we introduce a credit spread, as in Cúrdia and Woodford (2016), on the aggregate demand side (Euler's equation) and on the aggregate supply side (the New Keynesian Phillips curve). To simplify analysis, the whole credit block is modeled outside of the general equilibrium model in an ad hoc fashion. The credit spread is not microfounded but, rather, is calibrated based on empirical evidence, as in Ajello et al. (2019) or Aikman et al. (2018). The spread is assumed to be a function of a parameter that characterizes the stance of macroprudential policy. The parameter is labeled the Countercyclical Capital Buffer (CCyB) for concreteness. One important empirical regularitiy of commodity-exporting economies is a positive correlation between commodity export prices and domestic credit growth. Therefore, "credit" growth in the credit block of the model is an empirically estimated function of a short-term interest rate, credit spread, and oil-export revenue.
The second type of shocks that we consider besides oil-export revenue is a shock to credit growth, which is a disturbance term in the credit growth equation. Furthermore, credit growth and bank capital affect the probability of a "financial crisis" in the third period. A "crisis" in the model is a persistent exogenous fall in labor productivity and/or an exogenous fall in oil-export revenue. In this way the credit block, which is left outside of general equilibrium, is still connected to the main part of the general equilibrium model. As already mentioned, an important assumption that we make is that private agents are myopic: They always assign zero probability to a crisis in the third period.
On the contrary, policy authorities correctly anticipate the possibility of a crisis. Policy authorities conduct macroprudential policy by setting the CCyB parameter, which influences contemporaneous credit growth and thus affects the likelihood of a crisis.
In the third period, all prices become flexible, financial frictions evaporate, and the economy reaches a new steady state, either with a crisis or without it. The model is calibrated and solved by log-linearizing equilibrium conditions in the neighborhood of the initial first-period steady state. In the study, we find combinations of the policy rate and the CCyB parameter in response to a shock in the second period that minimize the loss function of the policymaker under alternative fiscal policy scenarios. The policy loss function depends on the variance of output and inflation, with a special weight on crisis prevention, as in Aikman et al. (2018).
Challenges in modeling macroprudential policy are well known. There is no canonical framework yet, i.e. a micro-founded DSGE model that would feature financial crises as endogenous events. The early generation of models such as Gerali et al. (2010) and Angelini et al. (2014) treat financial intermediation as a safe activity of channelling funds from savers to borrowers with no risks of bank runs and/or insolvency involved. As a consequence, bankruptcies of individual institutions or systemic crises are missing from those models. Cúrdia and Woodford (2016) develop a version of the New Keynesian model with heterogeneous consumers, some of them being more patient than others.
The intermediation of savings from the patient to the impatient requires some physical cost. Furthermore, a fraction of loans known in advance gets sour. Banks do not fail in this model since they make up for the anticipated loan losses by the credit spread, the difference between the interest rate on loans and deposits. Woodford (2012) employs a version of this model to analyse the role of monetary policy in achieving financial stability. The credit spread is set to take on two values, low in normal times and high in crisis times. The probability of a crisis depends on the credit growth that does not appear explicitly in the two-equation New Keynesian model for a closed economy but, rather, is postulated to depend positively on the level of economic activity. A high realization of the credit spread is a metaphor for disrupted financial intermediation during a financial crisis. Gertler and Kiyotaki (2015) develop a dynamic general equilibrium model where bank runs occur with a (postulated) probability that depends on the state of the economy and the capital ratio of banks.
In this paper we take a minimalist approach developed by Ajello et al. (2019) and Aikman et al. (2018). Ajello et al. (2019) construct a two-period closed economy New Keynesian model in which the economy can experience a crisis in the second period depending on credit conditions in the first. The model consists of an IS (Euler) equation and a New Keynesian Phillips curve. There are two possible states on date 2: normal or crisis. The probability of a crisis is a logistic function of lending growth, which, in turn, depends on the interest rate, output gap, and inflation. Lending growth and the probability of a crisis are modeled outside of general equilibrium as empirically estimated functions. Schularick and Taylor (2012) and Gourinchas and Obstfeld (2012) show empirically that, retrospectively, credit growth is a good predictor of financial crises. The policy maker chooses the interest rate policy by optimizing a loss function that depends on output gap and inflation. The authors find that the optimal response of the short-term interest rate to credit conditions is very small. They also consider policy under parameter uncertainty. Bayesian and robust policy makers will respond more aggressively when the probability and severity of a crisis are uncertain.
Unlike Ajello et al. (2019), who only consider short-term interest rate policy, Aikman et al. (2018) study the interaction between monetary and macroprudential policies.
They also construct a two-period closed economy New Keynesian model consisting of an IS (Euler) equation, a New Keynesian Phillips curve, a lending growth equation, and a probability of a crisis equation. Their loss function includes a special weight on crisis prevention. Macroprudential policy is modeled as a countercyclical capital buffer (CCyB)-a variable that affects a credit spread. The spread, in turn, affects credit growth. The authors show that using the CCyB improves outcomes compared to using the short-term interest rate alone with the two instruments typically being substitutes.
Our paper is motivated by empirical evidence on the link between commodity and financial cycles. Shousha (2016) estimates a panel VAR and an open-economy multi-sector DSGE model with financial frictions on a number of emerging and advanced commodity exporters. Commodity price shocks turn out to be an important source of business cycle fluctuations in commodity-exporting countries, especially in emerging markets. The structural model also allows the author to conduct counterfactual exercises. He finds that the main sources accounting for heterogeneous responses of emerging and advanced economies to commodity price shocks are the different responses of country interest rates and the differences in firms' working capital constraints. In our paper, we use the empirical result that a surge in commodity prices suppresses the risk premium on the debt of commodity exporters and attracts capital inflows to those countries. We use it to motivate our model in which a commodity boom gives rise to a credit boom that potentially leads to a financial crisis. For further empirical evidence, see, for example, Drechsel and Tenreyro (2018). This paper continues the tradition of studying optimal stabilization policies in commodity-exporting economies. However, existing studies typically consider either one or two policies among possible combinations of fiscal, monetary, and macroprudential policies. Medina and Soto (2016) Bergholt (2014) stresses the importance of non-oil firms, some of which are linked to the oil sector via supply chains, in comparing welfare implications of alternative policy rules. Ferrero and Seneca (2019) stress the tradeoff between lowering the policy rate in order to close a negative output gap following a drop in oil prices for an oil exporter on one hand and raising the rate in order to fight inflationary pressures caused by an exchange rate depreciation. Hamann et al. (2016) estimate a model for Colombia and stress the same tradeoff; however, they also model the oil sector as an optimal extraction problem and show that macroeconomic effects depend on the degree of persistence of oil-price shocks. Drygalla (2017)  union in order to study the performance of various CCyB rules and find that a rule targeting housing prices improves welfare compared to the rule based on the credit gap. Menna and Tobal (2018) extend the closed economy New Keynesian model with a credit block similar to Cúrdia and Woodford (2016) to an open economy setting in order to study the applicability of the "lean against the wind" policy-a policy of raising the interest rate to curb the buildup of systemic risk-in emerging market economies; they find that a strong dependence of domestic financial conditions on capital flows reduces the effectiveness of monetary policy.
Among papers that stress mostly empirics, Drechsel and Tenreyro (2018)  The contribution of this paper relative to previous studies is a simultaneous modeling of monetary and macroprudential policies in a small open economy in response to two types of shocks taking a fiscal policy rule for granted. The first type of shocks is a shock to the credit growth ("credit boom") independent of an oil-price shock. The second is an oil-price shock that also triggers a credit boom. Our results show that whether monetary and macroprudential policies are complements or substitutes depends on the nature of the shock and on particularities of the economic structure. This finding contrasts with the closed economy case studied in Aikman et al. (2018) where the two policies tend to be substitutes, i.e. macroprudential tightening should be accompanied by monetary easing in a closed economy.
We find that whether monetary and macroprudential policies are substitutes or complements depends on a few key parameters. The two policies are complements when the degree of pass-through of credit spreads into marginal costs and prices is sufficiently high. This is opposite to the closed economy case, where monetary and macroprudential policies are always substitutes, i.e. a tighter stance of one policy requires a looser stance of the other. If credit growth is induced by a commodity boom, and some workers are hand-to-mouth with no access to financial markets, then monetary policy tends to be complementary to macroprudential policy. Monetary policy takes on an additional task of correcting intertemporal resource allocation distorted by sticky prices that is only imperfectly fixed by the structural balance fiscal rule. Finally, a higher degree of complementarity between domestic and imported production inputs makes macroprudential and monetary policies substitutes.
The rest of the paper is organized as follows. Section 2 describes the model; Section 3 reports and discusses our findings; Section 4 concludes. Appendix A contains a complete list of equations of the log-linearized model of Section 2.

Model
We consider a small open, effectively three-period economy similar to Lorenzoni (2014).
The economy exports a commodity that will be referred to as oil. The oil export revenue is modeled as an exogenous flow of income denominated in the foreign currency, dollars.
The time horizon is infinite. Initially, on date 0, the economy rests in a deterministic steady state with flexible prices and no financial frictions. There is no uncertainty except for one of the two unanticipated shocks (ex ante zero-probability shocks, a.k.a. "MIT shocks") on date 1 and another shock (with positive probability) on date 2. We consider two different shocks that might hit the economy on date 1. Both shocks are correctly perceived as transitory by private agents and by the government. The first one is an unanticipated shock to the commodity export revenue. The second disturbance is a shock to the growth of credit in the economy. On date 1, the economy features nominal  Shousha (2016) or Drechsel and Tenreyro (2018), we also allow the credit growth on date 1 to be positively associated with the oil revenue shock on date 1.
Similarly to Ajello et al. (2019) and Aikman et al. (2018), we assume that private agents mistakenly assign zero probability to the crisis state on date 2. In the normal state on date 2, the economy produces the potential level of output. In the crisis state, the output drops below its potential level and remains there forever. This modelling shortcut is meant to capture the idea that output is depressed due to disrupted financial intermediation. The post-crisis permanent drop in output should be understood in present value terms. The present value of the permanent cut in potential output in the crisis state is equal to the present value of actual output loss due to a recession triggered by the financial crisis.
In the remaining sections, we build our theoretical framework in two steps. We con-sider a small open economy version of Ajello et al. (2019) and Aikman et al. (2018) models. To develop some intuition, we first consider a special case of the small open economy model with exogenously imposed financial frictions but without a fiscal sector.
Then we add a fiscal policy to the model assuming that the government (i) receives a constant share of export revenue in taxes; (ii) has access to international capital markets where it can save or borrow; and (iii) follows a fiscal rule by spending an equivalent of its "permanent income" in the textbook theory of consumption, i.e. what Medina and Soto (2016) label as running a structural balance fiscal rule. Although government consumption does not directly affect the well-being of households in the model, the rationale for the fiscal rule is the presence of the so-called "hand-to-mouth" or non-Ricardian workers who do not have access to either internal or external financial markets. For each type of date 1 disturbance, we find optimal monetary and macroprudential policy responses and compare them with a similarly parameterized closed economy.

Small open economy with the representative household and without a fiscal sector
Time is discrete. The representative household is endowed with an exogenous flow of the internationally traded good X t , which we label "export revenue" or "oil revenue." Changes in oil-export revenues are modeled as variations in X t . Along with trade in goods, there is trade in the riskless international bond denominated in dollars between the small open economy and the rest of the world. Whereas oil revenue is exogenous, differentiated varieties of the domestic non-traded good are produced by a unit mass of monopolistically competitive firms using the imported intermediate good and the household's labor as inputs according to the Cobb-Douglas production function: where Y t (j) is the amount of a differentiated variety of the final good produced by firm j, and N t (j) and M t (j) are, respectively, the amount of labor and the amount of the traded intermediate input (i.e. materials) involved in the production of Y t (j). Different varieties of the final good are subsequently repacked into a homogeneous final composite good by perfectly competitive retailers according to the constant elasticity of substitution (CES) technology: where Y t is the quantity of the final composite good produced from differentiated varieties Y t (j). The zero profit condition for retailers requires the relationship between the price of the final composite good and prices of its differentiated components to be where P t (j) is the price of differentiated variety j.
A representative household's preferences are given by: where C t is the consumption of the final composite good, and N t is hours worked.
Representative household's one-period budget constraint is where E t is the nominal exchange rate, W t is nominal wage, D t is nominal profits of monopolistically competitive firms, B t is the amount of the international one-period discount bond held at the end of date t maturing on date t + 1, β is its exogenous market price, which coincides with the subjective time discount factor of households, and M t is the total amount of imported intermediate input, defined as Given that the final composite good is not traded internationally and must be therefore entirely consumed domestically, i.e.
representative household's one-period budget constraint yields the standard balance of payments relationship: The balance of payments relationship acknowledges that total income is split into wages and profits of monopolistic competitors: Optimality conditions are as follows. The Euler equation, which characterizes the optimal choice of the intertemporal consumption profile, is: The superscript ps on the conditional expectation operator indicates that expectations of the private sector may deviate from fully rational. The specific assumption is that private agents have rational expectations in all periods except for t = 1. In period t = 1, however, they assign a zero probability to the occurrence of a financial crisis on date t = 2. For example, for output Y t and for any variable x t : The uncovered interest parity, which, in this context, is equivalent to the no-arbitrage condition for foreign and domestic bonds, is: The labor supply relationship, which characterizes optimal intratemporal choice between consumption and leisure, takes the form: Note that equations (9) and (10) do not involve the conditional expectation operator.
This is due to our assumption that all date 1 shocks are unanticipated and have zero probability ("MIT shocks") and that, beyond date 1, no other shocks are rationally anticipated by private agents.
In what follows we analyze the following generic scenario. β to vary across two groups of households, making one of them relatively patient and hence willing to save in equilibrium, and the other relatively impatient and hence willing to borrow. The type of each household is subject to occasional random switches. In our study, we take their findings for granted and embed credit spreads manually into the Euler and the price-setting equations that are derived within the standard New Keynesian representative household framework. In that respect, we apply the approach of Ajello et al. (2019) and Aikman et al. (2018) to the case of a small open economy.
We now describe the date 1 shock. At t = 0, the economy is in a steady state with no shocks being anticipated. At t = 1, a positive oil price shock (or, alternatively, credit growth shock), which is modeled as an exogenous increase in X 1 (respectively, in the growth of credit L 1 ; see below). Both private agents and the government correctly anticipate that oil export revenues will return to the same steady-state value after one period: X 2 = X 0 . There is no fiscal policy in this simplified version of the model.
where i 1 is date 1 monetary policy rate. Again, the superscript ps on the conditional expectation operator indicates that expectations of the private sector on date 1 are not fully rational. The spread is determined by the CCyB parameter k 1 as: The profit-maximizing price of firms that get the opportunity to reset their price on date 1 is: where the parameter η > 0 characterizes the degree of pass-through of credit spreads into marginal costs and goods prices.
The general price level on date 1 is determined as = P 0 is the price of firms that do not reset their price on date 1.
The probability of a financial crisis on date 2 known to policymakers but unknown to households is: where L 1 is credit growth that does not appear in the general equilibrium core of the model. This relationship is postulated based on empirical evidence (Ajello et al. (2019), Aikman et al. (2018)).
Credit growth on date 1 is: where ξ L 1 is exogenous credit growth shock unrelated to the oil revenue shockX 1 ≡ (X 1 − X 0 )/X 0 . Similarly to the probability of a crisis (12), the relationship (13) 2018)). Macroprudential policy involves a trade-off since a higher spread lowers the probability of a crisis at the expense of depressed economic activity.
The policy objective is a welfare loss function inspired by Aikman et al (2018): Here,Ŷ f lex t , t = 1, 2, is the "natural" level of output (in log-deviations from date Y 0 ) that would prevail if all prices were flexible and no crisis occurred on date 2;Ŷ c 2 andŶ nc 2 are the crisis and no crisis levels of output (in log-deviations from Y 0 ), respectively, with Ŷ c 2 = (1 − δ)Ŷ nc 2 , where 0 < δ < 1 is fraction of output lost due to financial crisis; π 1 is inflation; γ 1 is the probability of a crisis; λ is the relative weight on output stabilization in the policymaker preferences; ζ is a special weight on crisis prevention. Non-Ricardian households cannot borrow or save and act essentially as hand-to-mouth workers. The non-Ricardian households are introduced into the model in order to give some power to the fiscal policy since otherwise the Ricardian equivalence would hold (Medina and Soto (2016)).

Small open economy with
Literally speaking, the international financial market is modeled as frictionless on all dates, allowing borrowing or saving at an exogenously given rate i * ≡ 1/β − Preferences are assumed the same as in the simplified model of the previous subsection: where i ∈ {R, N R} is a type of a household, and R and N R stand for Ricardian and non-Ricardian, respectively. The fraction of households that are non-Ricardian is assumed to be ν ∈ (0, 1). Non-Ricardian, or hand-to-mouth, households maximize their utility subject to a oneperiod budget constraint in Equation (15): where C N R t and N N R t are their consumption and hours worked, respectively, w t = W t /P t is the real wage, and e t = E t /P t is the real exchange rate. In addition to the labor income, they receive a fraction (1 − τ ) ∈ (0, 1) of the oil revenue. By assumption, they do not have access to the financial markets and consume all their current income in every period.
The one-period budget constraint of the Ricardian households, their fraction being where C R t and N R t are their consumption and hours worked, respectively, d t = D t /P t is the real profits of monopolistically competitive firms, B t the amount of the international one-period discount bond held at the end of date t maturing on date t + 1, and β is its exogenous market price, which coincides with the subjective time discount factor of households, and M t is the aggregate amount of imported materials.
Households' optimization subject to their respective budget constraints leads to Equations (16) and (17) that characterize labor supply decisions by non-Ricardian and Ricardian households, respectively: Whereas non-Ricardian households consume their income period-by-period, optimization by Ricardian households leads to Euler equations (18) and (19) associated with investments in home and foreign bonds, where i t and i * are home and foreign interest rates, π t is the rate of inflation, and s t is the credit spread: A microfoundation for the credit spread in the home bond Euler equation is developed in Cúrdia and Woodford (2016) and for the spread in the foreign bond equation in Menna and Tobal (2018). Similarly to the simplified model of subsection 2.1, the superscript ps on the conditional expectation operator indicates that expectations of the private sector deviate from fully rational. The specific assumption here is that private agents, i.e.
the Ricardian households that make financial decisions, assign a zero probability to the occurrence of a financial crisis on date t = 2.
The technology is similar to the one in the simplified model of the previous subsection.
The unit continuum of monopolistically competitive firms produce differentiated varieties of the domestic good using labor and imported input. The production function is CES with γ > 0 being the cross-elasticity of substitution between labor and the imported input: where α ∈ (0, 1); N t (j) is labor input; M t (j) is imported materials. All differentiated varieties are eventually repacked into the composite final nontradable good by perfectly competitive repackers. The repacking technology is described by another CES aggregator with symmetric weights and the cross-elasticity of substitution between different varieties equal to θ > 1: We consider two cases, where the the cross-elasticity of substitution between labor and the imported input is either γ = 1 or γ = 1, and in the latter case the production function (20) becomes Equation (21): Equation (22) characterizes the optimal mix of the two production inputs-labor, N t , and imported materials, M t -by a typical domestic firm that is consistent with the minimization of production costs: Labor market clearing implies Equation (23): By assumption, a fraction 1 − ξ ∈ (0, 1) of firms get the opportunity to reset their price on date t = 1 whereas on all other dates all prices are fully flexible. Equation (24) characterizes the optimal choice of date t price by domestic producers of differentiated goods: where p f lex t is the real price chosen by the firms that reset their prices on date t; w t is the real wage; e t is the real exchange rate; s t is the credit spread. A microfounded model, in which credit spread endogenously appears in the real marginal cost relationship, is developed in Cúrdia and Woodford (2016). In brief, the marginal cost of firms depends on the slope of the aggregate labor supply, which is the sum of labor supply curves of patient and impatient households. The labor supply of either type of workers depends on this type's marginal utility of consumption. Since in equilibrium, the marginal utility of consumption is not equalized between the patient and the impatient because of the credit spread, the difference in the marginal utility of consumption between the two types, which is a function of the credit spread, becomes a determinant of the aggregate labor supply and, hence, firms' marginal cost.
Equation (25) is the definition of the aggregate price level: where p f ix t is date t real price for the product of firms that do not reset their prices on date t. As already mentioned, such firms, their fraction being ξ, are present on the market only on date t = 1. Equation (26) becomes the definition of price inflation: Of course, in equilibrium, inflation is zero in all periods but t = 1.
In each period, the economy receives a random endowment X t of internationally traded good, called "oil." The government is entitled to an exogenous share τ ∈ (0, 1) ("tax") of oil revenue whereas households are entitled to the rest. Government spending G t that consists only of the domestic final good is financed by the government's oil revenues.

Equation (27) becomes the government budget constraint:
Households purchase imported materials and re-sell them to domestic firms along with their labor. Aggregating across households and the government yields the balance of payments identity (28), where B t and B g t are private and public foreign bond holdings, respectively, and X t is oil export revenue: Relationship (29) is the economy's resource constraint: In the analysis below, we consider two different fiscal frameworks. First, we consider a balanced budget arrangement where the government spends all its current revenue.
Second, we consider a so-called structural balance fiscal rule (30) that prescribes the government to spend only a permanent part of its revenues: It implies that, in the absence of shocks, the chosen time path of government consumption is flat. In other words, the government smooths its consumption over time.
In the rest of the paper we analyze the optimal response of monetary and macroprudential policies to two disturbances: a credit growth shock and an oil price shock. We assume, based on the evidence reported in Shousha (2016), that commodity booms produce credit booms in commodity-exporting economies. To the extent that credit growth helps predict financial crises (Schularick and Taylor (2012), Gourinchas and Obstfeld (2012)), commodity booms potentially make these economies more vulnerable to financial instability in the future. Technically, we add the oil endowment as an additional input in the credit growth equation.
A generic scenario that we analyze is the following. Until date t = 0 the economy rests in the original steady state with no financial frictions. On date t = 1 an unanticipated shock arrives. There is nominal price rigidity on date t = 1: only fraction 1−ξ of domestic firms can reset their price, whereas fraction ξ of them keep selling at the price that was in effect on date t = 0. As was already mentioned, financial As in Aikman et al. (2018), we assume that the probability of a financial crisis on date t = 2 from the perspective of date t = 1, γ 1 , positively depends on the credit growth on date t = 1, L 1 , and negatively on the degree of tightness of macroprudential policy, which is labeled as the countercyclical capital buffer (CCyB) in that paper: The excessive credit growth makes the economy vulnerable to financial instability in the future. Capital buffers applied in advance make the financial system more resilient and thus reduce the probability of a crisis. The credit growth on date t = 1 negatively depends on the policy rate, i 1 , and the credit spread, s 1 . The credit spread is linked to the stance of the macroprudential policy expressed as a countercyclical capital buffer (CCyB) as s 1 = ψ k k 1 , ψ k > 0. An increase in both variables makes credit more expensive and thus decelerates credit growth on date 1. In addition to these two determninants of the credit growth, we introduce the commodity price as a factor specific to commodity-exporting economies. The postulated credit growth equation is where ξ L 1 is an exogenous credit growth shock andX 1 ≡ (X 1 − X 0 )/X 0 . Parameters

[FIGURES 1 AND 2 ABOUT HERE]
The notion of the bad steady state is a simplification. The aftermath of a typical financial crisis is described as a period of time during which the output is below the potential followed by the return to normal growth along the long-run trend. In our model, the difference in output between the good and the bad date t = 2 steady states should be interpreted in the present value terms.
Following Ajello et al. (2019) and Aikman et al. (2018), we assume that private agents are myopic and underestimate the likelihood of financial crisis on date t = 2. They assign zero probability to the crisis state. The government is rational and assigns probability γ 1 to the crisis state on date t = 2.
Until t = 1 the economy rests in a deterministic steady state with flexible prices, no financial frictions, and no shocks anticipated. The initial symmetric steady state is described by the following system of equations evaluated at date t = 0 and s 0 = 0: non-Ricardian households' one-period budget constraint (15), non-Ricardian and Ricardian households' labor supply equations (16) and (17), production function (20) and (21), domestic producers' optimal choice of the production inputs (22), labor market clearing (23), domestic producers' optimal choice of the price (24), government budget constraint (27), balance of payments identity (28), and a resource constraint (29). This is a closed system of ten equations in ten unknowns: Nominal price rigidity and financial market frictions are also present only on date t = 1.
It follows that the economy will find itself in a new steady state on date t = 2 and remain there forever. For periods t = 1 and t ≥ 2, the equilibrium is described by a system of log-linearized equations (37) -(60) in Appendix A.

Calibration
Benchmark parameter values are shown in Table 1.
[ The value of the private net foreign asset holdings, B 0 , is set equal to 10.
The time discount, β, is calibrated at 0.97. As in Aikman et al. (2018), the "length" of period t = 1, i.e. of the short run, is about 3 years in our exercise.
The share of labor in the production of final domestic goods, α, is set equal to 0.8, which implies that the share of imports is 0.2.
For the cross-elasticity of labor and imported inputs in the production of domestic goods, γ, we try two values. The first one is 1, which is standard and corresponds to the Cobb-Douglas production technology. The other one is 0.7, which implies a certain degree of complementarity between the two inputs.
The relative risk aversion parameter, σ, is usually calibrated in the range between 1 and 4. Aikman et al. (2018) set the slope of the New Keynesian IS curve (the Euler equation), i.e. the reciprocal of the relative risk reversion coefficient, equal to 0.6. To make our findings comparable to theirs, we choose the value 1/0.6 for the relative risk aversion coefficient, which is in the range of consensus values.
The weight on the output gap in the loss function of the central bank, λ, is set equal to 0.05, which is standard in the monetary economics literature (Woodford (2003)).
The long run equilibrium level of interest, i * , is related to the subjective time discount factor: i * = 1/β − 1.
The inverse Frisch elasticity of labor supply is set equal to 0.1, which implies that the individual labor supply is rather elastic with respect to wages. Although not supported by microeconomic evidence, this calibration is standard (Woodford (2003)).
The fraction of sellers that do not change their price on date t = 1, ξ, is set equal to 0.65. In combination with the inverse Frisch elasticity parameter, φ, and the time discount factor, β, this value yields the slope of the New Keynesian Phillips Curve close to 1, which is in line with the calibration of Aikman et al. (2018).
The cross-elasticity of substitution between different varieties of the final home good, θ, is set equal to 6. This corresponds to the steady state value of the markup of 6/(6−1) = 1.2, or 20%.
The labor disutility parameter, ψ, is set equal to 1 without loss of generality.
The fraction of non-Ricardian households, ν, is set equal to 0.5, as in Medina and Soto (2016).
The elasticity of the credit spread to the CCyB parameter, ψ k , is calibrated at ψ k = 0.2 based on empirical evidence reported in Aikman et al. (2018).
The semi-elasticity of marginal cost, η, is assigned two alternative values, 1 and 0.5.
In the first case, the pass-through of higher credit spreads into marginal costs and goods prices is complete, whereas in the second case it is only partial. With no consensus on the relationship between credit spreads and marginal costs, we believe that our approach is reasonable. The value of 1, in combination with the fraction of non-optimizing firms parameter ξ, yields the elasticity of inflation with respect to the credit spread implied by the New Keynesian Phillips Curve close to 0.4, which is the calibration in Aikman et al.
The export revenue generated by oil endowment in the initial steady state, X 0 , in levels, is chosen rather arbitrary at X 0 = 2. It is assumed that following a temporary shock on date t = 1, the oil exports revenue is back to the pre-shock level,X 2 = 0, in log-deviations from X 0 .
The government holdings of foreign bonds in the initial steady state are set, rather arbitrarily, equal to B g 0 = 10.
The tax rate for commodity exports is set equal to τ = 0.5.
The parameters of the financial condition equation and the crisis probability relationship are borrowed from Aikman et al. (2018). The semi-elasticities of credit growth to interest rate and credit spread are set equal to φ i = −1.5 and φ s = −6, respectively.
These values are based on empirical evidence on the sensitivity of credit growth to interest rates and spreads. In addition, the elasticity of credit growth to the oil price growth, φ X , is calibrated based on SVAR evidence in Shousha (2016) and is set equal to φ X = 0.3.
The average credit growth over three-year period is set equal to φ 0 = 0.21 or 21%, as in Aikman et al. (2018). The parameters of the crisis probability relationship ( calibrating the elasticity based on the SVAR evidence reported in Shousha (2016). Figure 3 shows impulse responses of endogenous variables of the model to a temporary 10% increase in the price of oil on date t = 1 assuming that the stance of monetary and macroprudential policies is neutral. Given that the shock is short-lasting, it induces a smoothing response: a big fraction of the oil bonanza is saved through accumulation of foreign bond holdings. As a result, the economy can afford to purchase more imported materials and enjoy more leisure in all periods starting from date t = 1. A rise in the final goods output is accompanied by the growth in real wages and real appreciation.
The response of the economy to the shock is optimal, up to distortions caused by the monopoly power of domestic producers: The responses of the natural level of output, exchange rate, etc. coincide with responses of their counterparts. Despite date t = 1 sticky prices, the optimal adjustment to the shock is achieved due to the accommodating response of the exchange rate. To the extent, though, that commodity booms tend to trigger credit booms in emerging market economies (Shousha (2016)), this will translate into a higher probability of financial crisis on date t = 2.
[ that the contractionary effect of both shocks on the real price of the imported inputs must be more pronounced as the economy with no opportunity to save internationally has to utilize the entire amount of imported inputs received in exchange for exported oil.
As in the small open economy case, both policy disturbances decelerate credit growth on date t = 1 and reduce the probability of a financial crisis on date t = 2.
[FIGURES 6 AND 7 ABOUT HERE] The main exercise of this paper involves finding optimal responses of monetary and macroprudential policies with regard to two different structural shocks, one at a time, namely, (i) a credit growth shock unrelated to a commodity boom and a (ii) spike in credit growth triggered by a commodity boom. Figures 8 and 9 show date t = 1 optimal responses of CCyB and policy rate to real credit growth shocks of different size-the disturbance ξ L 1 in equation (32)-for the small open economy and the closed economy.
The pattern for the closed economy is similar to the results of Aikman et al. (2018): in response to a credit growth shock CCyB tightening should be accompanied by some monetary easing. It turns out that this is not necessarily the case for a small open economy. Indeed, as Figure 8 suggests, the optimal policy mix requires a well-pronounced CCyB tightening backed by some moderate-to-weak monetary tightening. If a credit boom is brought on the back of a commodity boom, this pattern survives, as Figure 10 demonstrates.
[FIGURES 8, 9, AND 10 ABOUT HERE] The key parameter that determines whether macroprudential tightening should be accompanied by monetary easing or, rather, tightening is η, the degree of pass-through of credit spreads into marginal costs in equation (24). It would be more appropriate to say, though, that monetary policy should remain roughly neutral according to Figures 8 and   10. Figures 8, 9, and 10 were obtained for η = 1, which means that a rise in the credit spread by 1 p.p. fully passes through to the price of producers that have the opportunity to reset their price on date t = 1, thus making a sizable contribution to date t = 1 inflation. It is conceivable though that the pass-through of credit spreads into producer prices far from complete. Figures 11, 12, and 13 show optimal combinations of CCyB and the policy rate for η = 0.5. We now observe that, both in a small open economy and a closed economy (financial autarky, to be more precise), the optimal policy mix requires that macroprudential tightening be accompanied by monetary easing. Below we provide some explanation of why the degree of the credit spread pass-through matters, after which we turn to the analysis of a small open economy with fiscal sector.
[FIGURES 11, 12, AND 13 ABOUT HERE] For illustration purposes only, we make a simplifying assumption that the inverse Frisch elasticity of labor supply parameter, φ, equals 0 (in our baseline calibration it is set equal to 0.1). It is straightforward to show that date t = 1 equilibrium values of output and inflation arê where we assume thatX 1 =X 2 = 0. Relationships (33) and (34) imply that the effect of the policy rate, i 1 , on date 1 output and inflation is always negative: an increase in the policy rate reduces output and produces deflation. The effect of tighter CCyB on output, through higher credit spread s 1 , is also negative, but the sign of its effect on inflation is determined by the sign of the factor (η − α). A sufficiently high value of η, i.e. η > α, means that the pass-through of credit spreads into marginal cost and inflation is strong.
Calibrated parameters φ s , φ i , ψ k , h L , and h k in (32), (31), and s 1 = ψ k k 1 , which are based on empirical evidence, suggest that macroprudential policy in general and CCyB in particular are more effective against excessive credit growth and financial instability than monetary policy. Macroprudential policy should therefore primarily target financial stability on date t = 2 by curbing unwanted credit growth on date t = 1. Given that η > α, tighter macroprudential policy is inflationary. Furthermore, it reduces output on date t = 1. Some monetary easing would be able to make up for a decline in output but only at the cost of accelerating inflation even further. Provided that the weight on the output gap in the policymaker's loss function, λ, is much lower than the weight on the inflation under standard calibration (by the factor of 20), higher inflation on date 1 cannot be viewed as acceptable, and therefore monetary policy should remain roughly at the neutral stance. If, instead, the pass-through of credit spreads into marginal cost and prices is far enough from complete, the outcome of macroprudential tightening is a decline in both output and inflation. In this situation, monetary policy intervention is more than welcome: some monetary easing would bring date t = 1 inflation and output closer to targeted values without much harm in terms of unwanted credit growth and resulting financial instability.
The last finding contrasts with the result derived in Aikman et al. (2018) for closed economy that macroprudential tightening aiming to curb excessive credit growth should always be accompanied by some monetary easing that compensates for a recessionary and deflationary impact of the macroprudential policy intervention. If we impose the financial autarky assumption in our simple model, i.e. B t ≡ 0, the outcome will bê Given that η ≤ 1, equations (35) and (36) imply that the effect of tightening of either policy leads to lower output and deflation. This suggests that when macroprudential policy tightens, some monetary easing is always welcome.
It is remarkable that if the marginal cost is not sensitive to the credit spread, i.e. if η = 0, then in a closed economy the trade-off between achieving financial stability in the longer term and output loss in the shorter term disappears: according to equation It follows that, under such an arrangement, temporary shocks in the price of oil should induce permanent changes in government spending of a smaller size. Only a fraction of temporary oil revenue surplus will be allocated to the current period's spending whereas the rest is saved through the accumulation of foreign assets (risk-free bonds). Figures 14 and 15 show the optimal responses of macroprudential and monetary policies to credit growth shocks unrelated to commodity booms for the structural balance fiscal rule and two different values of η. One can see that both quantitatively and qualitatively the optimal responses are similar to those for the simpler model of subsection 3.1: for η = 1, macroprudential policy tightens while monetary policy is about neutral; for η = 0.5, macroprudential policy tightens while monetary policy loosens.

[FIGURES 14 AND 15 ABOUT HERE]
This pattern barely changes for the case shown in Figures 16 and 17 where the structural balance fiscal rule is replaced with the balanced budget in every period.
[FIGURES 16 AND 17 ABOUT HERE] We now turn to the analysis of optimal policy response to date t = 1 oil price shock that also triggers a credit boom on date t = 1. Figures 18 and 19 show the optimal responses of macroprudential and monetary policies for different values of the shock to the price of oil on date t = 1, assuming that the structural balance budget rule is in place. The pattern of the optimal macroprudential policy reaction is as expected: the response is positive and grows with the size of the shock. In contrast with the credit growth shock unrelated to the price of oil, the optimal monetary policy response implies loosening (i.e. i 1 is below the steady state value of 3%) for negative values of the oil price shock and tightening (above 3%) for positive values of the shock. The optimal response of macroprudential policy is more aggressive if η = 0.5 than if η = 1. If η changes from 1 to 0.5, monetary policy response becomes somewhat more pronounced for negative realizations of the oil price shock and less pronounced for positive realizations.
The natural question is: Why does the optimal response of monetary policy differ so dramatically for the two shocks? In the closed economy with flexible nominal prices, there is no way to reallocate a fraction of the date t = 1 surplus to future periods. That means that the entire amount M 1 =X 1 must be used in the production on date t = 1. The relative abundance of imported inputsM 1 compared with labor drives real wagesŵ n 1 up and depresses the real price of the imported inputsê n 1 , which is the real exchange rate. On date t = 2, all real prices and allocations are back to their pre-shock levels.
In the small open economy with Ricardian households only and flexible nominal wages, the endogenous response toX 1 will be different. As shown in Figure 3,ê n 1 andê n 2 drop by an equal amount,ŵ n 1 andŵ n 2 rise by an equal amount, etc. In response to the shock toX 1 on date t = 1, the economy jumps immediately to a new steady state.
In the small open economy with flexible prices where both Ricardian and non-Ricaridian households are present, a shock toX 1 will induce a greater growth in wages on date t = 1 than on date t = 2, which implies that non-Ricardian households will cut their labor supply on date t = 1. Real appreciation on date t = 1 will be more pronounced than on date t = 2. The real interest parity implies that the real interest rate will rise on date t = 1, which will stimulate Ricardian households to work more and consume less on date t = 1.
Now, if we return to our small open economy with sticky date t = 1 prices and both types of households present, it should be clear why the flexible-price equilibrium cannot materialize without monetary policy intervention. Recall that starting from date t = 2 nominal prices are flexible, and the inflation target π 2 = 0 is achieved. If i 1 remains unchanged, so does the real rate. By the real interest parity,ê 1 andê 2 change equiproportionally. The consequence is that Ricardian households consume too much and work too little on date t = 1 compared with their flexible-price equilibrium quantities.
The correcting response of monetary policy would be to raise i 1 ifX 1 > 0 and cut i 1 if X 1 < 0. This is exactly that we observe in Figures 18 and 19.
[FIGURE 20 ABOUT HERE] Figures 21 and 22 show that this pattern survives if the structural balance fiscal rule is replaced with the balanced budget rule, with optimal monetary policy intervention becoming even more aggressive.

[FIGURES 21 AND 22 ABOUT HERE]
Our final exercise is to examine how the optimal policy mix with regard to the two shocks of interest changes if the degree of complementarity between labor and imported inputs rises. Figures 23 and 24 show optimal policy responses to the commodity-boomunrelated credit growth shock and the oil price shock, respectively. In response to the credit boom shock, macroprudential policy tightens whereas monetary policy loosens, which contrasts to the case of γ = 1 where monetary policy was neutral or slightly contractionary. The explanation is the following. Macroprudential tightening depresses aggregate demand and importsM 1 . The real prices of both inputs,ŵ 1 andê 1 , decline. Compared with the case of unit cross-elasticity of substitution between labor and imported inputs, γ = 1, the drop in real wages will be greater in the case of lower substitutability, or higher complementarity, between labor and imported inputs, γ = 0.7. This will eliminate any inflationary pressures created by higher credit spreads via marginal costs and final goods prices. It follows that there is no need for monetary contraction anymore, and the task of monetary policy now becomes closing the output gap.
In the case of an oil price shock, the overall optimal response of monetary policy is the sum of the two: first, closing the output gap produced by tighter macroprudential policy and, as a result, a higher credit spread, and the second, correction of the intertemporal resource misallocation mentioned above. It turns out that, for this particular parametrization, the second task of monetary policy dominates so that the optimal policy mix requires some monetary tightening as the value of the oil price shock grows.
[ unwanted credit growth is brought on the back of a commodity boom, and some workers are hand-to-mouth with no ability to save or borrow, then monetary policy tends to be complementary to macroprudential policy since it bears the task of correcting intertemporal resource allocation distorted by sticky prices thus giving a hand to the structural balance fiscal rule. When there is more complementarity between domestic and imported production inputs, the two policies tend to be substitutes.
Being very stylized, our model lacks some important features. First, production firms do not borrow in our model whereas they do in actual economies. To the extent that they can choose between borrowing in foreign vs. domestic currencies, this can limit the effectiveness of domestic monetary policy and raise the appeal of macroprudential policy.
Second, macroprudential policy in our model is captured by a single parameter, which is labeled CCyB only for concreteness. In practice, a multitude of various macroprudential policy tools is available, and not all of them work through credit spreads. For example, stricter loan-to-value ratios (LTV) do not have a direct effect on spreads but presumably suppress unwanted credit growth. Analyzing the optimal choice among different macroprudential tools certainly requires a richer model. Last but not least, in our model the short run is compressed to a single period, namely, date 1 when shocks materialize and nominal prices are sticky. To a great extent, our findings are driven by the monetary authority being reluctant to accept higher rate of inflation in the short-term perspective.
In a fully-fledged dynamic model, this concern may not be so serious since, provided that inflation remains close to target in the medium term, the monetary authority can tolerate it temporarily overshooting target in the short term. It is not obvious at this point how robust out results are with respect to this modification of the model. We leave these and other extensions for future research.