Firm Dynamics and Residual Inequality in Open Economies

Increasing wage inequality between similar workers plays an important role for overall inequality trends in industrialized societies. To analyze this pattern, we incorporate directed labor market search into a dynamic model of international trade with heterogeneous firms and homogeneous workers. Wage inequality across and within firms results from their different hiring needs along their life cycles and the convexity of their adjustment costs. The interaction between wage posting and firm growth explains some recent empirical regularities on firm and labor market dynamics. Fitting the model to capture key features obtained from German linked employer-employee data, we investigate how falling trade costs and institutional reforms interact in shaping labor market outcomes. Focusing on the period 1996-2007, we find that neither trade nor key features of the Hartz labor market reforms account for the sharp increase in residual inequality observed in the data. By contrast, inequality is highly responsive to the increase in product market competition triggered by domestic regulatory reform.


Introduction
Economic inequality has been on the rise in many industrialized countries. According to a recent OECD study, since the mid-1980s, inequality increased in 17 out of 22 OECD member states for which data are available (OECD, 2011). This trend has been particularly pronounced in post unification Germany: measured by the standard deviation of log wages in Western Germany, inequality has increased by about 60% from 1975 to 2007. Most of the adjustment has taken place after formerly communist Middle and Eastern European countries signed free trade agreements with the EU, the so called Europe Agreements, leading to a remarkable increase in German exports. In the same period, Germany undertook substantial reforms aimed at deregulating its product and labor markets. The conjunction of these changes makes it difficult to assess their relative contributions to the increase in wage dispersion.
Trade economists have long studied the relationship between inequality and trade liberalization. Traditionally, they have stressed changes in the relative returns to education and/or capital. However, these explanations, epitomized by the Stolper-Samuelson theorem, cannot explain why the bulk of the overall increase in wage inequality is due to higher wage dispersion within narrowly defined skill classes, occupations, or industries. 1 In Germany, at most 11 percent of total wage inequality is attributable to observed worker characteristics, while plant characteristics are much more important, either directly or through their interactions with unobserved worker effects (Card et al., 2013). Moreover, since classical trade theory features perfectly competitive markets, it cannot be used to analyze many labor and product market reforms.
In order to address these shortcomings, we propose a theoretical model of trade with frictional labor market that generates wage dispersion among similar workers. Then, we calibrate the model to German data and provide a quantitative assessment of the role of trade and institutional changes in explaining the recent evolution of inequality in Germany. The model integrates Kaas and Kircher's (2013) theory of directed labor market search into a general equilibrium trade model where firms enjoy different levels of productivity (Melitz, 2003) and commit to wage contracts. 2 Directed search and convex adjustment costs link the cross-sectional distributions of firm growth rates, firm sizes and wages for homogeneous workers. The model replicates a 1 See, e.g., Fuchs et al. (2011) or Card et al. (2012) for Germany; Violante et al. (2011) for the US; Jappelli and Pistaferri (2011) for Italy; Blundell and Etheridge (2011) for the UK. Evidence for emerging countries is provided by Helpman et al. (2012) for Brazil; or by Xing and Li (2011) for China. 2 Kaas and Kircher (2013) extend Moen's (1997) seminal model to an environment where firms employ multiple workers. In related work, Garibaldi and Moen (2010) characterize a directed search model with convex vacancy costs and on-the-job search. new stylized fact according to which firms grow by filling their vacancies faster, and proposes an explanation for this correlation: large firms fill their vacancies at a higher rate by making them more attractive, that is by offering higher wages. 3 Hence, wage dispersion can be understand as a by-product of firms' growth processes.
We devise our dynamic model in a continuous time setup. At each instant, existing firms and matches are destroyed at an exogenous rate, while new firms and matches come into existence.
Due to convex adjustment costs, firms find it optimal to add employment gradually. More productive firms have higher optimal sizes and, thus, grow faster than less productive firms.
These different adjustment needs translate into different wage policies: with convex vacancy posting costs, firms undertaking larger adjustments find it optimal to offer higher wages in order to attract more applicants, which enables them to reduce their total recruitment costs. Since revenue functions are concave, adjustment is fast in early states but flattens out as time goes by.
This generates wage dispersion within firms because workers hired at earlier stages of a firm's life cycle are offered contracts with higher present values.
We show that hiring schedules are governed by non-linear second order ordinary differential equations. In general, they cannot be solved analytically and the equilibrium has to be characterized numerically. 4 This is why we also analyze a one-period version of the model. Despite remaining complications arising from frictional unemployment, convex adjustment costs and trade, the simplified model admits a closed form solution which nests Melitz (2003) as the limit case without search frictions. The model generates a positive correlation between wages and firm productivity. It features only highly productive firms in the export market and replicates the export-wage premium.
The relationship between trade and inequality is bell-shaped. Liberalization increases wage inequality when trade costs are so high that only a small fraction of firms export, but reduces it when a large fraction of firms already engages in export sales. Relative to the case of autarky, however, inequality is always higher with trade. The model also predicts that trade liberalization increases the real wages of all workers as well as the expected real wage ('welfare'). By contrast, unemployment may increase if the adjustment cost function is highly convex. In this case, firms wishing to expand to service foreign markets resort to very aggressive hiring policies that guarantee high job filling probabilities but lead to low job finding rates.
Besides providing a theory of wage dispersion consistent with the wage-size and the growth-size premiums, our model also accounts for other important stylized facts. First, there is mounting evidence that workers direct their search and firms commit to wage contracts (e.g. Hall and Krueger, 2012). Second, the empirical productivity distributions of exporters and non-exporters overlap substantially, even in narrowly defined industries; an empirical regularity that is at odds with the standard Melitz (2003) model. 5 In our model, there is always a measure of young but productive firms that would at some point in their lifetime become exporters but have not yet reached the required critical size. Third, and in contrast with random search models, our framework generates within-firm wage dispersion, an important contributor to overall equality. 6 We calibrate the dynamic model to German data, using firm and worker information from the linked employer-employee data set provided by the Institute for Labor Market Research (the so called LIAB data set). We fit the model parameters to salient statistics for the year 1996.
Using this calibration, we carry out a number of comparative statics exercises to illustrate the model mechanisms and evaluate the effects of recent trade, product and labor market reforms in Germany.
First, we feed the model with the change in German trade shares between the ratification of the Europe Agreements with Eastern European countries, approximately the year 1996, and 2007. The resulting change in wage dispersion allows us to assess whether and to which extent the model is able to produce the increase in residual inequality observed in the data in the period [1996][1997][1998][1999][2000][2001][2002][2003][2004][2005][2006][2007]. Second, we analyze the effect of the reduction in unemployment benefits associated with observed labor market reforms. Finally, in the last two decades Germany has implemented reforms to liberalize the product market. OECD estimates show a substantial reduction of their product market regulation intensity index for Germany, which between 1998 and 2008 declined by approximately one third (Woelfl et al., 2009). We relate this deregulation of the product market to changes in entry costs and demand elasticity. Our quantitative exercise shows that neither trade nor the reduction in unemployment benefits can account for the large increase in residual wage dispersion observed in the data. Instead, product market deregulation modeled by a reduction in profit margins of firms reproduces most of the observed changes in inequality.
Related literature. Our paper contributes to a growing strand of research on the interactions between trade and residual inequality. This emerging literature investigates how changes in the distribution of firm revenues brought about by trade liberalization map into changes in 5 See for example, Roberts and Tybout (1997), Benard et al. (2003). 6 Akerman et al. (2013) have recently highlighted the role of within firm dispersion. the distribution of individual wages of observationally identical workers. 7 One strand of the literature combines the Melitz (2003) model with fair or efficiency wages. Egger and Kreickemeier (2009) and Amiti and Davis (2012) assume that more productive firms must pay 'fair' wages linked to productivity or operating profits; else, workers do not exert efforts. Davis and Harrigan (2012) present a trade model in which firms pay efficiency wages to induce worker effort. Firms with higher labor productivity pay higher wages if they possess an inferior monitoring technology.
Our model is more closely related to the strand of research introducing search-and-matching frictions in Melitz's (2003) framework. 8 Coşar et al. (2011) set up a model with heterogeneous firms, random search, and convex adjustment costs to obtain a positive link between wages and firm size. 9 Since the model features random search, firms grow by posting more vacancies and not by recruiting faster, as recent empirical evidence suggests. Moreover, wages of all workers fall when firms close the gap separating them from their optimal size, thus a unique wage is paid to all workers within a firm. Replacing random with directed search and on the spot bargaining by wage contracts allows us to reproduce the firm dynamics and within-firm inequality observed in the data.
Another closely related paper is the one by  who use a random search model with two-sided heterogeneity and assortative matching. Workers have different abilities that can be detected through a costly screening process. As more productive firms can put ability to better use, they invest more in screening, hire more able workers, and pay higher wages. International trade strengthens this mechanism. The key difference between the two models is that we present a theory of wage dispersion based on firm characteristics only, whereas wage inequality in  is produced by assortative matching between unobserved workers' abilities and firms. 10 Recently, Card et al. (2013) have used German social security data to show that assortative matching and firm characteristics account for up 7 Another literature focuses on the role of trade in affecting the skill premium in representative firms economies (e.g., Acemoglu, 2003;and Epifani and Gancia, 2008), and in models of firm heterogeneity (e.g., Yeaple, 2005;Harrigan and Reshef, 2012) 8 The papers by  and Felbermayr et al. (2011) combine heterogeneous firms under monopolistic competition with random search, wage bargaining and linear adjustment costs. In this models, the job rent associated to the marginal worker does not depend on the size of the firm, and so there is no wage dispersion. 9 Holzner and Larch (2011) assume convex adjustment costs in a Melitz (2003) type model with on-the-job search. Fajgelbaum (2012) proposes a similar model to study the role of labor market imperfections on firms' growth and export behavior. He does not analyze wage dispersion, the key object of interest in the present work. 10 A further difference between the two papers is that since  work with random search in a static model, they cannot match the key stylized facts of firms and labor market dynamics discussed above. Ritter (2012) proposes a numerical model of directed search with two-sided heterogeneity and multiple sectors. While a recent paper by Grossman et al. (2013) characterizes how heterogenous workers and "managers "are sorted across and within sectors.
to 16% and up to 21% of the overall dispersion of wages, respectively. Hence, our papers offer two complementary theories of wage dispersion; each accounting for a source of inequality that proves to be substantial in the data.
A number of papers have started bringing these models to the data. Helpman et al. (2012) structurally estimate the  model on Brazilian data; Egger et al. (2013) apply a fair wage model to data from France and Balkan countries; Amiti and Davis (2011) provide reduced form evidence for their model from Indonesian data. All these papers find that trade has a non-negligible impact on the distribution of wages. By contrast, Cosar et al. (2011) take their model to the Colombian data and do not find quantitatively important effects of trade on inequality. Similarly, our quantitative analysis suggests that trade was not decisive in shaping German wage dispersion in recent decades. Interestingly, a common feature distinguishing Cosar et al. (2011) and our paper from the rest of the literature, is the use of a dynamic model economy where smooth firm growth, due to convex adjustment costs, tames the response of wages to trade liberalization.
Our paper is the first to provide a structural analysis of the role of trade and institutional reforms for the recent evolution of wage dispersion in Germany. 11 In doing so, we complement the reduced-form econometric analysis by Dustman et al. (2008) and Card et al. (2013).
Two interesting papers by Launov and Waelde (2013) and Krebs and Sheffel (2013) provide a quantitative analysis of the so called Hartz IV reforms. However, they focus on unemployment and not on wage dispersion. Finally, we are not aware of any other empirical or quantitative assessment of the effects of product market deregulation on inequality in Germany.
Outline of the paper. The remainder of the paper is organized as follow. Section 2 lays out the baseline dynamic model with firm adjustment and forward-looking worker behavior.
Section 3 develops a simple one-period model and presents analytical results on the effect of trade liberalization. Section 4 provides a set of stylized facts on the evolution of inequality, trade, and institutions in Germany in recent decades. Section 5 uses this facts to calibrate the dynamic model and explores its properties numerically. The quantitative analysis assesses the role of trade and institutional reforms in shaping the recent dynamics of German wage inequality.
Section 6 concludes. Technical details are relegated to an Appendix. 11 Baumgarten (2012) provides reduced-form evidence on the role of trade for wage dispersion in Germany based on linked employer-employee data.

Model
We propose a continuous time framework that brings together the Melitz (2003) trade model with the directed search approach of Kaas and Kircher (2013). Trade between two symmetric countries is subject to variable and fixed costs, while the labor market is characterized by search-and-matching frictions and convex adjustment costs. Workers are homogenous but firms are heterogenous with respect to their productivity.

Model setup
Final output producers. Consumer preferences are linear over a single final output good Y that is produced, under perfect competition, according to an aggregate CES production function where the measure of the set Ω is the mass M of available varieties of intermediate inputs, ω denotes such an input, y (ω) is the quantity of the input used, and σ is the elasticity of substitution across varieties. The term M −1/(σ−1) neutralizes the scale effect due to love of variety otherwise present in CES aggregator functions. The price index dual to (1) is given by and is used as the numeraire, i.e., P = 1. Then aggregate income is simply equal to Y. With these assumptions, demand for an intermediate good ω is given by the isoelastic inverse demand function Intermediate input producers. Producers of intermediate goods operate under monopolistic competition. Payment of an entry fee of f E /(r + δ) allow firms to draw their time-invariant productivity levels z (ω) from a sampling distribution with c.d.f. G (z). Productivity remains constant over a firm's lifetime, but employment a (ω) is a function of firm age a. Output is given by a linear production function Due to monopolistic competition, each firm produces a unique variety; the dependence of z and optimal on ω is understood and suppressed in the present section.
Firms need to pay a flow fixed cost f in order to operate domestically and another flow fixed cost f X > f if they are present on the export market. Each unit of production shipped abroad is subject to an iceberg-type variable trade cost τ ≥ 1. As will be shown later, due to the presence of fixed market access costs in equilibrium only firms with sufficiently high productivity levels z ≥ z * D find it profitable to operate, and only the most productive firms featuring z ≥ z * X > z * D will also decide to export.
Revenues from exporting are p X y X /τ and producers face the same demand (3) for domestic and foreign sales. Thus prices and quantities in the domestic and foreign markets satisfy: p X (z) = τ p D (z) and y X (z) = τ 1−σ y D (z). Total revenues are therefore given by where I a is an indicator function that takes value 1 when the firms serves the foreign market and 0 otherwise.

Directed job search.
Labor is the only factor of production. Transactions in the labor market are segmented over a continuum of submarkets, each indexed by its ratio of open vacancies to job seekers θ = V (θ) /S (θ). 12 The matching function in each submarket features constant returns to scale. Thus, if we let q (θ) denote the vacancy filling rate (with ∂q (θ) /∂θ < 0), θq (θ) is the rate of finding a job (with ∂ [q (θ) θ] /∂θ > 0). We use η −q (θ) θ/q (θ) to denote the constant elasticity of the filling rate with respect to θ.
Firms are destroyed at the time-invariant Poisson rate δ. Workers and firms separate at the natural attrition rate χ. Both δ and χ are treated as exogenous. New firms are continuously created. They differ with respect to their innate productivity levels but start their lives equally small. They grow smoothly over time due the presence of convex adjustment costs, with growth rates depending on productivity. This leads to a cross-section of firms whose employment levels depend on both age and productivity.
We assume that search is directed and that firms have the ability to commit. They post contracts which stipulate wage rates w for any point in time at which the firm operates. Since workers are risk neutral, they do not have preferences over the timing of payments as long as they yield the same discounted sum. Thus we simplify matters by considering that workers are offered a constant income stream. This choice of wage profile is also without loss of generality from the firm's standpoint: it does not affect its optimization problem because promised wages are sunk and, as such, do not affect future decisions. By committing to a wage, firms decide in which submarket θ they want to recruit and how many vacancies they want to create. Workers have information about each submarket prior to their search and use it to select the submarket in which they apply. Hence conditions across submarkets must be such that workers are indifferent.
It is convenient to derive first the reservation wage as well as the indifference condition relating wages across submarkets. Workers' asset values satisfy the following conditions where the interest rate is denoted by r and unemployment benefits (the value of leisure) by b.
The flow value of employment is rE (w). By definition, the reservation wage w r is such that Substituting E (w) out of the above system and using w r = rU , we obtain The variable ρ denotes the premium commended by workers over the flow value b of being unemployed. The expression can be rearranged so as to define the indifference condition for workers across submarkets w (θ) = w r + ρ (r + δ + χ) /θq(θ). 13 The condition above shows the positive relationship between wages and the vacancy filling rate typical of directed search models (e.g., Moen, 1997;Acemoglu and Shimer, 1999). Conversely, wages and the job finding rate are negatively related: workers search in submarkets with low wages only if they have a higher probability to find a job. As wages approach the value of leisure, the gains derived from being employed vanish and so the arrival rate of jobs diverges to infinity.
13 The identity follows from

Firm policies
Consider a firm of age a. Its value Π depends on two state variables: the current level of employment a and the cumulated wage bill W a a 0 e −χ(a−s) q(θ s )v s w (θ s ) ds. Firms face the adjustment cost function C (v) , which is an increasing and strictly positive function of the number of vacancies posted. 14 They solve the following problem: The firm chooses the labor market segment θ s in which it wishes to recruit, and the mass of v s new vacancies to be created at age s. It also makes an export decision, i.e., it sets the export dummy I s to either zero or one. The firm's problem is subject to three constraints. The first constraint (equation (7)) represents the law of motion of firm size: vacancies are filled at the rate q (θ s ) and jobs are destroyed at the attrition rate χ. Equation (8) describes the law of motion of the cumulated wage bill: at each instant, random separation shocks lower the wage bill by the amount χW s , while new hires q(θ s )v s , who are paid the wage w (θ s ) , add to the total wage bill. Equation (9) is a reformulation of the indifference condition (6) derived above.
As explained before, the cumulated wage bill W does not affect future decisions because it is sunk. Expected profits can therefore be decomposed as follows which allows us to write the value of the firm as the solution of the following Hamilton-Jacobi-Bellman (HJB) equation (10) 14 Kaas and Kircher (2013) consider a more general recruitment cost function that may also depend on the size of the firm. Given that this extension does not fundamentally modify the model's prediction, we choose the most tractable specification.
Eliminating the terms including W and replacing the law of motions (7) and (8) yields Recruitment policy. The policy functions are derived by maximizing the simplified Bellman equation (11). Remember that, in each period, a firm chooses the tightness of the submarket in which it recruits along with the number of vacancies. The first order condition with respect to v reads Quite intuitively, the expected marginal cost of hiring an additional worker, should be equal to the worker's shadow value, ∂G ( a ; z) /∂ a , minus the discounted wage bill, Maximizing the objective function with respect to θ yields By varying θ, the firm affects the vacancy filling rate and thus the extent to which it can benefit from the shadow value of a filled vacancy. At the same time, changing θ also changes expected wage costs, both because a different choice of labor market segment θ requires the posting of a different wage and because variation in the job fill rate implies variation in the likelihood that the posted wage actually needs to be paid. In equilibrium, the two marginal effects must be identical. Combining (12) and (13), we obtain where η denotes the elasticity of the matching function. 15 The relationship between θ a and v a does not depend on the export status I a whose endogenous determination we relegate to a later stage of the analysis. The sign of the relationship is determined by the curvature of the recruitment costs function. When vacancy costs are convex, i.e., C (v a ) > 0, firms wishing to post more vacancies search in labor markets characterized by 15 More precisely, we know from (6) that higher tightness (lower θ a ). Since wages are decreasing in market tightness, we can conclude that firms with larger adjustment needs (higher v a ) pay higher wages. Thus, if vacancy costs are convex, the model replicates the positive empirical correlation between firm growth and wages paid to new hires. This result is intuitive: given that recruitment costs increase over-proportionately, firms that wish to hire a lot of workers find it profitable to post higher wages in order to raise their job filling rates. 16 Proposition 1 (Wage-Size Link) If recruitment costs are strictly convex, firms wishing to expand employment faster post higher wages. If, additionally, recruitment costs are isoelastic, firms with larger steady state employment levels create more vacancies and post higher wages.
These effects are bigger, the greater the degree of convexity. Conversely, if recruitment costs are strictly concave, faster growing and larger firms post lower wages.
In order to capture the well documented correlation between firm size and wages, we will hereafter restrict our attention to convex cost functions. The empirical literature supports this assumption. Direct empirical evidence is provided by Merz and Yashiv (2007), who estimate a structural model using US data and show that both labor and capital adjustment costs are strongly convex. Similarly Manning (2006) using UK data finds evidence of convex labor adjustment costs. These findings provide indirect support to the convexity assumption. 17 Davis et al. (2013) find that US firms grow through a smooth process and that faster growing firms fill their vacancies quicker; thus providing evidence for the firm growth process produced by our directed search model.
Export status. The decision to export depends not only on the productivity, but also on the size (and, thus, on the age) of the firm. Young productive firms start small but gradually build up their work force until exporting a share of their output covers the fixed foreign market entry 16 In the knife-edge case where adjustment costs are linear, i.e., C (va) = 0, there is no link between the number of vacancies that a firm wishes to post and the labor market it selects. Since different labor markets are characterized by different wages through (6), there would also not be any wage dispersion.
17 Shimer (2010) proposes a theoretical microfundation of convexity in labor adjustment costs. With concave revenues functions, the opportunity cost of reallocating workers from production tasks to recruitment tasks is convex in the size of the adjustment.
costs. They choose the exporting status that maximizes current revenues net of fixed costs, The solution to this problem implies that there exists a size threshold X (z) , which makes firms indifferent between exporting and not exporting, so that firms featuring a (z) > X (z) will be exporters. Forward-looking future exporters build up employment before they reach the age a X (z) inf {a : I a (z) = 1} at which they enter the foreign market. Optimal hiring ensures that employment grows smoothly over time. In particular, recruitment intensity does not jump when a firm starts exporting. By contrast, the share of domestic sales in total sales falls discretely at age a X to make room for exports. Note that the critical size X (z) is lower the higher the firm's innate productivity level z is. As we will see below, firms with higher productivity have higher employment growth rates at all ages. This means that they start exporting earlier than less efficient firms. The term in the brackets measures the cost of entering the foreign market relative to its effective size (adjusted for variable trade costs τ ). The larger that size and the smaller the fixed cost f X , the lower the threshold. In a multi-country world, our specification would imply staggered export market entry: firms would enter the market with the lowest ratio of fixed costs over effective foreign market size first, and then gradually enter markets with higher ratios (see Holzner and Larch, 2011). The property of our model, that export status is a function of productivity z and age a, is in line with evidence. In particular, it rationalizes the overlap in the productivity distribution of exporters and non-exporters observed in the data (e.g. Roberts and Tybout, 1997;Bernard et al., 2003). 18 Dynamic conditions. We now derive the dynamic conditions governing the evolution of firm size. The following parametric assumptions provide tractability: Assumption 1 Vacancy costs are isoelastic, C (v) = v α , with α > 1.
18 For an alternative explanation based on the presence of firm-level uncertainty see Impullitti et al. (2013).
Solving the HJB equation (11), we obtain the equilibrium employment path and the dynamics of firm size and wage distribution.
Proposition 2 (Firm Employment Growth) Under Assumptions 1 and 2, the optimal employment schedule of any given firm satisfies The optimal solution to (17) is pinned down by the boundary conditions (i) 0 = 0, and (ii) lim a→∞ a (z) =¯ (z) with 19 The boundary condition for firms that eventually become exporters is given by the smooth pasting Proof. See Appendix A.1.
According to (18), marginal revenues R 1 (·) converge to a limit that is higher than the reservation wage w r . This is because workers have a positive turnover rate and so need to be replaced through costly recruitment. This drives a wedge between the opportunity cost of employment and the productivity of the marginal worker. As expected, the gap disappears when the attrition rate is χ = 0. In the absence of quits, firms converge to the same optimal level of employment that would obtain in a frictionless world.
Equation (18) also shows that more productive firms converge to larger sizes (since R 1 (.) is increasing in z). Moreover, firms that will end up being exporters have larger size conditional on age than non exporters. Hence, while the firm size distribution is continuous in firm age a, it exhibits a discontinuity in the productivity space, as firms with z ≥ z * X will be larger at all ages. Ceteris paribus, asymptotic firm sizes are lower the higher the value of unemployment benefits, or the less efficient the matching process. 20 Finally, firms converge to larger sizes the bigger σ is, since this reduces monopoly power. 21 19 A solution always exists and is unique since the LHS is increasing in¯ and has function values in (0, ∞), while the RHS is decreasing and takes values in [−wrη/ρ (r + δ + χ) , ∞). 20 Remember that wr = b + ρ, while low A implies low ξ 0 . 21 To see this, note that the elasticity of the revenue function with respect to z is given by 1 − 1/σ.
To characterize the equilibrium wage policy for each firm, notice that the equilibrium job finding rate θq(θ) can be expressed as ˙ a (z) + χ a (z) /ξ 0 −ξ 1 . 22 Then, the worker indifference condition (9) implies By equation (7), this expression shows that search frictions lead to a markup of wages above the reservation wage and that this markup is proportional to the adjustment needs of a firm since q a (z) v a (z) =˙ a (z) + χ a (z). With χ = 0, wages would converge to w r . Equation (19) displays a growth and a size premium. A higher efficiency of the search technology lowers those premia, as higher A implies high ξ 0 . A higher degree of convexity α in the adjustment cost function leads to a higher value of ξ 1 and makes wages more responsive to firms' adjustment needs. The higher the effective discount rate r + δ + χ, the higher the premium as firms find it even more worthwhile to post higher wages to fill vacancies faster. International trade affects the distribution of wages by affecting the distribution of firm-level adjustment needs. As we will see below, lower trade costs lead to a more skewed distribution of firm sizes and growth rates, thereby altering the distribution of˙ a (z) + χ a (z) and hence that of wages.
Note that (19) describes wages of workers hired at a firm of age a. However, the firm employs workers hired throughout its history, possibly at different wages. This generates within-firm wage inequality: as adjustment needs change over time so do wages paid to new hires.

General Equilibrium
Having characterized firms' policies, we now close the model. We need to determine the equilibrium productivity cutoffs z * D and z * X , along with aggregate output and the unemployment rate. Recalling that new firms draw their productivity from the distribution G (z), the equilibrium density of the productivity distribution is µ (z) ] for all z ≥ z * D ; and the ex-ante probability of becoming an exporter is given by where employment a (z) of a firm of age a and productivity z is consistent with the optimality conditions described in Proposition 2. 23 In order to shorten the expression, we have left the exporting decision implicit in (20). Average output Y /M is a shifter of the revenue function (5), and thus a key equilibrium object driving firm behavior.
In contrast to Melitz (2003) model (or to the one-period model discussed below), profits are not log-linear in productivity. Thus, the usual result that the two cutoffs z * X and z * D are multiples of each other does not hold anymore. Instead, we have to directly compute revenues and verify that the zero cutoff profit (ZCP) conditions, which ensure that the marginal domestic or exporting firms exactly break even, are satisfied. The same holds for the free entry (FE) condition which ensures that entry of new firms occurs until expected profits are exactly identical to the entry costs f E /(r + δ).
For given recruitment policies, discounted profits are easily computed reinserting equations (11) and (12) into the definition of Π (·) to obtain where a X (z) inf {a : I a (z) = 1} is the age at which firm z enters the foreign market. 24 Equation (21) enables us to solve for the domestic cutoff z * D : The zero cutoff profit condition (ZCP) reads Π (0, 0; z * D ) = 0 : startups have zero employment and thus no promised wage, i.e., 0 = W 0 = 0. In turn, the export productivity cutoff z * x is determined by the condition, z * X = inf z :¯ (z) ≥ X (z) , according to which the marginal exporter is the least productive firm reaching the export threshold size X (z) shown in (16). The free entry condition is satisfied Assuming an inelastic aggregate labor supply S = 1, we obtain the equilibrium mass of firm-23 The expression for aggregate employment takes into account that firm are destroyed each period at the Poisson rate δ.
24 When the firm always remains a domestic producer, ax = +∞ and the last term in (21) vanishes.
s M . Once we know M we can compute the aggregate employment in the economy L = a (z)δe −δa da µ(z)dz and obtain the unemployment rate U = S/(S + L).

A One-Period Variant of the Model
We have seen above that the effect of international trade on the distribution of wages is driven by the distribution of firms' hiring needs. With convex adjustment costs, firms smooth adjustment over time. Thus, for a quantitative assessment of the link between trade and inequality, a dynamic perspective is crucial. However, the general equilibrium mechanisms of the model can be illustrated in a very transparent manner using a framework in which firm adjustment happens within one single period. Such an environment enables easy aggregation and allows a closedform characterizations of general equilibrium objects that, in the fully dynamic specification, can only be solved for numerically.

The firm problem
Besides assuming that firms adjust within one period, the other deviations from the setup of Section 2 is to set the value of leisure to zero, b = 0. 25 The timing is such that at the beginning of the periods all workers look for a job. Search is as described in the previous section. Thus, at the end of the period, a fraction θq (θ) of workers in a given submarket is employed and produces output. There is no discounting within the period. The expected wage income of a job seeker in market θ is given by W = θq (θ) w (θ) so that we obtain the indifference condition which is the counterpart of (9). As in the dynamic model, wages are a negative function of tightness as workers trade off a higher employment probability against a lower wage.
Firms post vacancies and wages at the beginning of the period; they fill the share q (θ) of the announced jobs, and their end of period employment is = q (θ) v. Firm revenues are again given by (5). Inserting the worker indifference condition and substituting for , the problem of the firm reads The first-order condition with respect to v yields R 1 (·) q(θ) = W/θ + C (v) ,where R 1 (·) denotes the first derivative of the revenue function with respect to employment . Firms choose the 25 Given that there is only one period, the firm and job destruction rates are by definition equal to 0.
number of vacancies such that expected marginal revenues are equalized to marginal wage costs and marginal recruitment costs. The first order condition with respect to θ yields R 1 [·] q (θ) = −W/θ 2 . The second condition reflects the optimal trade-off between a higher likelihood to fill a job and the additional wage costs associated to it. Together these first order conditions imply which is identical to condition (14) in the dynamic model (with W being replaced by ρ = w r − b). 26 Firms posting more vacancies choose lower levels of θ (i.e., higher market tightness) and therefore post higher wages. Since = q (θ) v, larger firms pay higher wages. Hence, the microfundation of wage dispersion is the same as in the general model. Next, we characterize the distributions of wages and employment formally.

Distribution of wages, employment, and profits across firms
Keeping Assumptions 1 and replacing Assumption 2 by q(θ) = min Aθ −η , 1 with η ∈ (0, 1), we now characterize the distributions of wages, employment and profits. 27 We relate variables across submarkets with the help of a representative firm.
Definition 1 (Representative Firm) Letz denote the productivity level such that a nonexporting firm charges the domestic price p D (z) = 1.
Notice that a firm with productivityz can actually be an exporter. Hence, the associated variables˜ ,θ and profitsπ are just constructs which are not necessarily observed in equilibrium.
We will alternatively refer toz as the productivity of the representative firm or average productivity. We can now characterize the cross-sectional distribution of employment and tightness.
For this purpose we write the optimal values of the endogenous variables θ and v as functions of productivities z and the yet to be determined endogenous variables W andz.
26 Taking the ratio of the two first order conditions yields which, given our functional assumptions, is equivalent to (25) . 27 The minimum operator ensures that the job finding probability cannot exceed one. We will focus on equilibria where θq (θ) < 1 in all submarkets because it is straightforward to extend our results to cases where the minimum constraint binds.

Proposition 3 (Firm-level Variables)
For a given value of search W and average productivityz, the equilibrium locus θ (z) reads where β > 0 and ζ < 0 are combinations of parameters described in the Appendix. The number of vacancies v (z) is found by using (26) in (25), employment (z) follows from (z) = Since the exponent of z in (26) is negative, firms with a higher productivity recruit in tighter markets (lower θ) and post higher wages. Furthermore, more productive firms post more vacancies and employ more workers in equilibrium. A higher productivity of the representative firm (z) shifts the θ (z) locus up, thereby leading to higher wages for all z.
Our main object of interest is the wage distribution. Replacing the results in Proposition 3 into (23) and taking logarithms, 28 we obtain the wage schedule Since β < σ − 1, log-wages are increasing in log-productivity at the firm-level. The elasticity of wages with respect to z is constant and equal to 1 − β/ (σ − 1) . That elasticity is declining in α, the degree of convexity of the adjustment cost function. In the absence of search frictions, η = 1, or with linear adjustment costs, α = 1, we have β = σ − 1. The wage schedule collapses to ln w (z) = ln ([σ − 1] /σ) + lnz and wage dispersion disappears.
The wage schedule has two other components. First, when the efficiency of the representative firmz increases, the labor market becomes more competitive, and all firms must pay higher wages. Second, in order to serve the export market, exporting firms are required to reach a higher equilibrium size. In this economy, firms grow to a larger size by posting higher wages.
This is the source of the export wage premium.
We conclude this section with a Lemma which establishes that, as in Melitz (2003), firm-level profits are log-linear in z. 28 We have made use of Lemma 1 (Profits) For given aggregates W andz, operating profits are log-linear in z as where the constants K > 0 and γ > 0 are derived in the Appendix. The productivityz of the representative firm is given bỹ Proof. See Appendix A.4.

Equilibrium
We are now ready to close the model by characterizing the equilibrium values of z * D ,z, W . The log-linearity of operating profits turns out to be an extremely helpful property since it enables tractable aggregation. Taking the ratio of operating profits of firm z and of firmz yields where we suppress the dependence of π on W , writeπ = π (z) , and remember that we have definedz such that I (z) = 0.
Domestic and export market entry. Evaluating condition (30) for the marginal domestic producer z * D yields the zero cutoff profit condition (ZCP) where we account for the dependence ofz on z * D through (29). In the absence of search frictions, we would have β = σ−1 and our ZCP would be identical to that in Melitz (2003). By contrast, in our model there is no ZCP for exporters. Convexity of recruitment costs implies that total profits are not given by a linear sum of profits on the domestic and foreign markets. Instead, we have to use an indifference condition between the two possibilities, i.e., π (z * X , I = 0) = π (z * X , I = 1) . Using this in (30), we obtain (π (z * X ) one can view the indifferent firm z * X as serving the domestic market only. Then condition (30) leads to the following proportionality relationship π (z * enables us to rewrite the indifference condition as In other words, we only need to know z * D to determine z * X . The two cutoffs are positively related in equilibrium and, as one might expect, the productivity premium of the marginal exporter z * X /z * D is increasing in export fixed costs f X relative to domestic fixed costs f , and in the iceberg trade factor τ . As for the ZCP above, if we eliminate search frictions, equation (32) linking the domestic and foreign cutoffs becomes identical to that in Melitz (2003). 29 Free entry condition. Whereas market entry decisions are made ex post, the free entry condition ensures that entry occurs until expected profits are exactly identical to the entry costs . In Appendix A.5, we show how expected profits E [π (z)] and profits of the representative firmπ are connected (equation (64)). This allows us to write the following free entry (FE) condition, Note that the FE condition differs from the one in Melitz (2003) in that it depends on z * D directly as well as through z * X .
Product market equilibrium. Using the ZCP condition and the free entry condition (33), we can now determine product market equilibrium in (π, z * D ) −space.
Proposition 4 (Equilibrium) If f X < f E and σ > 1 + α, the ZCP condition (31) and the free entry (F E) condition (33) uniquely determine the domestic cutoff z * D . The export cutoff z * X follows from (32) and the productivity of the representative firmz from (29). Product market equilibrium {z * D , z * X ,z} is independent from aggregate labor market variables such as the value of search W or the distribution of θ.
Proof. See Appendix A.6. Figure 1 illustrates the product market equilibrium at the intersection of the two solid curves. The conditions for existence, f X < f E and σ > 1 + α, are similar to those found in other 29 In the absence of labor market frictions or convex adjustment costs ( i.e., η = 1 or α = 1, which both imply applications of the Melitz (2003) model when adjustment costs are linear (i.e., when α = 1). 30 Interestingly, while aggregate labor market variables such asθ or W shift the representative firm's profit levelπ, they do not appear on the right-hand-sides of (31) or (33). Thus, as stated in Proposition 4, the equilibrium productivity cutoffs are not affected by labor market variables.
This separability property relies on the log-linearity of operating profits established in Lemma 1. Hence, it does not hold in the dynamic model where profits are not log-linear. 31 Separability greatly simplifies the analysis since cutoff and representative productivities can be derived in a similar fashion than in the standard Melitz model, that is, by solely considering product market parameters. This does not mean, however, that firms' characteristics are independent from labor market outcomes. First, the equilibrium locus for θ (z) will determine the relationship between productivity and firm size. Second, the mass of operating firms is pinned down by the labor market clearing condition to which we turn next. The assumption that σ > 1 + α (or σ > 2 with linear adjustment costs) makes sure that the variance of the revenue distribution is finite.
31 Separability also obtains in the random search model by Felbermayr et al. (2011). in the ZCP condition (31) , one obtains Given that γ and β are positive, 32 an increase in the productivity of the marginal domestic producer and/or of the representative firm shifts the value of search up. Quite intuitively, as firms become more efficient, the zero cutoff profit and free entry conditions are reestablished through an increase in labor costs.
Mass of firms. The segment of the labor market on which a firm with productivity z recruits is populated by a mass s (z) = (z) / [θ (z) q (θ (z))] of searchers. Labor market equilibrium must make sure that the distribution of searchers over submarkets aggregates up to total labor supply. Normalizing the latter to unity, we therefore have is the mass of domestic firms. Using expressions for (z) and θ (z) derived in Proposition 3, we obtain the equilibrium mass of firms as (35) Employment. The final equilibrium object of interest is the aggregate level of employment L, which is found by integrating over producers: We can express equilibrium employment as a function of z * D andθ, as shown by the next proposition.
Proposition 5 (Employment) The equilibrium level of employment L is given by wherez is a weighted average of productivity levels constructed asz (equation (29)), but with Proof. See Appendix A.8.
The expression for L consists of two components. The first one,θq θ , is the job finding of tightness. Equation (36) shows that this composition effect is captured by the ratio of two different weighted means for z.

The effects of trade liberalization
We now investigate the effects of lower iceberg trade costs τ on wage inequality, employment, and welfare. In order to obtain results in closed form, we follow the literature and assume that firms draw their productivity from a Pareto distribution so that Productivity effects. In a first step, with the help of Figure 1, we analyze the effect on the productivity of the representative firm,z. Under the conditions stated in Proposition 4, the FE locus shifts down. The position of the ZPC curve, in turn, depends on the ambiguous effect of τ on the productivity of the representative firm as defined in (29).
Proposition 6 (Selection) Under the Pareto assumption, and if f X > f, trade liberalization has an unambiguously positive effect on the domestic cutoff z * D , and, through (29), onz.
The condition for an upward shift of the ZCP curve, f X > f , is the same as in Felbermayr et al. (2011). Trade liberalization expands the market size of productive firms who can take advantage from easier access to the foreign market. It also hurts less productive firms, whose revenues may fall due to increased competition by efficient foreign competitors. As a consequence, less efficient firms shut down, while more efficient firms expand, as shown in Figure 1. In line with Melitz (2003), this selection effect drives up the productivityz of the representative firm as long as the additional output share lost in iceberg costs does not outweigh the productivity gains at the factory gate.
Effects on profits and welfare. The reallocation of labor towards more efficient firms increases the value of search (our measure of welfare). This is easily established considering the ZCP condition π (z * D ;z, W ) = 0. Equation (28) implies that π (z * D ) is strictly decreasing in W and strictly increasing in bothz and z * D . Since a reduction in τ raises the productivity of the representative and marginal firms, W has to increase until the ZCP is satisfied again. Hence, trade liberalization mandates an increase in workers' average welfare.
Substituting W from (34) into the profit function (28), we find Profits of non-exporters decline compared to the pre-liberalization outcome; more precisely, the slope of the profit schedule in z becomes flatter as z * D increases. This is due to increased wage costs. Exporters are also hurt by higher W, but they benefit directly from lower trade costs, which works towards making the slope of π steeper for them, thereby increasing their profits. As in Melitz (2003), the latter effect is strong enough to ensure that z * X decreases. Consequently, trade liberalization makes the distribution of profits more unequal. 33 Effects on wage dispersion and employment The following proposition summarizes the effects of trade liberalization on key labor market outcomes. ii. lowers unemployment if adjustment costs are not too convex.
Since lowering τ increasesz, the wage profile (27) suggests that all wages rise with trade liberalization. Moreover, lowering τ has a direct positive effect on the exporter wage premium.
If either all firms export (i.e., I (z) = 1 for all z), or no firm exports (i.e., I (z) = 0 for all z), then which is lower than the expression shown in (39). Clearly, the term var ln 1 + I(z)τ 1−σ increases with the share of exporters when that share is low, but decreases when the share of exporters is high. Hence, for intermediate levels of openness wage dispersion is maximized. Intuitively, the presence of the export premium generates an inverted U-shape relationship between inequality and trade. When trade costs are prohibitively high nobody exports, therefore nobody pays the export wage premium. As trade costs fall, some firms start exporting and paying the export premium, thereby increasing wage dispersion. 33 Note that in our model the distribution of wages does not follow the distribution of profits. While some continuing firms see their profits fall, they nonetheless pay higher wages.
With the assumption of Pareto distributed productivity, we can derive the equilibrium wage distribution in closed form. As shown in Appendix A.9, the aggregate wage distribution is given by where φ L D /L X , and the distributions g w X (w) and g w D (w) of wages among exporters and non-exporters are Pareto with the same shape κ ω and different location parameters w(z * X ) and w(z * D ), respectively. Hence the wage distribution is piecewise Pareto, with weights determined by the employment share of exporters. It is a well established result that for Pareto distributions all commonly used inequality measures (e.g. Theil index or Gini coefficient) solely depend on the shape parameter. The inverted U-shape relationship between trade and the variance of wages is thus extended to most measures of inequality.
Finally, we turn to the effect of trade liberalization on employment. From equation (36) we can see that the relationship between trade and unemployment is potentially ambiguous, since it depends on two opposite forces. A negative composition effect: trade-induced selection increases the average efficiency and size of firms; in order for firms to serve a larger market they offer higher wages and a longer queue (lower θ), thus potentially increasing unemployment. A positive efficiency effect due to the increase in the value of search W : as trade increases average efficiencyz, equation (34) shows that workers' outside option W increases, thereby shifting the condition for workers to be indifferent across submarkets/firms (23). In other words, for each contract w firms need to offer a higher job finding rate θq (θ) in order to attract workers. This effect potentially reduces aggregate unemployment.
In the particular case where all firms export, the ambiguity resolves. 34 In Appendix A.11 we show that with Pareto productivity (36) becomes L =θq θ Λ ,where Λ is a constant that depends solely on the exogenous parameters of the model. 35 Hence, the composition effect disappears and, due to the efficiency effect, all firms offer a higher job finding rate when trade costs fall.
In the general case where only a subset of firms export, the composition effect is operative and the impact of trade on employment is ambiguous. Notice that, since a reduction in trade cost increases the share of exporters, the extensive margin produces an additional composition effect similar to the one discussed above. New exporters grow and serve the foreign market by 34 The results discussed below also holds in the symmetric scenario where the economy is closed and no firm export.
35 See Appendix A.11 for a derivation of Λ.
offering higher wages and longer queues. The degree of convexity of the adjustment cost function plays a key role in shaping the employment effect of trade. If α = 1, there is no dispersion of wages and queues and the composition effect disappears. Then, trade liberalization leads to lower unemployment. Higher values of α imply a stronger degree of wage dispersion across firms which in turn leads to higher dispersion of market tightness and job finding rates. The more heterogeneous firms are in terms of the queue they offer to workers the stronger is the negative composition effect of trade on jobs.
Discussion. The mechanism linking trade to inequality is similar to that in ; it is based on a composition effect due to the presence of the export premium. While sharing the same mechanism, the two papers differ in the source of the export wage premium and the type of wage dispersion they analyze. In , where workers' ability levels and firms' productivities are complements, exporters offer higher wages because they have higher returns to screening and form more productive matches. The model is static and wage dispersion results from assortative matching under two-sided heterogeneity. Without worker heterogeneity, firm characteristics do not generate any wage differentials. In our model, the source of the export premium is linked to firm growth: in order to expand and serve the export market, firms offer higher wages so as to reduce their overall adjustment costs. Wage dispersion arises exclusively from firm-level productivity heterogeneity while workers have identical ex ante and ex post characteristics. The empirical literature finds support for both assortative matching and our firm-level effects on wages (see, e.g., Card et al, 2013). Hence, the two theories complement rather than rival each other.

Germany After the Fall of the Iron Curtain
In this section we document the evolution of wage inequality, the dynamics of trade and the characteristics of product and labor market reforms observed in Germany in recent decades.
The stylized facts produced here will then be used as a guideline for the quantitative analysis that follows.

Rising wage inequality
From 1975 to today, wage inequality has increased dramatically in Germany, with a substantial acceleration around the year 1993. We use administrative worker-level data based on social security records to document these facts. More precisely, we work with a 2% random sample of the universe of employed persons under social security (i.e., excluding the self-insured  Figure 2). This is about 4/5ths of the rise in raw wage inequality in this period. Again, there is evidence for a break in the trend around the year 1993. Before that point, residual inequality was increasing at an average yearly rate of 0.0030, and after that point by about 2.5 times that rate. While less pronounced, other countries exhibit similar trends. 40 As a next step, we wish to highlight the role of firm characteristics in explaining wage inequality. We use matched employer-employee data, the so called LIAB data set. It consists of 36 German social security data covers the whole workforce subject to unemployment insurance. The data is deemed of very high quality. Wage income is censored at the annual Social Security earnings maximum. This affects at most the 14% highest incomes. We use well-established imputation algorithms to deal with this problem; see Dustmann et al. (2009) for a discussion. This paper also shows that the inequality measures obtained from these data are broadly comparable to the ones obtained from survey data. The 2% sample is known as the SIAB data base; a matched employer-employee data set is also available (LIAB data). See Appendix C.1 for details.
37 Daily wages are computed by averaging yearly wages. There is no information on hours worked so that increased inequality in working hours across workers cannot be captured. The use of log wages ensures that the inequality measure is not sensitive to the choice of units for wages. 38 A similar finding, based on variants of the same data set, is reported by Dustmann et al. (2009) and Card et al. (2013). These authors document that the overall trend and its break in the mid 90s is robust to using alternative inequality measures such as interquartile comparisons of the wage distribution. Fuchs-Schuendeln et al. (2010) confirm the findings using census and survey data. We have also looked at alternative measures of wage inequality such as Gini coefficients or interquantile comparisons and find similar results. See Table 3.
39 This is exactly identical to the specification chosen by Card et al. (2013), who work with the full population of workers rather than with the 2% sample that we use.   75 77 79 81 83 85 87 89 91 93 95 97 99 01 03 05 07 Raw inequality (std.dev. of log wages) Residual inequality (std.dev. of log wage residuals) Notes. Standard deviations of log raw daily wages for male, full-time workers in Western Germany using the 2% sample of German social security data (SIAB). Residual wages from yearly Mincer regression controlling for education and experience, including dummies for region and industry.   1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007  unobservables. For this reason, Card et al. (2013) propose a methodology that allows an exact decomposition of the overall variance of observed wages into its components: the variance of an index of worker observables, the variance of the worker effect, the variance of the plant effect, and the covariances between pairs of these objects. It is based on a regression analysis based on about 11-12 million observations per year that identifies worker and plant effects over 6 year intervals of the data. 43 They apply the decomposition to the same German social security data as used in Figure 2 (albeit to the full population rather than to the 2% sample). Table 1 shows that, in any cross-section, the variance of the person effects provides the largest contribution to the variance of individual wages, ranging between 63 and 51%. The second most important contribution to the overall variance comes from plant effects, whose relative role has increased slightly over time accounting for about 20% of the total variance. 44 The role of conventional human capital variables (education, experience), summarized in the covariate 43 The regression model is given by ln wit = αi + ψ j(i,t) + βXit + rit, where αi is a worker effect (the portable worker specific unobserved heterogeneity), ψ j(i,t) is the establishment component, Xit is an index of time-varying worker observables (consisting of an unrestricted set of year dummies, quadratic and cubic terms in age, and their interactions with six education category dummies). 44 Woodcock (2008)     Finally, we decompose the log wage variance into a within-plant and a between-plant component. 46 We do so using the LIAB data set, and report the years 1996 and 2007. We find that, in 1996, both components were of similar importance for total wage inequality; in 2007, the relative weight of the within component has decreased to about 44%. Thus, about two thirds of the total increase in inequality is due to the between component. 45 The variance components missing in Table 1 (the variance of the residual, the covariances between plant or person effects with the covariate index) make up less than 8% and do not show any significant trend. 46 We use the formula σ 2 = z pzσ 2 z + z pz (wz −w) 2 , where z indexes a firm, pz is the employment share of firm z,wz is the mean wage within a firm z, and σz is the standard deviation of wages within a firm z. Elements without firm indices refer to the full sample.

Increasing trade and institutional reform
There is an open debate as to the relative roles of labor market reform, technological change, product market deregulation, and international trade in explaining the facts described above.  After the end of communism in Middle and Eastern Europe, German firms gained access to markets in its neighborhood with more than 100 million potential consumers. Already in 1991, the European Community had signed a free trade and association agreement with Poland, followed by similar agreements with Hungary (1994), the Czech and Slovak Republics (1995), 47 Exports over GDP and imports over GDP closely track the trade openness measure depicted in Figure 4 until 2001 when, following the introduction of the Euro, Germany started to have a substantial current account surplus that reached about 7% of GDP in 2007. Romania (1995). Agreements with smaller countries followed. This led to a massive expansion of trade with these countries which is clearly evidenced by the aggregate trade share plotted in Figure 4. In 2004, ten Middle and East European countries formally joined the European Union, but trade in goods was already liberalized ten years earlier. A second boost to German trade openness occurred following China's accession to the World Trade Organization (WTO) in late 2001. The strong increase in openness is confirmed with alternative openness measures. Table   3 shows a measure of the German value added content in foreign demand over total German value added (GDP). That measure has increased by less than the overall trade share (due to the increased importance of foreign inputs in German exports). Nevertheless, the approximately 30% increase in openness registered between 1995 and 2008 still represents a substantial change. 48

Bulgaria and
The table also shows that export growth was driven by both the extensive and the intensive margin: the share of manufacturing firms that engage in exporting has risen from 18 to 28%, while the share of exports in the total sales of these firms increased from 19 to 31%. Interestingly, 48 These are the years for which the OECD provides the data.
the rise in inequality has been accompanied by a fall in the unemployment rate from close to 10% to 8.3% in 2007. The facts documented in Table 3 and in Figure 4 suggest that increased trade may have played a role in shaping the German wage distribution. However, the country has undergone important institutional changes which may have also contributed towards higher inequality.
Like many other OECD countries, Germany has substantially deregulated its product market. According to information from the OECD's product market regulation ( In order to evaluate the effects of the first three reforms, Fahr andSunde (2009) andHertweck andSigrist (2012) provide an estimation of the matching function and of its changes after the reforms. Their main result shows that the reforms, especially Hartz III, produced a substantial improvement of the efficiency of the matching process in Germany. Fahr and Sunde (2009)  reduction in the average unemployment duration of the same order of magnitude. In Figure   4 we report OECD estimates of gross unemployment replacement rates for Germany, which document a decline from a level of 29% in 2001 to 22% in 2007. 51 Hence, although Hartz IV seems to be associated with a decline in unemployment benefits, this reduction is quantitatively limited. 52 Next, we calibrate the main model laid out in section 2 to match the stylized facts documented in Table 3, and explore its properties numerically. We then use it to quantitatively asses the relative importance of international trade, labor and product market regulation for the evolution of German wage inequality described above.

Quantitative Analysis
We start by showing that the model can replicate key moments of the German economy in 1996. Then, performing a number of comparative statics exercises, we document the roles of trade liberalization, labor market reforms, and regulatory variables for residual inequality and unemployment.

Calibration to German data
We fix a number of parameters using external sources, normalize those that determine levels only, and set others to match direct empirical counterparts. We chose the values of the remaining parameters to minimize the sum of squared differences between the model's prediction and actual moments. We assume that the productivity distribution is Pareto with shape parameter κ. The algorithm for the numerical solution of the model is discussed in Appendix B.
The six externally calibrated parameters are {σ, η, δ, χ, r, b}. As usually done in the literature, we set the elasticity parameters of the demand and matching functions to σ = 4 and η = 0.5, respectively. 53 Where applicable, the estimates producing those parameter values are based on data provided by the Institute of Labour Market Research (IAB) in Germany and 51 See the data on www.oecd.org/els/social/workincentives. 52 Another important change in labor market institutions in those years is the reduction in collective bargaining coverage which followed German reunification. The German LIAB data show that about 80% of all firms were covered by industry agreements in 1996; this share declined to about 60% in 2007, with most of the decline occurring prior to 2005. We do not study this institutional change here; for an empirical analysis of the links between the fall in collective bargaining and wage inequality in Germany see Dustmann et al. (2009) andCard et al. (2013). 53 We chose σ in line with Bernard et al. (2007). Kohlbrecher et al. (2013) present estimates of η based on the SIAB data base (which contains information about unemployment spells of workers) for the period 1993 to 2007. Controlling for workforce heterogeneity, they cannot reject a constant returns to scale specification of the matching function.
are, therefore, naturally compatible with the SIAB and LIAB data bases provided by the same agency and used for other moments in our quantitative exercise. The firm and job destruction rates are taken from Fuchs and Weyh (2010). These authors use the Establishment History Panel of the IAB for the period 2000 to 2006. The data base includes all plants in Germany with at least one employee subject to social security. We use their empirical estimates to set the yearly plant exit rate δ = 5% per year, and the yearly job destruction rate due to match dissolutions χ = 7%. For the parameter b, we use the replacement rate 54 of 0.35 reported in Kohlbrecher et al. (2013). Finally, we choose a yearly interest rate of 4%. 55 Note that the link between τ and the share of revenues realized in foreign countries is particularly straightforward. Since RX = (pX qX ) /τ = pDqDτ 1−σ = RDτ 1−σ , we have RX / (RD + RX ) = τ 1−σ / 1 + τ 1−σ . 56 We report a measure of residual inequality that is attributable to establishment effects. We obtain this infor-(vi) the exporter wage premium is 10%; and (vii) the aggregate unemployment rate provided by the Federal Employment Agency is equal to 9.9% in 1996. Table 4, our model is able to replicate these moments. Moreover, the implied parameters values are fairly plausible. The ad valorem tariff equivalent of trade costs (approximately 60%), is well in line with numbers discussed in Anderson and van Wincoop (2004). The shape parameter of the Pareto distribution, κ, is close to 3.4, the value found by Bernard et al. (2007). The different types of fixed costs relate to each other as mandated by Proposition 4.

As shown in
The model is in line with three further facts that are highlighted in the recent literature and not targeted in the calibration, thus providing some external validity to our parametrization exercise. As we show below: (i) the productivity distributions of exporters and non-exporters overlap; (ii) rapidly expanding firms fill their vacancies at a faster rate; (3) within-firm wage inequality contributes to overall inequality (see Table 2).
Size distribution. Figure 5 plots the cross-sectional distribution of firm employment as a function of firm-level age and productivity. It focuses on a subset which includes the marginal producer z * D and the marginal exporter z * X . Notice that the firm size distribution exhibits a discrete jump at the productivity cutoff z * X . However, as a function of firm age, the size distribution is continuous. In our model, from the start of their existence, highly productive future exporters internalize that they will end up larger than non-exporters and they put on employment accordingly, even if they do not export yet. When they have reached the critical size (and age) of starting to export, foreign sales jump up and domestic sales fall, leaving overall sales (and employment) constant. This avoids the counterfactual prediction of the basic Melitz (2003) model where exporters and non-exporters are perfectly partitioned along the productivity dimension. Impullitti et al. (2013) use the interaction between sunk export costs and idiosyncratic uncertainty to explain the existence of highly productive non-exporters. We propose a complementary explanation based on the slow adjustment of firms to their optimal sizes.
The figure also shows that more productive firms grow faster. By equilibrium condition (14), this implies a higher vacancy filling rate. Thus directed search can explain the recent findings of Davis et al. (2013) according to which more productive firms offer higher wages and fill their vacancies faster. 57 By contrast, in models with random matching, firms achieve higher mation by multiplying the standard deviation of log raw wages by the share of variance explained by establishment effects as estimated by Card et al. (2013). Raw inequality is 0.40 log points in 1996 (see Table 3), while the share of total wage variation in 1996 is 0.205. In 2007 the estimates are 0.526 and 0.21, respectively. 57 Unfortunately, our data do not contain information on vacancies, so we cannot directly target the correlation Figure 5: Firm size as a function of productivity and age growth rates by posting more vacancies. Moreover, introducing screening in a random matching environment, as in , delivers the counterfactual prediction that high wage openings are filled through a lengthier selection process.
Wage dynamics. The equilibrium wage schedules (19) plotted in Figure 6 show that the wages of new hires fall with firm age, hence unveiling the presence of within-firm wage inequality across workers of different seniority. From Figure 5 we know that younger firms grow faster, and in our labor market with competitive search, firms foster growth by posting better compensations.
Thus workers with more seniority earn higher wages, as commonly observed in the data. Notice that within-firm inequality cannot be obtained using random search as in, e.g., Cosar et al.
(2011). In that model, firms pay their employees equally because all wages are renegotiated at every point in time and this firm-specific wage falls as the firm closes in to its desired size. The importance of within-firm wage dispersion is documented by, among others, Haltiwanger et al.
(2010) for US data and  for Brazilian data. As can be seen in Table 2, our German data confirm the presence of substantial pay differentials within firms.
between hiring wages and vacancy filling rates. Figure 6: Wages as a function of firms' productivity and age

Comparative statics
Taking our calibration as the baseline, we evaluate whether trade, labor and product market reforms can explain the changes in German labor market outcomes documented above.
Trade liberalization. We lower variable trade costs τ so as to match the increase in the share of revenues derived from exports. Since the mapping between the two variables does not depend on any other parameters aside from σ, 58 we directly infer that τ needs to decrease from 1.58 to 1.326 in order to generate the observed increase in exports share from 20 to 30 percents.
Keeping all the other parameters constant, we re-simulate the model and compare its outcome with the actual changes documented in Table 4. Trade liberalization raises the share of exporting firms by increasing the survival cutoff z * D and reducing the export cutoff z * X . It also raises the reservation wage w r . These results are in line with the selection effect of the one-period model: the expansion in market size induced by trade liberalization increases the demand for labor, thereby raising workers' outside option and forcing less competitive firms out of the market. Moreover, lower variable trade costs allow the most productive domestic firms to start exporting. Table 5 shows that the model captures qualitatively and in some case even quantitatively several changes found in the LIAB data. First, it predicts that the share of exporting firms increases substantially from the benchmark 18% to 34.5%, a slightly bigger change than that observed in the data. It also reproduces the fall in the average size of exporters because the negative composition effect, due to the decrease in the export threshold, dominates the increase in size among pre-reform exporters. This overall gain explains why average firm size adjusts in the opposite direction. Another interesting features of the comparative statics exercise is the prediction that both average wages and employment go up. The impact on unemployment is particularly significant since it decreases from 9.97% to 8.82% solely because of trade liberalization, hence reproducing the whole drop in unemployment shown in the data.
To sum-up, decreasing τ from 1.58 to 1.32 explains most of the adjustments in firm size and export status as well as in aggregate employment. However, the degree of wage dispersion as measured by the standard deviation of log-wages does not change much, registering only a negligible increase. 59 According to the one-period model, the inequality-trade nexus should be proportional to the export wage premium. Given that our calibration yields a rather small premium, in line with that found in German data, one should not be surprised that trade liberalization alone cannot reproduce the substantial increase in residual wage inequality. In Table 6 we explore a wider range of variable trade costs. The predictions of the one-period model summarized in Proposition 7 are confirmed: the relationship between variable trade costs and wage inequality is bell shaped, with the maximum very close to our 1996 baseline case.
Moreover, while inequality does change with τ , the gradient is low: even substantial variation in iceberg trade costs have very little effect on residual wage dispersion. 60 Hence, while reasonable changes in τ go a long way in explaining the observed reduction in the German unemployment from 1996 to 2007, trade appears to be of little relevance for the observed increase in residual wage dispersion. This suggests that other mechanisms, besides the inverted U-shape relationship between trade and inequality derived in the one period model, are at work in our dynamic framework. One plausible explanation is that the smooth firms' growth process, due to convex adjustment costs, attenuates the effect of trade-induced reallocations on wage dispersion. By contrast, in the one period model firms adjust immediately to the new post-liberalization optimal size, and this leads to a larger jump in the wage contract they offer.
Labor market deregulation. The first institutional change that we analyze is the reduction in unemployment benefits associated with the Hartz IV reform. The OECD estimates that the replacement rate in Germany was reduced by about 30% from 2001 to 2007, which applied to our benchmark benefit gives b = 0.25. 61 Lowering b reduces the reservation wage w r as well as the two cutoffs z * D and z * X . Intuitively, a reduction in benefits lowers the workers' outside option, making survival easier for firms and allowing marginal non-exporters to enter the foreign market.
We report in table 7 the impact that unemployment benefits have on labor market outcomes. 62 Perhaps surprisingly, b has a smaller effect than τ on unemployment, which declines by less than three quarters of a percentage point. This is in line with the results in Launov and Waelde (2013). They estimate an equilibrium matching model with spell-dependent unemployment benefits and find that the Hartz IV reform reduced unemployment by 0.7 percentage points. 63 The model also predicts that residual inequality is decreasing in b: since the low-60 Since varying the fixed export costs fX yield similar results, we do not report them for brevity. 61 The OECD summary measure is defined as the average of the gross unemployment benefit replacement rates for two earnings levels, three family situations and three durations of unemployment. For further details, see OECD (1994), The OECD Jobs Study (chapter 8) and Martin J. (1996), "Measures of Replacement Rates for the Purpose of International Comparisons: A Note", OECD Economic Studies,No,26. 62 The simulation of the Hartz IV reform has to be treated with caution because countries are symmetric in our model. This approximation is not too problematic for episodes of trade liberalization since they are generally implemented through multilateral agreements. By contrast, Germany was rather isolated in its push towards labor market deregulation, to the extent that it has sometimes been accused of promoting beggar-thy-neighbor policies.
63 In contrast to this result, a recent work by Krebs and Scheffel (2013) finds that Hartz IV reduced structural unemployment by 1.5 percentage points. er bound of the wage distribution is pinned down by the reservation wage w r , a reduction in benefits shifts the support of the wage distribution to the left thereby making it more dispersed.
Although labor market deregulation cannot affect matching efficiency, the Hartz III package of reforms focused on the Federal Employment Agency with the objective to increase the efficiency of job search. We simulate an arbitrary small increase in A, from 3.25 to 3.5. Not surprisingly, increasing matching efficiency lowers the intensity of search frictions, thereby reducing unemployment. The effect is quantitatively strong with an elasticity of unemployment to A of about −1.5. 64 But the effect on inequality is counterfactual as better matching efficiency reduces wage dispersion. Improvements in the matching technology relax the trade off between wages and job filling rates. More productive firms resort less to wage incentives in order to raise their growth rates. Hence, the reforms aimed at improving the functioning of the public employment agency can explain part of the reduction in German unemployment but not the increase in inequality. Following Blanchard and Giavazzi (2003), we posit that product market reform (encompassing trade liberalization) increase competition in the market, thereby decreasing profit margins.
One way to implement this is to experiment with an increase in the elasticity of substitution.
We simulate the effects of a small rise, from σ = 4 to σ = 4.2, which is equivalent to a decrease in markup from 33.3% to 31.2%. Table 7 shows that, in spite of its modest size, such a change has a significant impact on the economy and, in particular, on residual wage inequality. Quantitatively the effect is sizable with an elasticity of wage dispersion to σ of about 1.8. Interestingly enough, raising σ also compensates the exaggerated fall in the average size of exporters induced by τ . Both effects are intuitive. The higher σ, the steeper the mapping between productivity and optimal size, as can be seen from (18). Thus, for a given productivity distribution among new firms, the wage distribution becomes more dispersed and the sizes of exporters increase.
These adjustments imply that recruitment becomes more competitive, which intensifies search frictions and pushes up the rate of unemployment.
Similarly, one could also capture product market reforms by a reduction in the entry cost f E .
However, while such a change lowers unemployment, it has the obvious implication of lowering the average firm size -quite in contrast to the concentration process observed in the data. Also, lower f E tends to reduce residual inequality rather than increase it.
Interactions between reforms. To take stock, trade liberalization can explain a substantial share of the adjustments in employment as well as in the cross-sectional distribution of firms characteristics. However, its effect on residual inequality is rather marginal. Given that a similar conclusion holds for labor market reforms, the model singles out higher competition in domestic product markets as the main force behind the increase in residual inequality. Having determined the qualitative effects of each channel, we now assess whether their interaction can account for the changes observed in the data.
The results of these joint experiments are summarized in Table 8  Notes. Specifications are based on the benchmark calibration reported in Table 4  Specification (2) contains the result of a similar experiment but with a higher elasticity of substitution (σ = 4.8) whose value is set to reproduce the overall increase in residual wage dispersion. Raising σ also helps to fit the cross-sectional distribution of firms and, in particular, the average size of exporters. On the other hand, this parameter change raises the unemployment rate well above its actual level in 2007. This gap is partly reduced when we take into account the 20% increase in the matching efficiency documented by Hertweck and Sigrist (2012). As shown in specification (3) of Table 8

A Proofs
In the Appendix, we provide all the necessary proofs for the lemmas and propositions in the paper.

A.1 Proof of Proposition 2
The only dynamic component of the optimality conditions is ∂G ( a , I) /∂ a . Directly differentiating its expression in (11) yields where we add the number of the independent variable as a subscript to denote its partial derivative. The expression above makes clear that ∂G ( a , I) /∂ a is the shadow value of labor since it is equal to the discounted sum of marginal output. The term on the right hand side can be expressed as 66 Reinserting this equality into the previous equation, we obtain The dynamics condition is too intricate to be analyzed at this level of generality. This is why we impose the additional Assumptions A1 and A2. When recruitment costs are isoelastic, i.e., C (v) = v α , (14) is equivalent to v α−1 a = (1 − η) ρ/ (ηαθ a ) and the dynamic equation (41) reads Assumption A2 allows us to simplify this equation further by expressing analytically the slopev a of the vacancy schedule with respect to age. When the matching function is Cobb-Douglas, i.e., q(θ Reinserting (43) into (42) and using (15) to substitute w (θ a ), we finally obtain In order to solve this equation, we use the following change of variable ϑ a [θ a q(θ a )] −1 = A −1 θ η−1 a so thatθ a = (η − 1) A −1 θ η−2 aθa = 1 θ a q(θ a )θ a θ a (η − 1) .

Thus (44) is equivalent to
We wish to express (45) as an ODE in a only. Straightforward algebra yieldṡ In order to obtainθ a , we differentiate this expression with respect to timė and replace it into (45) to finally derive the law of motion (17) for employment. It obeys a highly non linear second ODE. The employment profile of any given firm can therefore be pinned down using a starting and terminal conditions. First, given that startups have no labor force, we can set 0 = 0. 67 The second condition ensures that employment converges smoothly to its optimal value in the long run, so that both˙ a and¨ a approach zero as time goes to infinity. Eliminating˙ a and¨ a from (17), we find that the asymptotic level of employment¯ (z) lim a→∞ a (z) is given by the unique solution to (18). Finally the smooth-pasting condition ensures that the labor force schedule is everywhere differentiable, including the employment level X (z) at which domestic firms start exporting. If the smooth-pasting condition were violated, there would be a kink at X (z). But this cannot be optimal because adjustment costs are convex, implying that firms could save on recruitment costs by smoothing their convergence path. 68

A.2 A closed form example
In order to find a solution to (17) that can be analytically characterized, we assume that, unlike in our specification above or in the Melitz (2003) model, marginal revenues are linear in employment. 69 Example 1 (Closed form example) Assume that marginal revenues are linear, i.e., R 1 ( ; z) = z−σ , maintain Assumptions 1 and 2, but impose χ = 0. Then the optimal choice of labor market tightness as a function of firm's age evolves according tȯ 67 When the revenues function R ( a, I) is isoelastic, as in Melitz's (2003) model, marginal revenues diverge to infinity as goes to zero. This implies that the ODE (17) admits a singularity at = 0. Yet it is well behaved for any arbitrarily small initial size. Hence, in the simulation, we follow Garibaldi and Moen (2010) and circumvent this technical difficulty by assuming that 0 = ε. Letting ε go to zero illustrates that, for sufficiently small εs, the optimal recruitment schedule is not significantly affected by the choice of ε 68 Smooth-pasting is a standard optimality condition in firm entry models, explored in details in Dixit and Pindyck (1994) and applied to entry into and exit from the export market in Impullitti, et al. (2013). 69 Assume the utility function dω. The index z enters the utility function directly, maybe because it represents product quality. Under this specification, the indirect demand schedule is linear and of the form p (ω) = 1 − σ d(ω) 2z(ω) 2 . With linear production functions y (ω) = (ω) z (ω) , revenue is given by R ( , z) = 1 − σ 2z z = z − σ 2 2 . Thus marginal revenue is as specified in the closed form example.
Proof. When marginal revenues are linear Hence, differentiating (45) with respect to time yields The ODE implies that, with a slight abuse of notation, Integrating both sides of the previous equality yieldṡ where C 0 is the constant of integration. The size of the firm must converge to its optimal long run value. This occurs when the following boundary conditions are satisfied: (i) lim a→∞ ϑ a = 0; and (ii) lim a→∞θa = 0. The second requirement holds when the constant C 0 is equal to zero.We can exclude the positive root of (48) because it generates a diverging path and thus violates the requirement according to which lim a→∞ ϑ a = 0. The solution reported in (47) is the negative root of (48) once ϑ has been replaced by its expression as a function of θ. The Ordinary Differential Equation (47) is now of the first order and, most interestingly, does not depend anymore on z. This means that if two firms with different productivity are offering a similar wage, they will recruit in identical submarkets and hire the same number of workers at any future dates. Their difference in z can only be reflected by the current employment level whose value is determined by the initial choice of submarket θ 0 . It is chosen so that firm size converges to its optimal long run valuē (z). Given that we have set the attrition rate χ equal to zero, R 1 ¯ (z) ; z = w r which implies in turn that¯ The RHS is increasing in z and so is the integral on the LHS. To see what this implies for the starting value θ 0 (z), remember that θ a increases over age: firms recruit in labor markets which are less and less tight, that is, they post lower wages, as time elapses. It follows that, as documented in the data, firms grow at a decreasing rate. When productivity z goes up, the required increase in¯ (z) is achieved through a raise in the starting value θ 0 (z). More efficient firms post higher wages and recruit more workers at every given age. A stronger degree of competition (higher σ) implies that firms converge to larger sizes, and they grow at a faster rate at every age. Proposition 1 implies that, as the firm converges towards¯ (z) , wages paid to new hires gradually decline and the average wage falls. Within-firm wage inequalitygrows as the firm adds more and more lower paid workers. This finding is, however, driven by our assumption χ = 0. With non-zero natural attrition, as in our general setup, the high earning workers from early times in the existence of the firm gradually disappear, and are replaced by workers paid wages close to the average wage. Thus, within-firm wage inequality increases in early stages of the firm's life cycle but disappears asymptotically, giving rise to a profile of wage dispersion which is hump-shaped in firm age.

A.3 Proof of Proposition 3
Equation (5) implies that marginal revenue are proportional to the domestic price which, combined with our normalization, yields Using this identity and the functional forms in Assumptions 1 and 2, one can use the first-order condition R 1 ( , I; z) q (θ) = −W/θ 2 to solve for the tightness associated toz Similarly, reinserting our functional forms into equation (25), one obtains a closed form solution for v as a function of θ We now explain how posted wages can be derived for all productivity levels. First, note that marginal revenues are related in the following fashion The second equality results from the first order condition R 1 ( , I; z) q (θ) = −W/θ 2 , which-under our parametric assumptions-simplifies to R 1 ( , I; z) = W/ ηAθ 1−η . Since = q (θ) v, one can solve for the employment levels using equation (51) and substitute them out of equation (52) to obtain where Tightness is inversely related to productivity as the exponent on the right-hand side of (53) is unambiguously negative. Observe also that the relationship depends on the export status of the firm. If a firm with productivity z decides to export, the indicator function I (z) switches from zero to one which lowers θ (z) . As expected, everything else equal, the decision to sell on the foreign market leads to an increase in optimal employment. And, to accommodate its expansion, the firm decide to post a higher wage. The equilibrium tightness is obtained plugging (50) into (53), with The exponents of both z andz in (26) are negative. To derive the exponent ofz, one replaces (50) into (53) . This yields the expression in (26) but with the following exponent forz Replacing the definitions of ζ and of β into the expression above leads to (26) . whilez We can therefore rewrite revenues as The sign of β follows from ζ < 0 and α > 1. The exponent ofz is The last equality holds because ((σ − 1) /σ) ζ (1/ (1 − α) − η) + 1 = (σ/ (σ − 1)) β. To see that γ is positive, observe that this holds true if (σ/ (σ − 1)) (1/ (1 − η)) + ζ > 0. Replacing the definition of ζ given in (54) and imposing α > 1 shows that the last inequality is indeed satisfied. Focusing now on the wage bill, we obtain Finally, turning our attention to the expression for recruitment costs, we find that Hence, adding all the terms above yields The constant K reads where K 1 is defined in equation (59) .
A.5 Derivation of the free entry condition (33) The free entry condition ensures that entry occurs until expected profits are exactly identical to the entry costs f E , hence .
Using the expression forπ from (33), one can show that, under the sufficient condition f X < f E , .
The condition is equivalent to .
Slope of zero cutoff profit condition. The ZCP is identical to the one derived by Melitz (2003) for the case of a closed economy. Totally differentiating with respect to z * D , one obtains .
where, with some slight abuse of notation, z(w) is the inverse function for w(z). To write the previous But we know from equation (32) that

B Solution algorithm
Firm dynamics. First, for given cutoffs z * D , z * x , reservation wage w r , and output per capita Y /M , we solve equation (17) characterizing the dynamics of firm size. This is a second order differential equation which we solve using a boundary value problem algorithm. Notice that since firms marginal revenues R 1 ( , I; z) depend on a firm export status I, the solution to (17) will be different for exporters and non exporters.

•
Step 1 (solving the ODE). We start with domestic firms. First we transform the second order differential equation in (17) into a system of first order differential equations in domestic firms' employment a,D (z) and˙ a,D (z) with initial condition 0,D (z) = 0. We guess an initial slope, guess =˙ 0,D (z), solve the system of first order differential equations, update guess until amax,D (z) =¯ D (z), where the optimal size of domestic firms¯ D (z) is defined in (18). The solution to this problem yields the optimal employment path a,D (z) and growth gradient at entrẏ 0,D (z). Similarly for exporting firms (17) is a system of differential equations with initial condition 0,X (z) = X (z), the export entry size derived in (16). Again, we guess an initial slope guess = 0,X (z), solve and update the guess until they reach their optimal size a max,X (z) =¯ X (z). The solution gives us the optimal employment path a,X (z) and growth gradient at entry˙ 0,X (z).

•
Step 2 (Smooth Pasting). In the previous step we have computed the employment path for exporters and non exporters separately. But exporters do not start exporting immediatly after entry, they start as domestic firms, they enter the export market only when they have reached the threshold size X (z). Hence, in order to characterize the full employment path for exporters we need to past their size path as domestic producers and as exporters, making sure that the pasting is smooth at the switching point X (z). In order to do this, we simulate the domestic optimal path again from entry until the firm reaches, if ever, the export threshold X (z). Precisely, we guess =˙ 0,D (z), solve the system (17) and iterate until firm size reaches the export threshold a,D (z) = X (z). Update the guess =˙ 0,D (z) and solve until sp 0,D (z) = arg max ˙ ax,D (z)| X (z) (˙ sp 0,D (z)) =˙ 0,X (z)| X (z) (˙ sp 0,D (z)) , where the˙ ax,D (z)| X (z) the slope of the policy function for domestic firms when they reach the export size X (z), reached at age a x (z) which different across firms. And˙ 0,X (z)| X (z) is the slope of the exporters policy function computed in step 1 evaluated at their starting point which by construction was the size threshold X (z). The smooth pasting condition guarantees that the slope of the optimal employment policy of domestic firms and that of exporters are equalized at the employment level at which domestic firms start exporting. Finally, using the optimal initial slope that satisfies (67) as a guess we can solve (17) from the entry age until the firm reaches, if productive enough, the export threshold X (z) and find the age at which each firm enters the foreign market, a x (z). The optimal employment policy of a firm can then be expressed as follows a (z) = a,D (z) for a ∈ (0, ∞) if a x (z) = ∞, a,D (z) for a ∈ (0, a x (z)) and a,X (z) for a ∈ (a x (z), ∞) if a x (z) < ∞, where a x (z) = ∞ signals that firm z never reaches the export status.
General equilibrium. For given aggregate output per firm Y /M , and using the optimal employment policy (68) we solve for the cutoffs and the reservation wages. • Step 3 (cutoffs). The domestic and export cutoffs are computed using the expression for profits in (21) the ZCP Π (0, 0; z * D ) = 0 and the export condition, z * x = inf z :¯ D (z) ≥ X (z) . • Step 4 (reservation wage). Given Y /M , and using (68) and the cutoffs computed in step 4, the free entry condition Π (0, 0; z) µ(z)dz = f E / (r + δ), allows us to pin down the value of search w r .
C Data Appendix C.1 The SIAB data base (Figure 2) The Sample of Integrated Labour Market Biographies (Stichprobe der integrierten Arbeitsmarktbiographien -SIAB) is a 2% sample of the population of the Integrated Employment Biographies (IEB) of the Institute for Employment Research (Institut für Arbeitsmarktund Berufsforschung -IAB). 70 The IEB comprises all workers in Gemany subject to social security. The major excluded groups are civil servants and self-employed. The data is process-produced from administrative sources such as the notification process by which firms are legally obliged to register workers to the Federal Employment Agency and report any changes in wage or employment structure. The current version of the SIAB contains employment histories of 1,659,024 individuals, documented in 40,501,525 data records. The SIAB comprises data reaching as far back as 1975, and it is organized by spells (worker-plant matches). Amongst other things, the data provides unique identifiers for persons and establishments (which allows the computation of plant fixed-effects), information about the gross daily pay, the occupation of the worker, socio-demographic characteristics such as year of birth, sex, citizenship, school education, and so on, basic characteristics of the employing establishment such as industry code (five digit), number of (full) employees and median gross daily pay, and so on.
Generally, the data comprised in the SIAB can be considered to be very reliable. This is particularly true for information collected not exclusively for statistical purposes: for instance, the data on remuneration are used by the German Statutory Pension Insurance to calculate pension claims. The educational variable is less reliable because an incorrect information there neither hurts the employer nor the employee. However, well-established procedures are available to cleanse the education variable to make it more accurate (Fitzenberger et al., 2006). Additional issues arise with regard to the industry classification which has changed several times; but industry classifications can be harmonized following the proposal of Card et al. (2013) at the two-digit level.
Finally, a very important issue with the data relates to the top-coding of the wage variable. Daily wages are right-censored at the maximum level on which Social Security contributions are based. Following Dustmann et al. (2009) and Card et al. (2013), we use Tobit regressions to impute wages above the cut-off level. For each year we run a separate regression using age, age squared, tenure, tenure squared, gender, foreign nationality as well as a full set of industry dummies. Missing wages are replaced by predicted values from the Tobit model.

C.2 The LIAB data base (Figure 3)
The LIAB data base is a linked employer-employee data base provided by the Institute of Labor market Research (IAB). 71 Its core is the so called IAB establishment panel, which provides plant-level information. Based on a unique establishment identifier, the IAB merges the information of the universe of socially secured employees at the plant level to the establishment data. The establishment panel is a yearly survey which includes establishments with at least one employee covered by social security. The sample is drawn following the principle of optimum stratification.These stratification cells are also used in the weighting and extrapolation of the sample. The survey is conducted by interviewers from TNS Infratest Sozialforschung. About 4300 establishments from Western Germany participate in the survey. The response rate of units that have been interviewed repeatedly is over 80%. We use the cross-sectional version of the data set for the years 1996 to 2007.
One problem with the plant-level data is its lack of representativeness. However, the IAB represents sampling weights which can be employed to reconstruct a representative sample of German plants. The plant-level information is very rich; it covers details about the plants' industrial relations, information about the structure of its work-force, and, quite important for our purposes, on total revenue and on the export share of the plant. It has information on the total wage bill and on the age of the establishment, as well as on establishment size and industry. 70 A comprehensive introduction to the SIAB data set is provided by Dorner et al. (2010). 71 A comprehensive introduction to the LIAB data set is provided by Alda et al. (2005). C.3 Aggregate data (Table 3) We report a measure of residual inequality that is attributable to establishment effects. We obtain this information by multiplying the standard deviation of log raw wages by the share of variance explained by establishment effects as estimated by Card et al. (2013). Raw inequality is 0.40 log points in 1996, while the share of total wage variation in 1996 is 0.205. In 2007 the estimates are 0.526 and 0.21, respectively.
The trade openness measure is based on a value added metric rather than on the usual ratio of gross trade over GDP. In the presence of an internationally fragmented value chain, gross exports (the value of exports at the border as declared to customs) overestimates the value added content of domestic production aimed for foreign consumption. The reason is that export of some country increasingly include foreign inputs. Similarly, a country's imports may include a non-trivial measure of its own value added. To compute the domestic value added content of exports and the foreign value added content of imports, one requires a matrix of input-output tables for the entire world. the Word Input-Output Data (WIOD) consortium has produced such matrices for the years 1995 to 2009; it is available under www.wiod.org. Details of calculations are provided by Aichele et al. (2013).
In Gemany, the outsourcing trend has been strong over the last 15 years. From 1995 to 2007, the VAX ratio (value added exports divided by gross exports) has fallen from 74 to 66%. A similar trend is observable for imports. Hence, adjusting gross data for their value added content leads to a sizeable reduction of the measured openness. Nonetheless, it remains true that openness has increased very strongly from 1996 to 2007 in Germany.