{'fraction_non_alphanumeric': 0.03354981464984626, 'fraction_numerical': 0.021308083565619702, 'mean_word_length': 4.669979633401222, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Quantifying Brexit: from ex post to ex ante using structural gravity

Exploiting changes in the geography of economic integration in Europe, this paper quantifies the effects of Brexit from ex post to ex ante using structural gravity. By isolating the directional treatment effects of EU agreements for the UK, the analysis reveals important heterogeneity across agreements, sectors, and within pairs. We find that these directional effects matter for the size and distribution of the welfare effects of Brexit—the withdrawal of the UK from EU agreements resulting into a return of trade costs to the situation quo ante. We make this point with the help of a modern multi-sector trade model that is able to capture inter- and intranational production networks. In line with other papers, the welfare costs of Brexit are higher in the UK than in most other EU countries. However, heterogeneity tends to attenuate overall costs while giving rise to substantial heterogeneity between EU27 members and sectors. A scenario that could shift bargaining power eliminates asymmetries in the costs of Brexit as soon as the UK fully liberalizes its market.


Introduction
The relationship between the European Union (EU) and the United Kingdom (UK) has always been fraught with complexity for reasons related to history, culture and geography. Differences over the long term goal of the EU integration processwhether the objective is a political union or just the establishment of a common market -date back at least to 1983 when the term "ever closer union" was coined. 1 The creation of the European Monetary Union-from which the UK opted outand even more so the emergence of deficiencies in the construction of the Eurozone made the necessity of further political integration apparent, and widened the gap between the UK and the continent. At the same time, the relative importance of Europe as a trade partner for the UK fell from about 65% in the early 1990s to less than 45% in 2016, presumably because trade costs with third countries dropped by more than costs of intra-EU trade. 2 This fact, together with rising net budgetary contribution to the EU, seems to imply that the relative costs of a withdrawal from the EU are lower today than what they would have been 25 years ago.
In this paper, we ask: If, in 2014, the UK had not been part of the EU? What would counterfactual real consumption, trade volumes, and sectoral value added have looked like? This provides us with an estimate of UK benefits from EU membership, which-in turn-we take as a proxy of what the costs of leaving the EU would be. To answer this question, we first conduct an ex post evaluation to back out trade cost changes. These can be used as proxies for non-tariff barriers in different counterfactual Brexit scenarios. More specifically, we exploit different integration steps of the UK and the EU members (i.e. becoming a member of the European Union Single Market, or joining a free trade agreement) on the sector level. To correctly estimate trade cost shocks, we consider directionality in the treatment effects of UK-EU relations. Second, we run ex ante simulations of the effects from reversing those trade cost savings in a quantitative Ricardian trade model. We focus on the trade effects and do so in great detail, distinguishing 22 goods and 28 services industries and 43 countries and a rest of the world component representing more than 90% of world GDP.
We are not the first to study the potential economic consequences of UK's withdrawal from the EU, but we believe we offer the most detailed and most data-driven analysis of the trade-related effects of Brexit. We contribute by embedding a careful ex post evaluation of British EU membership into an ex ante analysis of its dissociation from the EU.
First, we estimate directional trade effects of the British EU membership or of EU trade agreements with third countries (such as with Korea) and allow these to differ 1 3 Quantifying Brexit: from ex post to ex ante using structural… across industries. 3 Separating tariff and non-tariff barrier (NTB) trade effects in EU membership, we use the estimated trade cost shocks to carry out our comparative statics exercise in the year 2014, for which we have real data. 4 This allows us to put special emphasis on sectoral heterogeneity. In contrast, Dhingra et al. (2017) use estimates of NTBs by Berden et al. (2013) for the US-EU relationship dating from the year 2007 and assume a uniform increase by 25% across all sectors. Moreover, they also assume that the UK would not be able to participate in future reductions in NTBs. Further, we estimate the changes of non-tariff barriers and not the levels, which makes the results independent of other policy components. 5 Second, we estimate the crucial trade elasticities on exactly the same data that we calibrate our model with and which also defines the baseline that we compare our counterfactual equilibrium with. This is in the spirit of structural gravity modeling (see Yotov et al. (2016) for an excellent survey and Mayer (2019) for an application to the costs of non-Europe) and allows for a tight connection between theory, estimation and calibration. Moreover, the econometric exercise supplies us with the necessary information to simulate confidence intervals for all of our endogenous variables. By quantifying uncertainty, we also go beyond Dhingra et al. (2017) and Steinberg (2019). Third, when evaluating the possible effects of new bilateral trade agreements of the UK with third parties, we do not make educated guesses about the size and distribution of sectoral changes in NTBs. Rather, we estimate the potentially asymmetric sectoral trade effects of the EU-Korea trade agreement for the UK and assume that new agreements could implement what has proven feasible in that agreement. The EU-Korea deal has been in force since 2011 and is one of the most ambitious (and successful) FTAs of the EU (Lakatos and Nilsson 2017). Further, next to tariffs and NTBs, we consider fiscal transfers within the EU as an important component of EU membership. Hence, we evaluate their impact on disintegration by decomposing welfare effects into tariff, NTB, and fiscal transfer components in the context of Brexit.
We use a computable general equilibrium framework (see e.g,, Costinot and Rodriguez-Clare 2014). A common feature of these models is that they give rise to a theoretical foundation of the gravity equation of international trade and that they can be solved in changes, a feature referred to as "exact hat algebra" in the literature (Dekle et al. 2008). This has obvious computational advantages but also helps with calibration as unknown constants drop out. More specifically, our modeling framework is based on Caliendo and Parro (2015)'s multi-sector input-output version of 3 Baier (2019) show that asymmetries in trade agreements occur particularly within pairs and play an important role for their exports and imports. Graziano et al. (2018) estimate uncertainty effects surrounding the probability of Brexit considering such asymmetries. 4 Steinberg (2019) uses a dynamic general equilibrium model with firm heterogeneity, but relies on the calibration of parameters from different sources of data and on several specific assumptions surrounding e.g. future technology adoption. Our focus lies on the identification of the trade cost shocks surrounding Brexit by separating tariffs and NTBs, considering the directionality of treatment effects, and the consideration of fiscal transfer systems within the EU. Relying on a single source of data has the advantage to rely on fewer assumptions, but obviously limits us with respect dynamic adaptions in case of Brexit. 5 Sampson (2017) provides an excellent overview of trade and other issues related to Brexit.

3
Quantifying Brexit: from ex post to ex ante using structural… consumption more in Ireland, Luxembourg and Malta than in the UK, where the 90% confidence interval is [-3.32%, -2.19%]. The core EU economies France, Germany, and Italy face losses in the intervals [-0.66%, -0.38%], [-0.84%, -0.59%], and [-0.50%, -0.31%], respectively. The conclusion of a modern FTA, drafted after the existing EU-Korea FTA, allows avoiding three quarters of the loss from Brexit in the EU27 countries and two thirds in the UK compared to the hard Brexit scenario. If the UK concludes FTAs with many countries outside of the EU27, the change in real consumption is contained in the 90% interval [-2.10%, -0.76%] for the UK. Due to trade diversion effects, losses in EU countries would be higher than under the hard Brexit scenario. For third countries, real consumption changes are mostly not statistically different from zero. An exception is Switzerland, who could slightly benefit from a hard Brexit and a subsequent relocation of financial services. With a hard but smart Brexit strategy, the UK decreases tariffs across all goods sectors to zero for all trade partners and does not impose additional controls on imports from the EU27, while the EU imposes tariffs and additional non-tariff barriers against the UK. With this strategy, the UK could lower its economic damage to half a percent. The existing asymmetry between Britain and the EU27 would vanish and the bargaining power would shift from Brussels to London.
The remainder of this paper is organized as follows. Section 2 presents the methodological framework. Section 3 discusses the main data sources, explains the empirical estimation method, and discusses gravity results. Based on the defined Brexit scenarios, we examine general equilibrium consistent results on trade and welfare in Sect. 4. The final chapter concludes.

Model
The model follows Caliendo and Parro (2015), who provide a multi-sector version of the Eaton and Kortum (2002) gravity model with input-output linkages.

Setup
There are N countries indexed by iand n, as well as J sectors indexed by jand k. Sectoral goods are either used as inputs in production or consumed, with the representative consumer having Cobb-Douglas preferences over consumption C j n of sectoral final goods with expenditure shares j n ∈ (0, 1) and ∑ j j n = 1. Labor is the only production factor and labor markets clear. The labor force L n is mobile across sectors such that L n = ∑ J j=1 L j n , but not between countries. In each sector j, there is a continuum of intermediate goods producers indexed j ∈ [0, 1] who combine labor and composite intermediate input and who differ with respect to their productivity z j i j . Intermediate goods are aggregated into sectoral composites using CES production functions with elasticity j . On all markets, there is perfect competition. j in denotes trade costs of delivering sector j goods from country i to country n such that where t j in ≥ 0 denotes ad-valorem tariffs, D in is bilateral distance, and in is a vector collecting trade cost shifters (such as FTAs or other trade policies).
Productivity of intermediate goods producers follows a Fréchet distribution with a location parameter j n ≥ 0 that varies by country and sector (a measure of absolute advantage) and shape parameter j that varies by sector (and captures comparative advantage). 7 Producers of sectoral composites in country n search for the supplier with the lowest cost such that Caliendo and Parro (2015) show that it is possible to derive a closed form solution of composite intermediate goods price Similarly, a country n's expenditure share j in for source country i's goods in sector j is which forms the core of a gravity equation.

3
Quantifying Brexit: from ex post to ex ante using structural…

General equilibrium
Let Y j n denote the value of gross production of varieties in sector j. For each country n and sector j, Y j n has to equal the value of demand for sectoral varieties from all countries i = 1, … , N. 8 The goods market clearing condition is given by where national income consists of labor income, tariff rebates R i and the (exogenous) trade surplus S i , i.e. I i = w i L i + R i − S i and X j i is country i's expenditure on sector j goods. 9 The first term on the right hand side gives demand of sectors k in all countries i for intermediate usage of sector j varieties produced in country n, the second term The second equilibrium condition requires that, for each country n, the value of total imports, domestic demand and the trade surplus has to equal the value of total exports including domestic sales, which is equivalent to total output Y n : Conditions (6) and (7) close the model.

Comparative statics in general equilibrium
We are interested in the effects of different Brexit scenarios on trade flows, wages, sectoral value added, and real consumption (as our measure of welfare). Hence, we need to quantify the comparative static effects of changes in trade costs (tariffs and non-tariff barriers) j in on endogenous quantities such as trade flows, wages, sectoral value added, production and tariff income. As shown by Dekle et al. (2008), we solve the model in changes. Let z denote the initial level of a variable and z ′ its Our exposition differs from Caliendo and Parro (2015) in that they use total expenditure on composite goods instead of total production of varieties as endogenous variable. So in Caliendo and Parro (2015) the value of gross production comprises all foreign varieties that are bundled into the composite good without generation of value added. 9 Note, we keep the trade surplus relative to GDP constant; quite mechanically, this forces additional asymmetry on the change in trade flows even if trade cost shocks are rather similar. We do not eliminate the trade surplus through reparameterization as in Caliendo and Parro (2015). 10 Instead of the goods market clearing condition, one can also use the expenditure equation as in Caliendo and Parro (2015). counterfactual level. Then, trade cost shocks are given by ̂j in = 1+t j � in 1+t j in e j (Z � in −Z in ) and the change in real consumption is In Appendix A.1, we present the system of equations in changes required to solve the model. An important advantage of solving the model in changes is that certain constant parameters such as the absolute advantage or the elasticity of substitution between input varieties drop out and need not be estimated. This reduces the data needs and lowers the scope for measurement error-of course, at the price of functional assumptions.
Our comparative statics exercise refers to the long-run, i.e., to a new equilibrium in which all relevant general equilibrium interactions have already fully taken place. Short-run effects can differ from those long-run predictions. Moreover, we hold technology fixed and abstract from endogenous innovation or technology adoption. The latter would require leaving the bedrock of a standard and widely accepted modeling framework.

Empirical model
From Eqs. (2) and (5) we derive the following sector-level gravity equations which we use to estimate the parameters and : M j in,t denotes the value of imports of country i to country n in sector j at time t (including internal trade), the ad valorem tariff factor is given by 1 + t j in,t , and the trade elasticity is 1∕ j > 0 . j i,t and j n,t denote importer-and exporter-specific year fixed effects, respectively. j in denotes bilateral country-pair fixed effects which account for all time-invariant determinants of trade, such as geographical distance, or initial conditions. The time-varying importer and exporter effects control for multilateral resistance. By triangulation, they also account for the effects of exchange rate variation. j in,t is a random error term.

3
Quantifying Brexit: from ex post to ex ante using structural… For the simulation, we require estimates of j k ∕ j . Whenever an agreement affects the UK, we allow for treatment heterogeneity, hence, its effect to differ for the UK and the other 27 EU members (EU27). For example, we impose symmetry in the trade cost effect of EU membership amongst the EU27, EU27 j in,t , but allow the EU membership for the UK to differ from that average; moreover, we also allow for directionality. UK exports to the EU27 may be affected differently than imports from the EU27, EU j UKn,t and EU j iUK,t . We deal similarly with the conclusion of the EU-Korea agreement in 2011. The effect of the Korea agreement for the EU27 is captured by EU27KOR j in,t , while the effect for the UK is captured by UKKOR j in,t . Because the UK is neither a member of the Schengenzone, Schengen j in,t , nor the Eurozone, Euro j in,t , we do not further differentiate those effects. 11 All integration measures are defined as binary variables taking the value one in a year if countries i and j are both members of an agreement. Schengen j in,t is different; it systematically treats European countries as heterogeneous, as land-borne trade within Europe from i to n may cross one or up to eight Schengen-internal borders. Aside, even if i and/or n are outsiders to the Schengen area, a pair in may experience lower transit costs. We thus use a variable Schengen j in,t = {1, … , 8} that counts the number of Schengen-internal borders between a pair in (see Felbermayr et al. 2018).
Econometric identification relies on countries joining the EU, the Euro, the Schengenzone or FTAs in the period 2000-2014. Thus, the trade cost effect of the Single Market is identified through the various waves of Eastern enlargement (2004,2007,2013). The Eurozone was created in 1999 by 11 EU members; until 2014 seven additional countries joined. Similarly, Schengen was gradually expanded. The EU-Korea FTA entered into force in 2011 (the latest trade agreement of the EU available in our data), as did a number of other FTAs amongst non-EU countries.
The selection of country pairs into trade agreements with many members such as the EU is not random; the same is true for the setting of tariffs. To obtain unbiased estimates of j and j k we require that the covariances between the error term j in,t and the integration dummy on the one hand and between j in,t and the sectoral tariff rate on the other are zero conditional on controls. Note that we include bilateral fixed effects j in to account for all time-invariant variables that jointly affect policy variables and bilateral trade flows. Next to potential endogeneity, this also addresses omitted variable bias in integration agreements (see, e.g., Baier and Bergstrand 2007).
As recommended by Silva (2006) and Fally (2015), we estimate the model using Poisson Pseudo Maximum Likelihood (PPML) methods. We cluster standard errors at bilateral pairs.

Data sources
To calibrate the model and to estimate the possible effects of the UK leaving the EU Single Market and Customs Union, we need comprehensive data. 11 The same approach is taken for FTAs other than the EU-Korea agreement, FTA j in,t .
The World Input-Output Database (WIOD) comprises our main data source. It contains information on sectoral production, value added, and bilateral trade in final and intermediate goods in producer and consumer prices detailed by sector, and internal trade. This allows us to extract bilateral input-output tables and expenditure levels. WIOD includes 43 countries and a rest-of-the-world (RoW) aggregate for the years 2000-2014. It captures 56 sectors, which we aggregate into 50 industries as some sectors display zero output for some countries (see Table 8 in the Appendix). This aggregation concerns mostly services; we keep the sectoral detail in the manufacturing and agricultural industries. 12 Data on bilateral preferential and MFN tariffs stem from the World Integrated Trade Solutions (WITS-TRAINS) and the WTO's Integrated Database (IDB). 13 Data on simple tariffs and on trade from WIOD are used to estimate trade elasticities for the 22 manufacturing sectors-jointly with the ad valorem equivalent changes in NTBs associated with the different steps of European and trade integration in general. 14 We use data on FTA membership from the WTO. 15 Data on membership in the EU, the Eurozone and the successive accession of countries to the Schengen agreement stem from the European Commission. 16 We capture membership in the EU, the Euro or in FTAs by indicator variables. To obtain a geographical measure of Schengen, we follow Felbermayr et al. (2018) and use the count of the number of Schengen borders crossed by truck and ferry when moving from economic centers of i to n in year t.
We use those data to structurally estimate the elasticities and coefficients . Input-output tables provide us with data on the expenditure shares , and the cost shares and . Further, data on bilateral trade shares , countries' total value added w n L n , and trade surpluses S are calculated from input-output tables.
We take information on net fiscal transfers of EU members to the EU budget from the European Commission. Transfer redistribution is calculated based on the operating budgetary balance for the 2010-2014 UK average, relative to each country's gross national income (see Table 9 in the Appendix). The year 2014 is the latest year available in the WIOD data and thus serves as our baseline. Our simulation exercise compares the status quo in 2014 with a hypothetical situation in which the UK would leave the European Union in that year.

3
Quantifying Brexit: from ex post to ex ante using structural…

The UK's Europe exposure in comparison
Our analysis is based on one important conjecture, namely that inward and outward market access costs of the UK have benefited differently-possibly by lessfrom EU membership than other countries, and one key assumption, namely that the analysis of sector-level trade data for the years 2000-2014 is informative about the unwinding of integration steps between the UK and continental European countries that happened much earlier. In fact, through Brexit, we assume that trade costs between the EU and the UK go up by the amount that the Eastern enlargement has brought them down. While this is innocuous for trade costs between the UK and the new EU members, it may underestimate the effect of EU membership on trade costs between the UK and old EU member states.
Here, we present very simple facts suggesting that our presumptions are plausible. Consistent with our formal model, we compute a simple index of average inverse trade frictions of the form where Y i and Y n denote country i's and n's GDPs, Y w = ∑ i Y i is world GDP and X in are country i's exports to country n. 17 Figure 1 plots countries' inverse trade frictions with other EU members and with trade partners outside of the EU. The upper row looks at goods trade; the lower row at services trade. The left column compares inverse trade frictions of countries with EU members and with non-EU members. The right column compares countries' inverse trade frictions with 'old' EU and with 'new' EU members. The pictures suggest that all 25 countries (the 'old' 15 EU members and the ten countries that joined in 2004) have lower frictions amongst themselves than with the rest of the world. This is no surprise and reflects lower geographical and political trade costs. However, intra-EU goods trade frictions Ω −1 i,EU are nowhere higher than in Greece, Cyprus and the UK, while the latter occupies a middle ground when looking at trade frictions with third parties. Hence, the UK seems less strongly tied to intra-European goods trade than other countries of similar size such as Italy, France, Spain, or Germany. This also implies that it has less to lose should it exit the union. With services trade, the UK's position is slightly better.
The right-hand diagram in Fig. 1 plots inverse trade frictions of countries relative to 'old' (EU15) and 'new' (EU10) EU members. Again, the UK lies in the bottomlower corner, signaling relatively high trade costs with both groups of countries. Importantly, it lies on the 45-degrees line, both for goods and services trade. This  suggests that UK exporters and importers face similar situations in both new and old member states. This leaves us confident that, even though our strategy identifies the effects of EU membership using accessions within the period 2000-2014, the estimates are, on average, also sensible with regard to the UK's trade relationship with the old EU15 countries. Table 1 shows results from regressions on aggregate data. Columns (1)-(6) report the effects on integration arrangements on goods trade; columns (7)-(10) on services trade. It reveals four insights that are of paramount importance for the following quantitative analysis. First, on average, EU membership is associated with substantial trade creation. Coefficients on goods [column (1)] and on services [column (7)], both statistically significant at the 1% level, imply trade creation of 72% and 95%, respectively. Assuming an elasticity of 3.5 for goods and 1.5 for services, 18 the estimates imply trade cost reductions of 14% and 36%, respectively. FTAs other than the EU create less trade and indicate trade cost reductions of 3.4% and 4.8%, respectively. The Chi2-test clearly rejects equality of EU and FTA effects; for services, FTAs are not even significant.

Gravity analysis of aggregate data
Second, accounting for other steps of European integration is important to correctly isolate the role of EU membership. Columns (2) and (8) add Eurozone and Schengen membership. It turns out that Schengen matters, both, for goods and services trade; but Eurozone membership is (marginally) not significant statistically. However, controlling for those, the coefficient for the EU membership falls to 0.470 for goods and 0.594 for services, implying a fall in the trade cost reduction relative to columns (1) and (7).
Third, the effect of EU membership on trade may differ between country pairs involving the UK and those involving only EU27 members (excluding the UK). For goods, the coefficient in column (3) is smaller for pairs involving the UK than for non-UK pairs; column (4) indicates that estimated trade cost reductions due to EU membership are 13% for EU27-pairs and 11% for pairs involving the UK. Note that the difference is not statistically significant. For services, trade cost reductions in pairs involving the UK are stronger than for EU27 [column (9)]. Again, the difference is not statistically different from zero. Importantly, adding tariffs for goods trade in column (4) yields a very plausible estimate of the trade elasticity (3.5), with a variance of 0.92. Accounting for tariffs reduces trade costs of EU membership from 12.5% to 8.1% for EU27 pairs and from 10.7% to 6.4% for EU27-UK pairs. This is crucial, as tariffs imply very different welfare implications than iceberg trade costs (non-tariff barriers, NTBs); mistaking tariffs with NTBs would lead to an overestimate of the welfare damage of Brexit.

3
Quantifying Brexit: from ex post to ex ante using structural… Fourth, allowing exports of the UK to EU27 to be affected differently than imports, i.e., turning to directional FTA effects, columns (5), (6) and (10) provide evidence for strong asymmetries. In contrast to column (5), column (6) adds tariffs and thus separates the EU Single Market and the EU Customs Union effect. Columns (5) and (6) show that EU27 goods exports to the UK have increased through EU membership of the UK [49% in column (6)], but UK exports to EU27 countries have benefited only through the elimination of tariffs but not through NTBs-the effect in column (6) of 4% turns insignificant. The difference between UK exports and imports is statistically significantly different from zero at the 1%-level. In the area of services, UK exports seem to have benefited more (98% compared to 64% increase in imports), but here the difference is not statistically different from zero in column (10). Table 2 reports key results from sector-level gravity regressions which are replica of the equations on aggregate data described in columns (6) and (10) of Table 1. It documents substantial heterogeneity across the 22 goods and 28 services sectors  Table 1 The impact of EU integration steps on bilateral imports (2000)(2001)(2002)(2003)(2004)(2005)(2006)(2007)(2008)(2009)(2010)(2011)(2012)(2013)(2014) Dep. var.:

Services
(1) (3)  ***, **, * denote significance at the 1%, 5%, 10% levels, respectively. All models estimated use Poisson Pseudo Maximum Likelihood (PPML) methods. Robust standard errors (in parentheses) allow for clustering at the country-pair level. Pair as well as year specific importer and exporter fixed effects included but not reported. Specifications (1), (2), (7) and (8) use EU28 and other RTA excluding the EU. All other use EU27, treating the UK separately, and other RTA exclude the EU and the EU -Korea RTA. Number of observations: 27,735. Chi2-Tests compare "Both EU" to "Other RTA" in columns (1), (2), (7) and (8); "Both EU" and "EU-UK, symmetric" in columns (3), (4), and (9); and "EU->UK, asymmetric" with "EU<-UK,asymmetric" in columns (5), (6), and (10) Table 1 (continued) Quantifying Brexit: from ex post to ex ante using structural… with respect to the trade elasticity, and regarding effects of EU membership or the EU-Korea FTA. 19 We find reasonable trade elasticities (estimated coefficients on tariffs) for most goods sectors; in sectors where the estimates violate regularity conditions, we report estimates based on tariff adjusted imports and replace elasticities with estimates obtained for aggregate data; see Table 1, column (6). Economic integration arrangements have very different effects on different sectors. Bilateral trade between the EU27 and the UK is shown to increase unambiguously through EU integration in 33 out of 50 sectors (both UK exports and imports go up with at least one effect statistically significant at the 10%-level). In 16 cases (mostly manufacturing), UK imports increase by more than UK exports; in 15 sectors (mostly services) the opposite is true. In the automotive sector (20), UK imports are affected very positively, but UK exports are not. A strong asymmetry exists in the chemicals sector, too, while in basic metals the situation is relatively balanced. In services sectors, postal and  (5). For services sectors, we calculate the trade elasticity for services according to Egger et al. (2012). Varying observations between 23,085 and 27,735. Detailed effects for the 22 goods and 28 services sectors can be found in Tables 10 and 11 in the Appendix courier and financial services stand out, where, against the trend, UK imports have grown by more than UK exports due to EU integration.

Counterfactual scenarios
We have now paved the way to simulate general equilibrium effects of the UK leaving the European Union Single Market and Customs Union. For each sector, the gravity model provides us with estimates of the (inverse) trade elasticity and of the NTB effects of various integration steps, as well as with estimates of the associated variance-covariance matrices. For services, we have no trade cost shifters such as tariffs. We turn to Egger et al. (2012) to infer a trade elasticity of 1 ∕ Services = 1.446. 20 Assuming that parameters are jointly normally distributed, we draw a value of to calibrate the model, and a full set of NTB shifters to inform the counterfactual analysis. 21 We repeat this procedure 1000 times and obtain a distribution of NTB cost shocks and a distribution of changes of endogenous variables. This allows us to construct confidence intervals. 22 We define the following counterfactual scenarios. Figure 2 illustrates trade cost shocks ̂ (Eq. 2) and their distribution for each sector.

S1 WTO Scenario ("Hard Brexit") The UK is no longer part of the European Single
Market and Customs Union and there is no new FTA substituting for it. The EU27 and the UK apply MFN tariffs as currently granted under WTO rules on imports of third countries. 23 In addition, directional NTBs are reintroduced between the EU27 and the UK according to the sectoral trade costs calculated from the gravity estimations. Figure 2a shows NTB changes for the UK (importer) with EU27 23 Figure 4 in the Appendix shows sectoral trade-weighted MFN tariffs granted at the product-level by the EU to third countries in 2014. These are used for simulation in the WTO scenario. 20 Importantly, Egger et al. (2012) state that services trade reacts more elastically to trade liberalization than goods trade. Hence, assuming an elasticity of 5 as in Caliendo and Parro (2015) seems not to be a reasonable choice in our context. This is supported by recent applications of Hobijn et al. (2019) using VAT data for the EU25 and Marquez (2006) using price and income data for the US. Both find a range for services elasticities between 1 and 3. More specifically, Egger et al. (2012) estimate a parameter in their model (which belongs to a related class of new quantitative trade models), which is given by = Goods − Services . Given their estimate ̂= 2.026 and our own estimate ̂G oods =1∕ Goods , we can infer ̂S ervices =1∕ Services , with a variance 0.144. 22 The underlying normality assumption is not completely innocuous, given that the model outcomes are potentially highly non-linear functions of the parameters. The distribution of model outcomes might be highly asymmetric even if the size of the underlying sample is large enough for the normal approximation to work well for parameter estimation. 21 The choice of normal distribution implies that we will always obtain some draws that violate the model-imposed parameter constraint 1∕ > 0 . To circumvent this problem we drop the (very few) parameter draws of that violate the constraint. This comes at the expense of a small upward bias of the mean parameter estimate and a downward bias of the standard errors.

3
Quantifying Brexit: from ex post to ex ante using structural… countries; Fig. 2b shows respective barriers for EU27 members with the UK (exporter). Moreover, the UK loses all existing tariff and non-tariff preferences that it currently enjoys with third countries with whom the EU has an FTA in force. We apply the heterogeneous UK-Korea agreement effect from the gravity model and effects from further pre-EU accession treaties. Additionally, we consider fiscal transfers by correcting the specific trade balances for fiscal transfers between the EU27 and the UK. S2 FTA Scenario ("Soft Brexit") The UK exits the EU Single Market and Customs Union, but the EU27 and the UK negotiate a modern free trade agreement (FTA), which comprises not only tariffs but also affects NTBs on goods and services. We model the FTA scenario as a replication of the EU-Korea agreement of 2011-the latest and most comprehensive trade agreement of the EU covered in the data. We utilize the estimated trade cost reductions of the EU-Korea FTA from our gravity model as a proxy for a potential NTB effects between the EU27 and the UK (see Fig. 2c). Tariffs stay at zero between the EU27 and the UK. S3 Global Britain Scenario We model the same relationship regarding tariffs and NTBs between the EU27 and the UK as under the WTO scenario, but now the UK unilaterally eliminates tariffs and concludes FTAs with various third countries in order to lower NTBs. The scenario is divided into three stages: (a) The UK concludes an FTA with the USMCA countries the US, Mexico, and Canada. NTBs are reduced as under the EU-Korea FTA. (b) Further, the UK concludes an FTA with selected non-EU Commonwealth countries, namely Australia and India. (c) Finally, we assume that the UK also concludes additional FTAs with selected Asian countries (JPN, KOR, CHN).
S4 Hard but Smart Brexit Similar to S1, the UK is no longer part of the European Single Market and Customs Union with no new FTA in place. The EU27 apply MFN tariffs to the UK as currently granted under WTO rules on imports to third countries. Directional NTBs are reintroduced in the EU27 for UK's exports according to the sectoral trade costs calculated from the gravity estimations. In contrast to S1, the UK now decreases all existing tariffs for all its trading partners to zero. Additionally, we account for fiscal transfers within the EU by correcting the specific trade balances between the EU27 and the UK.

The role of treatment heterogeneity
Before turning to the detailed general equilibrium analysis, we illustrate the importance of considering heterogeneity in trade cost shocks for quantitative results. Table 3 shows the real wage changes for various model specifications under the hard Brexit scenario (S1). 24 While allowing for the heterogeneity of treatment effects, Panel A uses the broad sector specification of Table 1, while Panel B allows elasticities to vary across the 50 sectors in our data (cp. Table 2). Panel A reveals that moving from a simple dummy treatment of EU membership (row [1]) to a more subtle measurement allowing for variable geometry (row [2]), to asymmetry between the effects on EU27 pairs and pairs involving the UK (row [3]), and to directionality in the EU27-UK effects (row [4]) gradually reduces the real wage losses due to Brexit from 0.57% in row [1] to 0.41% in row [4] for the EU27 and from 3.20% to 2.53% for the UK. Hence, a simple dummy approach overestimates the costs from Brexit by about 40% for the EU27 average and 25% for the UK.
If trade elasticities and treatment effects vary across sectors (rows [5-8]), we find higher simulated costs from Brexit relative to estimates based on a two-sector model (goods and services)-but only for the combination of sectoral heterogeneity and directional UK-specific treatments. Consequently, being precise in the econometric identification of NTB effects matters for macroeconomic outcomes, even if the most

Effects on real consumption
We now turn to the detailed general equilibrium analysis of Brexit by using the trade cost shocks described in the counterfactural scenarios in our general equilibrium trade model. Table 4 starts by reporting changes in real consumption, our preferred measure of welfare, for 44 countries and the four Brexit scenarios. The advantage of reporting real consumption compared to real wage changes (see Table 18 in the Appendix) is that real consumption accounts for the direct effects of tariff income, transfers, and trade imbalances.
A hard Brexit (S1) decreases the UK's real consumption by 2.76% per annum relative to the status quo in the year 2014. 25 This compares to a reduction of 0.93% in the case of a modern FTA (S2). Opening the British market toward non-EU countries (S3) cannot fully compensate for the negative effect of Brexit and causes the UK's real consumption to fall by 1.43%. This indicates that the well-established trade ties between EU27 economies and the UK cannot easily be compensated through trade agreements between the UK and other Commonwealth countries, Japan, Korea, or China, and the USMCA economies. Real consumption effects for the UK and the EU27 average are statistically significant at the 10%-level. The changes in real consumption for the EU27 are on average smaller than those for the UK in the first three scenarios. The reason is that a smaller trade share per EU27 country is affected (1) and (7)] -0.57 -3.20 -0.01 [2] Variable geometry [col. (2) and (8) (3) and (9)] -0.49 -2.76 -0.01 [4] Allowing for directionality [col. (5) and (10) (1) and (7)] -0.59 -3.50 -0.01 [6] Variable geometry [col. (2) and (8) (3) and (9)] -0.56 -3.29 0.00 [8] Allowing for directionality [col. (5) and (10)] -0.60 -3.45 0.00  by Brexit compared to the UK. The EU27 real consumption losses are nearly four times as large under a hard Brexit (-0.78%) compared to a FTA (-0.20%). Global Britain slightly increases the losses (-0.83%) for the EU27 economies, as a hard Brexit with additional FTAs between the UK and non-EU countries would cause trade diversion away from Europe.
EU27 countries are affected very differently; mean losses lie between -8.16% in Ireland and -0.34% in Croatia. This reflects the initial strength of trade ties by taking input-output linkages involving third countries into account. 26 In case of a hard Brexit, Luxembourg and Malta would face higher losses than the UK and the Netherlands, Belgium, and Cyprus would experience drops in real consumption of more than one percent each. Malta and Cyprus are former colonies; Luxembourg has strong linkages to the UK financial services industry, and the Netherlands and Belgium are geographically very close to the UK. Larger EU countries would experience smaller losses as they are protected by larger home markets and also tend to have more diversified trade ties. In case of a hard Brexit, Germany faces a decrease in real consumption of 0.72%, while France loses 0.52%. A FTA between the EU27 and the UK nearly divides the size of real consumption losses for EU27 by four. With a FTA, Ireland's real consumption decrease is 3.08%, still substantially more than the UK's with 0.93%. Germany would have to face a loss of 0.20%, almost identical to the EU27 average, and statistically different from zero at the 10% level. France, in contrast, would suffer a loss of 0.10% only, which is statistically not distinguishable from a zero effect. Compared to a hard Brexit, losses in real consumption slightly worsen for EU27 countries under a global Britain scenario, as countries are negatively affected by trade diversion caused by the conclusion of trade agreements between the UK and third countries. Germany and France would experience a drop in real consumption of 0.80% and 0.54%, respectively; the EU average goes from -0.78% under S1 to -0.83% under S3.
Turning to non-EU countries, we find small losses for Brazil, Turkey, or the US and slight benefits for China, India, Indonesia, Norway and Taiwan from a hard Brexit. Countries with whom the UK would conclude a new FTA would mostly benefit in real consumption terms; but the relative gains are rather small: India's real consumption would go up by about 0.20% or the real consumption of the US by 0.11%. Canada, with its relatively small home market, would benefit most: its real consumption could increase by 0.26%. All those gains are statistically different from zero.
The EU's dominating power in the Brexit negotiations rests upon the believe that the UK would suffer substantially more in the case of an unsorted, non-cooperative Brexit than the EU27 on average. Our counterfactual scenarios S1-S3, next to the existing literature that quantifies the outcome of Brexit (see, e.g. Dhingra et al. 2017;Sampson 2017;Steinberg 2019) support this believe. While under any previous scenario the UK would lose substantially more than the EU27 on average, the question is whether a hard Brexit that reintroduces MFN tariffs and NTBs is 1 3 Quantifying Brexit: from ex post to ex ante using structural… 27 Detailed results are provided in Tables 12 and 13 in the Appendix. 28 Note that separate welfare effects of (a) to (f) do not add up to the total effect of all components together, as the different barriers may complement or substitute each other.
feasible. London could shift the bargaining power with a simple trick: the hard but smart Brexit strategy (S4). Under S4, the UK would no longer suffer fundamentally more than the EU27. The UK's real income would decrease by half a percent (see Table 4)-which is more than 5 times less than under a hard Brexit, and about half the loss from a soft Brexit. The effect is mainly driven by two channels: First, the absence of tariffs does not lead to additional price increases for British consumers, in contrast to the hard Brexit scenario (S1). In fact, the complete tariff liberalization even leads to price decreases. A negative nominal income effect still outweighs these positive price effects. As the EU27 increase their barriers (tariffs and non-tariff barriers), exporting British goods and services to the EU27 becomes more expensive and thereby decreases the nominal income. Overall, the reduction in nominal income dominates. Still, no other scenario is more endurable for the UK than this one, even though the EU27 increase their barriers. The effects for the remaining EU members do not substantially differ from the hard Brexit scenario.
In a next step, we decompose the hard Brexit scenario to identify the key components of the overall welfare effects; see Fig. 3a for the UK and Fig. 3b for the EU27. 27 We distinguish between the effects of (a) fiscal transfers, (b) tariffs on agriculture, and (c) tariffs on manufacturing, (d) NTBs on agriculture, (e) NTBs on manufacturing, and (f) NTBs on services. 28 Ending net fiscal transfers has direct effects on real consumption, but it also affects countries' terms-of-trade; see the famous debate about the German transfer problem between Keynes (1929) and Ohlin (1929). In Keynes's logic, transfers worsen the terms of trade (TOT) since exports would have to increase and imports to decrease so that the price for exported relative to imported goods would have to fall. Transfers, thus, impose an additional burden on the paying countries. As shown in Table 9, UK net transfers to the EU27 amounted to an average of about 6.5 billion Euro in the 2010-2014 period or slightly more than 0.30% of GDP. Figure 3a shows that unwinding those transfers would allow UK consumers to increase real consumption by 0.29%, slightly less than the pure transfers themselves. In line with Keynes (1929), the UK benefits from an end to transfers not only from a direct effect but also from an amelioration of its TOT, even though this gain is extremely small. Regarding the remaining EU27 members, we assume that the end of UK transfers is borne by all countries proportionally to their GDP. This amounts to an average reduction of net transfers by 0.06% of GDP. Not surprisingly, the real consumption losses from such a scenario are indeed centered around 0.06%; losses in Ireland or Luxembourg, the Netherlands, or Germany are increased by adverse movements in TOT: these countries seem to benefit from the system of EU transfers as this drives up the relative demand for their exports. Figure 3a, b also show that the reintroduction of agricultural tariffs yields a very small positive consumption effect in the UK; the UK benefits as the negative allocation effects are outweighed by positive TOT effects. Tariffs are at least partly absorbed by the UK's trading partners while agricultural tariff income remains in the country. A similar picture emerges in manufacturing. However, gains and losses on real consumption from reintroducing tariffs are very minor, as tariff income is rebated and welfare damages are always of a "triangular" form. Table 5 reports changes in bilateral trade flows in our four scenarios for the EU27, the UK and the rest of the world (ROW). Sectors are aggregated into three broad categories: agriculture, manufacturing, and service. Bold face characters denote mean effects that are statistically different from zero. 29 Trade flows are impacted by changes in bilateral trade costs and by general equilibrium forces through changes in total expenditure and revenue, and by multilateral resistance terms. Note that we keep the trade surplus of countries relative to GDP constant; quite mechanically, this forces some additional asymmetry in the rates of change in trade flows even if trade cost shocks are very similar.

Effects on bilateral trade
Our analysis implies that EU27 exports to the UK would fall by 27% in the hard Brexit scenario (S1), with 90% of the probability mass lying in the interval [-30, -25]. Exports would fall by 29% in the global Britain scenario (S3). With a FTA (S2), exports would fall by an expected effect of 4%, but the associated confidence interval is large: [-9, 1]. So, if the EU27 and the UK sign an ambitious FTA, it is no longer certain that trade will actually fall. Interestingly, this does not apply to services transactions, where we report a statistically significant expected drop of 8%. In all other scenarios, EU27 exports to the UK would contract in all sectors, with the largest effects expected in manufacturing. In the hard but smart Brexit scenario (S4), the UK offers a liberal market access for exporters from the EU27 and the RoW. Hence, EU27 exports to the UK fall by only 9%, and thereby decrease by less than half compared to a hard Brexit.
Overall, we find that UK exports to the EU27 fall by 25% in S1 and S3, which is 3 to 4 percentage points less than what is expected to happen to EU27 exports to the UK. However, the difference is not statistically distinguishable from zero. UK manufacturing exports suffer most; in agriculture, effects are not significant, reflecting the lack of trade cost reductions in this area. Services exports of the UK fall by about 21% in S1 and S3; with a FTA, they drop by 7% only, but trade effects in other sectors are indistinguishable from zero. With a hard but smart Brexit, it is not surprising that UK's exports towards the EU27 would also decrease by -18%, as the market access to the EU27 is simulated similarly to a hard Brexit, where tariff and non-tariff barriers against the UK exist.
EU27 exports to RoW increase by about 1% in S1 and S3, signaling the presence of some trade diversion. Interestingly, exports from one EU27 member to the other barely change; and if they do, the sign is negative. It appears that the increased trade costs with the UK lead to an overall reduction of intra-EU27 trade flows along 29 Tables 14, 15 and 16 in the Appendix provide details.

3
Quantifying Brexit: from ex post to ex ante using structural… the highly-integrated EU production networks. Similarly, the model does not predict that UK exports to the RoW go up from Brexit scenarios S1 and S2, as increased trade costs with Europe reduce the UK's competitiveness with third countries. Of course, in the context of global Britain, UK exports to third countries would go up quite substantially and slightly less with a hard but smart Brexit; in manufacturing, the increase can be expected to be about 15% in S3 and 10% in S4; exports of third countries to the UK are expected to go up by much more with an FTA. Again, this reflects the lack of evidence for strong trade creating effects of FTAs with third countries for the UK.

Effects on overall trade
Next, we turn to the effect on overall trade in Table 6. We show baseline trade levels for 2014, where the UK features a small deficit in goods and services trade, while the EU27 has a substantial surplus of 780 bn USD. Across all scenarios, overall UK exports and imports drop; compared to the change in GDP, trade falls by more such that the openness of the UK economy (measured as total trade over GDP) drops quite substantially. With a hard Brexit (S1), the reduction in both exports and imports is strongest in manufacturing, but UK services imports drop substantially as well, as domestic output is increasingly absorbed by domestic rather than foreign demand. Total EU27 exports fall by 1.43% and total imports by 1.75%; manufacturing exports fall the most; while the import side is dominated by services. Trade effects for the RoW are relatively low yet statistically significant and typically positive.
With a FTA (S2), trade losses for all parties are strongly reduced, but they remain about five times as large for the UK as compared to the EU27, and the effects are mostly not statistically significant. As expected, UK trade losses fall by about two thirds under global Britain (S3) compared to a hard Brexit, while they increase slightly for the EU27. RoW can expect a small and statistically significant increase in its overall trade, most pronounced in manufacturing. With a hard but smart Brexit, the UK's overall exports still decrease by 4%, but this is almost solely driven by the decrease of exports in services.

3
Quantifying Brexit: from ex post to ex ante using structural…

Table 6
Changes in Overall Trade The baseline year is 2014. Bold characters indicate significance at the 10%-level based on 1000 replications. Confidence intervals can be retrieved from sectors, but it is generally more important for complex manufacturing goods than for raw materials or services. We show the changes in sectoral value added for the UK and the EU27 average in Table 7. 30 Sectoral value added is affected by a price and a quantity effect. Brexit changes the wage rate by the same in all sectors (roughly by the same effect as GDP per capita; see Table 18 in the Appendix), and it reallocates labor between sectors. For the UK, for example, sectors whose value added falls by less than 3.37% under a hard Brexit (S1) experience an increase in employment, while sectors whose value added falls by more see their employment shrink. Within manufacturing, the largest sectors for the UK in terms of value added are food, beverages and tobacco, mining and quarrying (includes oil and gas extraction), machinery and equipment, fabricated metals, pharmaceuticals, and motor vehicles, with 47, 43, 32, 28, 22, and 21 bn USD value added, respectively. Amongst these, mining and quarrying and machinery and equipment are expected to lose most with a hard Brexit (-8% and -7%, respectively). The other mentioned sectors feature changes that are not statistically significant; the food sector even is expected to expand as higher trade costs force the UK to move into this comparative disadvantaged sector. The same is true for crops and animals. The largest percentage loss is expected in basic metals (-17%) and fishing and aquaculture (-16%), but initial value added positions in these sectors are relatively small.
Value added changes from a FTA (S2) differ from those in S1 in sign, size and statistical significance, because the structure of trade cost savings available under the FTA may deviate from those obtained in the EU Single Market. Nonetheless, the overall picture remains: Brexit drives the UK into the agri-food sectors and out of manufacturing sectors, such as basic metals. Note, however, that changes are statistically insignificant for many UK sectors in S2. Global Britain (S3) yields sectoral value added gains where trade cost reductions with third countries are expected. This is the case in transportation, for example, but not in chemicals or pharmaceuticals, where reductions in NTBs are usually harder to realize. The expansion of agri-food remains, as historical experience does not suggest significant trade costs savings from FTAs with third countries in these sectors. UK textiles is expected to shed employment as import competition goes up. Compared to the other three scenarios, a hard but smart Brexit (S4) leads to stronger sectoral divergences. The liberalization of the agrifood sector puts pressure on British farmers, while effects in the manufacturing industry are quite heterogeneous. The value added increases in sectors that import a large amounts of intermediate products and simultaneously export only few final goods (i.e. pharmaceuticals, chemicals, machinery, and electronics). The explanation is simple: the intermediate product imports are cheaper than before.
Turning to services, the largest losses from a hard Brexit (S1) in the UK are expected in wholesale trade (-8%), a sector that generates value added worth 88 bn USD in 2014; legal and accounting and business services, both quantitatively important sectors, also have to expect sizable losses of 2% and 3%, respectively.

3
Quantifying Brexit: from ex post to ex ante using structural…  Interestingly, financial services are not affected in a statistically significant way. The reason is the combination of two effects: First, the ex post analysis of trade integration does not suggest large trade cost savings in the first place; Second, the UK has a strong comparative advantage over its competitors. This is less true for publishing and media services, two sectors with smaller quantitative importance which would lose about 2% of their value added. With a hard but smart Brexit (S4), the services sectors lose more compared to manufacturing and agriculture, as potential tariff reductions are not relevant for services. In the EU27, sectoral value added effects are generally less pronounced. One sector worth pointing out is motor vehicles, where losses of about 2% are to be expected, as the relatively high EU tariffs of 10% kick in and strongly affect the tight production network between the EU27 and the UK. With global Britain (S3), the loss increases as EU firms face tougher competition from third country suppliers in the UK. In contrast, if the EU and the UK strike a FTA (S2), losses for the EU car industry disappear. With a unilateral reduction of UK tariffs, losses from a hard Brexit in the automotive industry are reduced by half under a hard but smart Brexit (S4).
The baseline year is 2014. Bold characters indicate significance at the 10%-level based on 1000 replications. Full results and initial value added per sector in 2014 are provided in Tables 19, 20, 21, and 22 in the Appendix  Quantifying Brexit: from ex post to ex ante using structural…

Discussion
Finally, we compare the results of the different Brexit scenarios with the existing literature. Bisciari (2019) and Emerson et al. (2017) provide detailed summaries of all relevant Brexit papers. All papers include a soft and a hard Brexit scenario, which we will use as base for the comparison. Most of the Brexit studies examined a "hard" WTO scenario, which is closest to our WTO scenario, namely no deal between the UK and EU27. The second scenario is the soft Brexit, which implies a deep trade agreement between the two trading regions, UK and EU27. Overall, Brexit implies negative effects for the EU, as well as the UK. Similar to our study, the macroeconomic losses are higher for the UK than for the EU27-aggregate. The rational behind such results is that EU27 is a crucial trading partner for UK and relatively less crucial for the EU27 in total. The country-specific Brexit outcomes depend on the underlying methodology. Other differences across the studies stem from the data used, the severity of the trade shocks (tariff and non-tariff barrier changes) and specifications other key parameters such as the trade cost elasticity [see Dhingra et al. (2017), the OECD study by Kierzenkowski et al. (2016); Rojas-Romagosa (2016); Booth et al. (2015) and Treasury (2016)]. Overall, our results are in line with the literature. Depending on the described parameters, the losses vary across the other studies. Especially the range of the losses for the UK vary more than for the EU27. Our results lie in the average of both ranges. The welfare changes of the EU27 lie in the average of the different outcomes across all studies. Similar to our study, the geographic proximity and intensity of the trade relationship with the UK drive the negative effects.

Robustness
Finally, we analyze the robustness of our findings with regard to the choice of trade elasticities. We focus on changes in real consumption for the hard Brexit scenario. Results are summarized in Table 24 in the Appendix.
First, even though our calculated services elasticities are in line with the above discussed literature on services elasticities, we now rely on elasticities of a value of five as assumed in Caliendo and Parro (2015) and Costinot and Rodriguez-Clare

3
Quantifying Brexit: from ex post to ex ante using structural… (2014). Overall, we find that real consumption losses are slightly smaller due to the down weighting of trade cost changes in services. We need to keep in mind that services sectors are extremely important for the UK, hence, assuming a much higher trade elasticity might strongly affect results. For a hard Brexit, losses are 5.4 times smaller compared to the baseline in Table 4 for the most extreme case (Luxembourg) with its very strong reliance on services sectors. Other EU27 countries experience losses that are two to three times smaller compared to the baseline. The UK  ***, **, * denote significance at the 1%, 5%, 10% levels, respectively. All models estimated use Poisson Pseudo Maximum Likelihood (PPML) methods. Robust standard errors (not reported) allow for clustering at the country-pair level. Pair as well as year specific importer and exporter fixed effects included but not reported. Sectors marked with • report estimates based on tariff adjusted imports, applying overall trade elasticities for goods trade from Table (1) column (5) 1 3 Quantifying Brexit: from ex post to ex ante using structural…  1 3 ***, **, * denote significance at the 1%, 5%, 10% levels, respectively. All models estimated use Poisson Pseudo Maximum Likelihood (PPML) methods. Robust standard errors (not reported) allow for clustering at the country-pair level. Pair as well as year specific importer and exporter fixed effects included but not reported. For services sectors, we calculate the trade elasticity for services according to Egger et al. (2012)   Quantifying Brexit: from ex post to ex ante using structural…

Table 12
Change in real consumption of welfare decomposition (S1), in % Quantifying Brexit: from ex post to ex ante using structural…

Table 13
Change in real consumption of welfare decomposition (S1), continued, in %  faces losses of -1.17% of real consumption, which is 2.4 times smaller than in the baseline of -2.76%. Second, we apply sectoral elasticities estimated by Caliendo and Parro (2015) (see Table 23 in the Appendix). To be empirically consistent, we re-estimate our sector-level gravity equations constraining to equal the external estimate and backing out new NTB changes. We find that countries lose less from a hard Brexit comparing magnitudes to the baseline. In relative terms, EU27 countries real consumption losses are doubled compared to the baseline. On the contrary, the UK loses 0.8 times more (-3.27% compared to -2.76%). Note, that 10% confidence intervals in the baseline are [-3.32, -2.19] and [-3.95, -2.59] for the UK, such that the slightly higher losses are still close to the range of our baseline estimates.
While the magnitudes of real consumption changes vary slightly with the choice of elasticities, the ranking of countries does not vary much. Countries with the highest losses in the baseline and both robustness checks are Ireland, the UK, Malta, Luxembourg and the Netherlands. EU27 countries with the lowest losses are Greece, Romania, Austria, Croatia. Germany varies between rank 11 and 15, while France switches between rank 17 and 19. Hence, we are confident that our baseline results represent reasonable estimates for the changing trade policy environment with Brexit.

Conclusion
In this paper, we conduct an ex ante analysis of trade and welfare effects of Brexit based on an econometric ex post assessment of EU integration and other trade agreements. We quantify the economic consequences of Brexit through a quantitative trade theory framework and isolate the role of EU membership for the UK in three distinct ways: first, we allow for directional treatment heterogeneity in the The baseline year is 2014. Bold characters indicate significance at the 10%-level based on 1000 replications and an approximate normal distribution. Confidence intervals in square brackets. Domestic trade is not taken into account

3
Quantifying Brexit: from ex post to ex ante using structural…

3
The baseline year is 2014. Bold characters indicate significance at the 10%-level based on 1000 replications and an approximate normal distribution

3
Quantifying Brexit: from ex post to ex ante using structural…

Table 18
Changes in real wage, in % The baseline year is 2014. Bold characters indicate significance at the 10%-level based on 1000 replications and an approximate normal distribution. Confidence intervals in square brackets. Counterfactual analysis based on NTB estimations from Table 10 and Table 11 in the Appendix Table 18 (continued) Quantifying Brexit: from ex post to ex ante using structural…

Table 19
Changes of UK's sectoral value added of agricultural and manufacturing goods, in % initial VA Change of sectoral value added in % in mn USD S1 S2 S3

8.30
The baseline year is 2014. Bold characters indicate significance at the 10%-level based on 1000 replications and an approximate normal distribution. Confidence intervals in square brackets  relation between the UK and EU27 economies; second, we distinguish different steps of European integration that affect tariffs and iceberg trade costs separately to model trade cost shocks. Third, we consider fiscal transfers within the EU, which affect the terms-of-trade of countries, and their role in the economic costs of Brexit. The analysis is based on the integration of parameter calibration and scenario definition based on the estimation of sector-level gravity equations. It allows for simulating confidence intervals for all endogenous variables. This makes an important component of uncertainty surrounding our results visible. Interestingly, in most cases, the confidence intervals are rather narrow.
In the partial equilibrium gravity analysis, we find that the EU and trade agreements have been very successful in reducing trade costs and boosting trade between its members, but effects turn out to be directional, in particular, with respect to the UK. We make use of the treatment heterogeneity identified at the finer sectoral level and of the model structure to back out the trade cost effects of European integration steps for the counterfactual general equilibrium analysis. Allowing for treatment heterogeneity in the ex post analysis turns out relevant quantitatively for the overall economic costs of Brexit and its distribution between the UK and the other European countries. Neglecting the asymmetry in EU-UK relations overestimates the costs from Brexit up to 40%.
We simulate real consumption, gross and value added trade changes for four different scenarios. While we find a lot of heterogeneity across the 43 geographical countries and the RoW component, a general pattern persists. Both, the UK and EU27 countries lose welfare in any of the assumed Brexit scenarios. Some small EU27 countries with very close trade ties to the UK, such as Ireland, Luxembourg, and Malta, lose even more than the UK itself. Overall, conducting new trade agreements outside of the EU cannot fully compensate the losses suffered from Brexit for the UK, while EU27 countries lose even more in this scenario due to trade diversion. A comprehensive trade agreement between the EU and the UK would definitely be preferred. But in the light of the staggering process around such a new and comprehensive trade agreement, we offer an alternative hard but smart Brexit-where besides falling back to WTO rules, the UK eliminates all existing tariffs against the remaining EU27 members and the RoW countries. For the UK, this generates the smallest losses, while the EU27 at least loose less than under a hard Brexit. Still, a lot of potential exists in trade relations between the UK and the remaining EU countries.
Overall, our paper is probably the most ambitious amongst the existing studies on Brexit in mapping out the trade effects. But it does not feature labor or capital mobility. Needless to say, a careful analysis of these facets of European integration would be important but faces both modeling and data-related issues. Brexit underlines the urgency for additional research in these areas.
Even though it will take some time until a full ex post evaluation of Brexit can be undertaken, with the conclusion of a comprehensive Trade and Cooperation Agreement provisionally in force since 1 January 2021, the EU and the UK have opened a new chapter in their relations and lay ground for future trade cooperation. Several

3
Quantifying Brexit: from ex post to ex ante using structural… The baseline year is 2014. Bold characters indicate significance at the 10%-level based on 1000 replications and an approximate normal distribution. Confidence intervals in square brackets

3
Quantifying Brexit: from ex post to ex ante using structural…

3
Quantifying Brexit: from ex post to ex ante using structural…

Details on data and results
The baseline year is 2014. Mean effects and [p5, p95] intervals. Bold characters indicate significance at the 10%-level based on 1000 bootstrap replications. Confidence intervals in square brackets. The results for EU27 and ROW are calculated as GDP weighted averages. Caliendo and Parro (2015) results use elasticities from Table 23 and tariff adjusted imports in all goods sectors in the underlying gravity estimations to back out NTB changes  Funding Open Access funding enabled and organized by Projekt DEAL.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http:// creat iveco mmons. org/ licen ses/ by/4. 0/.