Productivity or Unexpected Demand Shocks: What Determines Firms' Investment and Exit Decisions?

We investigate the roles played by unexpected demand shocks, besides productivity, on firms' capital investment and exit decisions. We propose a practical approach to recover unexpected firm&#8208;level demand shocks using inventory data. The recognition of demand shocks and inventory also improves the productivity estimation. The empirical results indicate that although productivity and demand shocks are both significant factors determining firm behavior, the former is more dominant for investment decision and the latter is more salient for firm exit. These findings confirm that unexpected demand shocks, besides persistent productivity, are important factors when analyzing capital investment and firm exit decisions.


INTRODUCTION
The industrial organization literature suggests that intra-industry firm turnover and firm-level capital investment decisions are mostly driven by productivity alongside other deterministic factors such as age and size. Based on the theoretical foundation by Jovanovic (1982) and Hopenhayn (1992) and seminal papers of Olley and Pakes (1996, OP henceforth) in industrial organization and Melitz (2003) in international trade, most empirical studies find evidence that the revenue productivity impacts firm investment and exit behavior. In practice, however, firms face a substantial amount of transitory demand shocks in their daily operation. These shocks may come from different sources, such as transitory preference shocks or other unexpected changes that affect an individual firm's demand. The transitory demand shocks may have an impact on firm turnover and investment decisions, especially when firms face credit constraints and/or when manager/shareholders' sentiment is affected by these short-term shocks. In this article, we explore the role played by the short-term unexpected demand shocks, besides productivity, on firm turnover and investment decisions.
A major challenge is to separate the transitory demand shocks from productivity, both of which are usually unobserved in the data. The importance of separating these two factors was initially highlighted by Klette and Griliches (1996). One solution proposed in the literature is to model the demand side explicitly whenever the output prices are available, as in Foster et al. (2008), Roberts et al. (2013), and Pozzi and Schivardi (2016). These intuitive approaches, however, are not feasible if price data are not observable to the researcher, which is quite common in production data sets. Economically, the unexpected demand shocks differ from productivity, in that it is realized after a firm has chosen its inputs and output (and thus expected inventory stock) for each period, whereas productivity is observed before the inputs and output decisions. Based on this idea, in this article, we propose a practical way to solve this problem using inventory stock data. The main idea is that the within-firm deviation of inventory stock over time from the targeted level of inventory each period contains important information about demand shocks. One advantage of our method, compared with the aforementioned price-based approach, is that inventory information is usually recorded in most production data sets, such as the plant-level data from Columbian, Chilean, and Chinese manufacturing surveys. This makes our method widely applicable. Methodologically, our model is based on the classical works of Olley and Pakes (1996), Levinsohn and Petrin (2003), and Ackerberg et al. (2015). We extend their work to explicitly allow for unexpected demand shocks and inventory to play a role in firms' production, investment, and exit decisions. The roles played by inventory and demand shocks change the estimation procedure in at least two aspects. First, inventory affects firms production and investment decisions directly, as it is a source of available output to satisfy the demand. As a result, we add inventory as a state variable and it affects firms' dynamic choices. Second, the unexpected demand shocks can affect investment and exit decisions, in practice, due to reasons such as credit constraints. Hence, investment may depend on demand shocks as well besides productivity. This generates multiple unobserved variables in the investment function, and we lose the monotonicity condition, which is necessary to control for productivity using investment (or material) without controlling for inventory and the unobserved demand shocks. We solve this problem by inferring individual firms' unexpected demand shocks from the within-firm variation of inventory over time. Next, we use the recovered demand shocks in the investment policy function to control for productivity. An additional advantage of our method is that it provides a way to address the multicollinearity problem prevailing in these production models. 2 In our model, collinearity concerns are mitigated because both the inventory stock and demand shocks provide independent variation between firms' investment decisions and the labor and material choices. We estimate our model using a plant-level data set from Colombia, which has detailed information on plant-specific inventory stocks. 3 Estimation results from three representative industries (clothing, plastic products, and knitting mills) show that both productivity and demand shocks are important determinants of firm behavior, with productivity having a larger dispersion. The 90th-10th percentile productivity difference ranges from 26% to 54% in the three industries after controlling for demand shocks and inventory. The 90th-10th percentile difference for demand shocks ranges from 20% to 30% in these three industries. This implies that the demand shock accounts for a substantial variation in the consolidated productivity measure used in the literature. We also find significant heterogeneity in demand shocks for entrants, incumbents, and exiting firms, whereas variation in productivity is relatively smaller across these three groups. Continuing incumbent firms have both highest productivity and demand shocks across the three groups. Exiting firms have lowest demand shocks across the three groups, but they do not necessarily have the lowest productivity shocks. This suggests that unexpected demand shocks and credit constraints may be a more important driver of firm exit.
We estimate the firms' exit and investment decisions as implied by the theoretical model. For all industries, demand shocks have a negative and significant effect on firm exit rate. Increasing demand shock by 1% reduces exit probability on average by about 0.1-0.2 percentage points in our preferred specification in the three industries we investigated. In contrast, the impact of productivity on exit rate is smaller after controlling for demand shocks. A 1% increase in productivity reduces exit probability on average by 0.06 percentage points in clothing and 0.13 percentage points in the plastics industry. In the knitting mills industry, the effect is 2 As Ackerberg et al. (2015) and Bond and Soderbom (2005) pointed out, there is a multicollinearity problem in the Olley and Pakes (1996) first-stage estimation, because both the investment and labor choice are functions of the same variables: capital, productivity, and age. To estimate the labor/material coefficient consistently in the first stage, we need an independent variation between the labor and investment.
3 As the majority of Colombian firms are single-plant firms, we treat each plant as a decision maker, and hereafter, we will use the term plant and firm interchangeably unless otherwise explained. negative but insignificant. This suggests that firm exit is driven more by the short-term demand shocks than the productivity. A low demand shock can presumably cause financial problems such as liquidity constraints to force firms out of the market. On this point, our findings are consistent with Foster et al. (2008). For the investment decision, we find that both demand shocks and productivity are positive and significant determinants. However, the productivity effect is much stronger. For example, in the clothing industry, the investment elasticity with respect to productivity is about 5.3, in contrast to 2.8 for demand shocks. This trend is robust in the other two industries as well. This suggests that firms' capital investment is mainly driven by the persistent productivity. Overall, we conclude that firms are more likely to die accidentally (driven by unexpected shocks), but they grow in size as planned (driven by persistent productivity).
This article is related to two other lines of study. First, it is related to a large literature on the determinants of capital investment. A survey by Chirinko (1993) notes that the vast majority of literature on determinants of investment finds it to be a function of prices, output levels, and stochastic shocks. The author pointed out, "relatively little work has been done on quantifying the effect of autonomous shocks on investment." There have been some studies addressing this gap since then, most of which use aggregate data. For example, Ghosal and Loungani (1996) find a negative relationship between investment and price uncertainty (which could result from demand shocks and/or productivity shocks) at the industry level. More recently, Bloom et al. (2007) find that higher uncertainty reduces the responsiveness of investment to demand shocks. Audretsch and Elston (2002) support the role of demand factors in providing more liquidity in the investment behavior of German firms. Cooper and Ejarque (2003) study the role of financial frictions in firm investment behavior using a dynamic optimization model. Our article provides plant-level evidence that both the expected productivity and unexpected demand shocks play important roles in determining firm investment.
Second, this article relates to the extensive research on determinants of firm turnover, which has been a long-standing field of study. These studies have found market frictions, demand learning, and market size as important demand-side factors alongside supply-side productivity driving firm exit. A survey by Tybout (2000) finds that high turnover in manufacturing firms does not necessarily imply that less productive firms are driven away. He notes that market frictions are important in determining firm turnover in developing economies. Dixit and Chintagunta (2007) find that both supply and demand factors are responsible for firm exit in the airline industry. However, the authors put particular emphasis on the effect of firms' learning about the market on exit but do not account for the supply-side productivity. Similarly, Disney et al. (2003) study the role of learning in firm exit in the U.K. manufacturing industry. Asplund and Nocke (2006) study the role of market size as a determinant of firm exit. More recently, Collard-Wexler (2013) finds that smoothing of demand fluctuations has a significant impact on the firm exit decision using a dynamic oligopoly model. Our article adds to this literature by accounting for and comparing both supply-and demand-side shocks in determining firm exit.
The rest of the article is organized as follows. Section 2 constructs an econometric model to separate demand shocks from productivity. Section 3 reports the estimation results and examines basic features of the recovered demand shocks and productivity. Section 4 analyzes the roles of demand shocks and productivity on firm behavior. Section 5 tests the robustness of our results to alternative specifications. Finally, we conclude in Section 6.

THE ECONOMETRIC MODEL
We develop a dynamic model of firm production by incorporating unexpected idiosyncratic demand shocks and inventory stock into the standard framework of Olley and Pakes (1996). The extended model allows us to recover productivity and unexpected demand shocks at the firm level from observed inputs, revenue, and inventory data.
2.1.1. Production and productivity. The production function is assumed to be Cobb-Douglas, where Q jt , K jt , L jt , and M jt represent the output level, capital stock, labor, and material stocks, respectively. The parameters β k , β l , and β m are the associated factor share parameters. Firm j has a productivity level of ω 0 jt , which is structural. The production is subject to a nonstructural productivity shock jt , which is unobserved by firms at the time of production.
2.1.2. Demand. The demand function is of the standard CES type, where P jt and Q S jt are the price and demand quantity, respectively, φ jt is a demand shifter known to the firm, and z jt is a demand shock that is unexpected to the firm. η is the demand elasticity. We assume that the i.i.d. demand shocks, z jt , follows a mean zero normal distribution with standard deviation σ, z jt ∼ N(0, σ 2 ). The mean zero assumption implies that the sales prediction by a firm is not biased in either a positive or negative direction. In other words, no firm consistently underpredicts or overpredicts its demand.
2.1.3. Timing. Following the tradition, we use lower-case variables to represent the logarithm of corresponding upper-case variables, unless otherwise specified. We assume that firms observe their own capital stock (k jt ), productivity (ω 0 jt ), and beginning-of-period inventory stock (inv b jt ) in the beginning of a period and choose labor (l jt ), material (m jt ), and output prices (P jt ) to produce output (Q jt ) and maximize expected profits without observing the demand shocks. To maximize the long-term profits, the firm's optimal choice of output and prices may exceed the expected demand, naturally leading to a targeted level of inventory before the resolution of demand uncertainty. Alongside inputs, a targeted level of inventory stock (λ jt ) is determined as well as the difference between the available output and expected sales. After production, demand shocks (z jt ) and production shock ( jt ) are observed, which determine the sales and output levels and hence lead to the realization of end-of-period inventory stock (inv e jt ) and period profits (π jt ). Finally, firms choose whether to exit and their investment (i jt ) levels. 4 As a result, the unexpected demand shocks differ from productivity in that it is realized after a firm makes the optimal inputs and pricing choices for each period, whereas productivity is persistent and observed before the inputs and pricing decisions. This timing helps us in disentangling and separately identifying the productivity and demand shocks.
The timing assumption that production decisions happen before observing demand shocks captures the fact that firms usually do not have complete information about the market demand of their product when production happens (though they may have some expectation). The demand shock, z jt , represents the uncertainty firm j faces at time t when it determines how much to produce. The firm's ex ante optimal choice of output level may not be ideal after the realization of demand shocks in the sense that it may generate too much or too little inventory. Given the nonnegative inventory constraint and prices being fixed before demand shocks are observed, this may generate actual shortages too. As a result, the level of inventory stock will contain information about the demand shocks, and we can use the variation in inventory levels to help recover the demand shocks faced by individual firms.
The demand shocks, although i.i.d. drawn, have a dynamic effect on firms' future production and profitability through two channels. First, the i.i.d. demand shocks, once realized, change firms' end-of-year inventory levels, which affects firms' investment and exit decisions. Second, in practice, firms may face borrowing constraints, which usually depend on their available collateral and performance on the balance sheet, and demand shocks affect both of them. As a result, the demand shocks, like productivity, can have a dynamic impact on firms' long-run activities and performance like growth and turnover.
The introduction of demand shocks and inventory stock into the model has multifold implications. First, it brings in an important dimension of firm heterogeneity, which plays a key role in a firm's daily operation. Second, the inclusion of demand shocks and inventory stock implies that the labor and material choices are dynamic. Third, the timing assumption that the demand shocks are observed before the choice of investment but after labor and material choices provides one possible way of breaking the multicollinearity in the first stage of Olley and Pakes (1996) style estimation as criticized by Ackerberg et al. (2015).

Inventory and Demand
Shocks. The first step in our estimation procedure is to quantify demand shocks using inventory data in order to avoid explicitly solving the dynamic model with multidimensional choices. In each time period, we have the following accounting equation: where Q jt is the output level and Q S jt is the quantity sold by firm j in time period t. The above feasibility equation notes that the sum of production quantity and beginning-of-period inventories equate to the sum of sales and end-of-period inventory stock.
When firms make their production and pricing decisions, they observe a set of state variables summarized in the information set I, which includes productivity, capital stock, and beginningof-year inventory stock. But they do not observe the current year demand shocks, z jt . Given the demand function, we can decompose the quantity sold into two parts: expected sales when the firm makes the production and pricing decisions and an unexpected component (demand shocks), In order to proceed further, we need to make an assumption about the firm's inventory choice behavior. As discussed in the literature (e.g., Blanchard, 1983;Maccini and Rossana, 1984;Blinder, 1986;West, 1986;Ramey, 1991;Kahn, 1992, among many others), firms may intentionally overshoot in their production and maintain an optimal level of inventory stock for reasons like production smoothing and/or a stockout avoidance motive, in the presence of demand uncertainty. To capture this idea, we assume that each firm j at time t targets an inventory stock, λ jt , which is a fixed share of the expected sales E(Q S jt |I jt ), 5 This seems to be a reasonable assumption over the short to medium term. Note that this assumption does allow the targeted inventory level, λ jt , to depend on productivity level and other state variables. A more productive firm would have a higher targeted inventory level as compared to a less productive firm, because its expected sales are higher due to its endogenous optimal pricing decisions, everything else being equal. In the Appendix, we show that the assumption in Equation (5) is satisfied in a large class of inventory models that predict a fixed stockout rate as their optimal production and pricing strategy. Some examples include Kahn (1987Kahn ( , 1992. Kahn (1987) derives the constant stockout rate under a stricter assumption of constant marginal costs. However, it is straightforward to see that the key prediction of constant stockout probability still remains after a slight modification by allowing for more flexible production costs and a constant demand elasticity, as assumed in our article. This can be seen directly from Equation (27) in Kahn (1987).
From a firm's perspective, when it is making its production decision, the available output must equal the expected sales plus the targeted inventory stock. Hence, the optimal production output of a firm must satisfy the following equation: It is also an accounting equation in an ex ante sense, and it captures firms' optimal inventory and production decisions.
Equations (3) to (6), which are based on firms' optimal decisions as depicted in Subsection 2.1, suggest a way to recover the demand shocks. More specifically, we can insert Equation (6) into (5) to solve out the expected sales E(Q S jt |I jt ), Inserting this equation in (4) and using (3), we have, Under the assumption that the beginning-of-year inventory has the same price as the sales in that period, the above equation is equivalent to where R S jt and R jt are the values of sales and production in year t, respectively. Rinv b jt is the value of the beginning-of-period inventory at time t. This equation links the ratio of a firm's sales to the value of total available output to its inventory share, λ j , which is firm specific, and a demand shock z jt , which is transitory. The firm-specific term associated with the firms' optimal inventory share, − log(1 + λ j ), is identified from cross-firm variation of the average ratio of sales to available output value, R S jt /(R jt + Rinv b jt ). The transitory demand shocks, z jt , is identified by the within-firm variation of inventory over years.
In terms of empirical estimation, we explicitly model firms' optimal inventory share, λ j , as a function of firm characteristics. More specifically, we assume that a firm's optimal inventory share is a function of its size, ownership, and location, where thef (·) function represents the term − log(1 + λ j ) with λ j replaced by (8). We can estimate this equation directly by approximating the functionf (·) by a suitable polynomial and using data on sales, output value, beginning-of-year inventory value, firm size, ownership, and location. 6 The demand shock is the residual itself, and the optimal inventory share can be recovered from the regression function. In Section 5, we use an alternative approach, by treating the optimal inventory strategy as a firm fixed effect, to confirm that the estimation results are robust to the parametric form assumption of inventory share in Equation (8). 2.3. Zero Inventories. When demand shock is sufficiently high, the realized sales will be high enough for the firm to have zero inventories, as shown in (3). As a result, we face a truncation problem: Inventory is positive when the demand shock is below a critical value and zero when the demand shock is above this threshold value. For instance, around 7% of the observations have zero inventories in our data for the clothing industry. This truncation problem leads to two issues in the estimation of Equations (7) and (9). First, using the OLS will bias the estimate of the fixed effects term. In Equation (7), the dependent variable equals zero when inventory is zero (so that Q S jt = Q jt + inv jt−1 ), and it is negative when inventory is positive. This problem can be addressed by using a Tobit model, and λ j can be estimated consistently.
The second issue is more serious. We need the magnitude of demand shocks to estimate its prediction power in firm decisions (e.g., investment and exit). After consistently estimating the target inventory share λ j (or the parameters inf (·) in the parametric approach), we can recover the demand shocks directly for observations with positive inventory; in the presence of zero inventory, however, we are not able to recover the exact magnitude of demand shocks. In the latter case, we can still develop two useful measures containing relevant information about the magnitude of demand shocks: the conditional lower bound and conditional expectation of demand shocks.
The conditional lower bound of demand shocks is the magnitude of demand shock that exactly generates zero inventories, and it is equal to log(1 + λ j ) from Equation (7). For easy reference, we definez jt as the measure of demand shocks after replacing the demand shock by the conditional lower bound when inventory is zero, when inv e jt = 0.
Under the normal distribution assumption for demand shocks and that the inventory share, λ j , is consistently estimated, the conditional expectation of demand shocks given zero inventory is defined as follows: We denoteẑ jt as the demand shock measure after replacing it by the conditional expectation in the case of zero inventories, when inv e jt = 0.
This is a simple way to predict the underlying demand shock, which is in the spirit of Heckmanstyle correction, given the limited information in a truncated inventory data. Although conditional expectation is a more common approach in the literature to deal with a truncated distribution, the conditional lower bound of the demand shocks (z jt ) is the relevant information for many variables observed in the data, such as sales, investment, and exit decisions when the firm has zero inventory. As a result, we will use it to estimate our main results, and the conditional expectation of demand shocks (ẑ jt ) instead will be used as a robustness check in the Appendix. The relevance ofz jt in the production function estimation will be discussed in detail in the next subsection.

Demand Shocks, Inventory, and Production Estimation.
After constructing the measure of demand shock, we use a two-stage approach to estimate the firm-level productivity by extending Olley and Pakes (1996) to introduce the impact of demand shocks and inventory. We recognize that demand shocks affect firm choices-and, as a result, production estimationthrough the appearance of inventory stock and potential financial constraints.
As in many studies, we do not have output price data. In order to address the heterogeneous output price problem, we follow Griliches and Mairesse (1995) to utilize the demand structure and estimate the production function based on sales revenue. The extension in our article is that, after acknowledging demand shocks and inventory in the model, output value and sales revenue differ, and we have to deal with this difference. Given the demand function and nonnegativity of inventory, the sales revenue of firm j at time t, R S jt , can be written as Note that the demand shock is replaced byz jt in the above revenue function. The reason is that when observing zero inventory, inv e jt = 0, the realized sales quantity Q s is the cutoff demand shock at which the firm can just sell out all available outputs at the optimal prices chosen before observing the demand shocks. Given this condition and the definition of revenue function, we can derive Equation (12). Under the previously stated assumption that the sales and inventory have the same prices, we can establish the relationship between the quantity sold, Q S jt , and the production quantity, Q jt , where x jt represents the ratio of change of inventory value relative to sales revenue, x jt ≡ Rinv e jt −Rinv b jt R S jt . It adjusts the difference between the output quantity and sales quantity in the same year caused by the existence of inventory. Plugging Equations (13) and (1) into (12) yields where β * l ≡ 1+η η β l , β * m ≡ 1+η η β l , and β * k ≡ 1+η η β k . l jt , m jt , and k jt are the logarithm of corresponding inputs. ω jt ≡ 1+η η ω 0 jt − 1 η φ jt is the revenue productivity, which includes both the structural physical productivity and the demand shifter observed by firms. The i.i.d. shock * jt ≡ 1+η η jt . Comparing with the standard approach in OP and all other related works, the new terms in Equation (14), x jt andz jt , capture the impact of demand shocks and inventory. There are two sources of endogeneity problem in the above estimation equation. The first is due to the correlation between the unobserved productivity ω jt and input choices, which is commonly emphasized in the literature. The second, which is new in our article, arises from the correlation between demand shocksz jt and the ratio of inventory change to sales revenue, x jt . As we have fully recovered the adjusted demand shockz jt , we can use it to directly solve the second endogeneity problem caused by the correlation between x jt andz jt . We solve the first endogeneity problem using a control function approach following OP, using investment as a proxy for productivity.
Following OP, Doraszelski and Jaumandreu (2013), and Aw et al. (2011), the revenue productivity is assumed to follow a first-order Markov process, where ξ jt is the current period innovation in the productivity. We assume that ξ jt is i.i.d. across firms and over time. Given the timing, firm investment, i jt , depends on all state variables including productivity, capital stock, end-of-year inventory, and demand shocks. So we can control for the unobserved productivity by ω jt = ω t (i jt , k jt ,z jt , Rinv e jt ). Given our assumption, the relevant measure to determine the investment (and exit) decision is the adjusted demand shocksz jt , instead of the true demand shocks. 7 We also use the alternative demand shock measureẑ jt with the Heckman-style correction as a robustness check in Section 5, and the results are similar both qualitatively and quantitatively. In order to control for productivity, the underlying assumption in the inversion of the policy function is the monotonicity between investment and productivity, conditional on other state variables. Our approach also differs from OP in that we control for the demand shock and its resulting inventory stock when recovering the unobserved productivity. We derive the first-stage estimation equation by replacing the productivity control function in Equation (14).
If we assume labor and material to be static as is the case in OP, β l and β m can be estimated consistently in the first stage. However, after introducing inventory, labor and material are dynamic variables due to the introduction of savings in our model. Ackerberg et al. (2015) argue that the first stage of OP suffers from multicollinearity problems in this case since there is no independent variation between labor/material and investment. This collinearity problem becomes even more severe in Levinsohn and Petrin (2003), which uses intermediate inputs instead of investment to recover the unobserved productivity in the first stage. The i.i.d. demand shock affects the investment but not the labor and material choices due to its timing, and as 7 Investment is a function of the adjusted demand shocks,z jt , with conditional lower bound demand shocks for observations with zero inventory. As discussed in Subsection 2.1, the unexpected demand shocks have a dynamic impact by affecting inventory and by affecting cash flow of credit-constrained firms. The inventory is directly controlled in the investment function. For the credit constraint channel, when the demand shock is very good and the firm sells out all available output (zero inventory), it is the cutoff demand shock that is relevant to measuring the cash flow to the firm. As the demand shock is i.i.d. over time, the magnitude of the actual demand shock does not matter in the case of zero inventory. a result overcomes the collinearity problem by providing an independent variation between labor/material and ϕ(i jt , k jt ,z jt , Rinv e jt ). 8 This independent variation gives us identification for β l and β m even when labor and material choices have dynamic implications. Following a similar way of the first-stage estimation in OP, we can derivê where lnR S jt is the fitted value of ln R S jt in Equation (16). To estimate the capital coefficient, β * k , we use the Markov assumption on the productivity evolution process in the second stage,φ The last equation forms the basis of the second stage estimation, and the capital coefficient, β * k , is consistently estimated from it. Subsequently, the productivity measure can be constructed by

ESTIMATION RESULTS
This section discusses data and the estimation of productivity and demand shocks.
3.1. Data and Summary Statistics. The data used in this article are from the Colombian manufacturing census from 1977 to 1991, which were collected by the Departamento Administrativo Nacional de Estadistica (DANE). It contains detailed information about plants' domestic and imported inputs usage, output, and many other plant characteristics. We estimate the model for three industries: clothing, plastics, and knitting mills. We choose these three varied industries since they are important ones for the economy, have significant inventory shares (greater than 10%), and have sufficient observations (more than 2,000). For a detailed introduction to the data, please refer to Roberts and Tybout (1996). Table 1 shows the summary statistics for each of the three industries. Inventory share is calculated as the ratio of the end-of-year inventory value to sales at the firm level. There are four points to note here. First, inventory accounts for a large share in firms' sales. The industry average inventory-to-sales ratio ranges from 10% to 14% in the three industries. Second, given an industry, the variation of inventory share across firms is substantial. The standard deviation is more than 1.5 times that of the mean for the inventory share across industries. Figures 1 and  2 show variation in inventory stocks over time for small and large firms in the clothing industry. Third, within-firm variation contributes substantially to the observed variation of inventory in the data. It explains the total variation of inventory-to-expected-sales ratio by 48%, 27%, and 23% in clothing, plastics, and knitting mills, respectively. In Figure 3, we plot the histogram of the within-firm variation of inventory-to-sales ratio for each of the three industries. 9 This variation   across firms and time in an industry suggests that the demand shock can have a significant dispersion as well. Fourth, inventories reported are point sampled at the end of the year. This data limitation would be problematic for industries that produce perishable goods such as food products, since they cannot be stored for a longer term, and an end-of-year inventory level may not correctly reflect firm decisions. Hence, we choose industries whose products have a sufficiently long shelf life. The summary statistics for age, exit rate, capital investment, labor expenditure, capital stock, material expenditure, and sales are also reported in Table 1.

Production Function and Productivity Evolution.
The estimation results for output elasticity for each input and productivity evolution process are reported in Table 2. Capital output elasticity is around 0.1 for both plastic products and knitting mills, whereas it is 0.12 for the clothing industry. Labor output elasticity is highest in the clothing industry at 0.33 and ranges from 0.26 to 0.29 in the other two industries. Material output elasticity is highest in knitting mills at 0.59 and lowest in clothing at 0.39. 10 Productivity evolution is fairly persistent in all three 10 Note that output elasticities are same as the Cobb-Douglas shares since the model is logged. industries (0.73-0.78). In general, all three industries operate at a scale slightly smaller than the constant returns to scale (0.84-0.96).

Productivity and Demand Shocks.
A key output from production function estimation is the implied productivity distribution of firms within an industry. Given the parameter estimates, the productivity can be recovered from Equation (17). Their summary statistics are reported in Table 3. It is shown that there is a substantial amount of dispersion for productivity (in logarithm) among firms within each industry. The interquartile range is 0.26 in the clothing industry, implying that the 75th percentile firm is roughly 31% more productive than the 25th percentile firm. This number is slightly lower in the other two industries, with 0.13 in plastics and 0.15 in knitting mills. The interdecile range is 0.54 in the clothing industry, implying that the productivity for the 90th percentile firm is about 72% higher than that for the 10th percentile firm. These interdecile ranges are 0.26 and 0.30 for the other two industries, implying that the 90th percentile firm is 30% and 35% more productive than the 10th percentile firm in these two industries.
A second key output of our estimation is the distribution of demand shock within an industry. Given the parameter estimates, a measure for demand shock,z jt , can be calculated from Equation (10). Note that when inventory equals zero, we are not able to recover the true magnitude of the demand shock, and it is replaced by its conditional lower bound, which is the driver of the realized sales volume. The spread of demand shocks is also substantial within an industry, suggesting that ignoring demand shocks will cause significant mismeasurement in productivity. The interquartile range is between 0.08 and 0.13 for the three industries, and the interdecile range is between 0.20 in the plastics industry and 0.30 in the clothing industry. Both of these facts suggest a significant heterogeneity in demand shocks across firms and time, but the dispersion is lower than that for productivity. Table 4 compares the average productivity and demand shocks across entrants, incumbents, and exiting firms. 11 In all cases, incumbents have a higher mean of demand shocks and productivity distribution than that of entrants and exiting firms . This can possibly be due to a selection effect: More productive firms with favorable demand shocks tend to survive with an overall higher mean than the exiting firm. Although the mean values across the three groups may not be statistically different from each other point wise, it does provide preliminary evidence that the distribution of demand shocks and productivity across the three groups may differ, with exiting firms have the lowest distribution. Table 5 further reports the correlation coefficients between the two recovered measures, productivity and demand shocks, and firms' input and output indicators. It is shown that productivity is positively correlated with firms' input choices and sales. The correlation is especially high for sales, labor, and material choices. The correlation between capital and productivity is weaker, as it is a second-order relationship tied together by the investment decision. In contrast, the correlation between demand shocks and input choices is close to zero, as assumed in the model. However, the correlation of demand shocks with sales is positive, around 0.11-0.13 in all three industries, because demand shocks partly contribute to sales directly. A negligible correlation between demand shock and productivity suggests that separate economic forces are driving these two shocks and hence provides additional support to the assumptions made for disentangling them.
3.4. Inventory Share. We also recover firms' inventory share relative to the expected sales, λ j , while recovering demand shocks. The estimates are reported in Table 6. On average, the estimated inventory-to-expected-sales ratio is about 11% for the clothing and knitting mills, whereas a standard deviation of 0.03 and 0.05 shows a reasonable amount of dispersion across firms within one industry. The estimated inventory-to-expected-sales ratio is about 7.8% for plastic products, with a standard deviation of 0.03. These estimates are in the reasonable range as compared to the ratio of the inventory value and sales observed in the data.

PRODUCTIVITY, DEMAND SHOCKS, AND FIRM BEHAVIOR
In this section, we use our estimation results to explore the relationship between firm heterogeneity (productivity and demand shocks) and firm behavior dynamics (exit and capital investment decisions). The major purpose behind this exercise is to determine the relative importance of technology versus unexpected demand factors in driving firm investment and exit decisions. 4.1. What Drives Firms to Exit? An important application of the productivity measures in the existing literature is to understand the firm turnover in operation. Table 1 shows the average exit rate of firms in each industry. The exit rate is defined as the ratio of firms that stopped operating to the total incumbents in each year. For example, in the clothing industry, 14% of firms exit at the end of each year, on average. Firm exit rate in the other two industries is of similar magnitude, suggesting that it is a common feature in these industries.
The timing in our model implies that firms' decision to exit depends on productivity, demand shocks, capital size, and end-of-period inventory stock. As a result, we estimate a Probit model of firms' exit decisions based on the following equation: where the dependent variable EXIT jt equals 1 if a firm exits during year t, and 0 otherwise. X jt are other control variables such as firm age, and ξ e jt is an i.i.d. shock to a firm's exit decision, which is assumed to be uncorrelated with a firm's state variables. We also control for year fixed effects in all specifications.
We report the detailed regression results in Table 7. The first two columns report results from isolated regressions. We find that both a higher demand shock as well as higher productivity reduces the probability of exit in all three industries. In column (3), both productivity and demand shocks are included to separate out the role played by each. In column (4), we control for firm size (capital stock). Again, we find a similar effect of demand shock on firm exit: A good demand shock significantly reduces the probability of exit. In contrast, although the effect of productivity on exit is significant in clothing and the plastics industry, it becomes insignificant in the knitting mills industry. Also, the coefficient on productivity drops when we control for size in column (4). This suggests that productivity was capturing a size effect in specifications (1) and (3). This happens since larger firms are less likely to exit even after accounting for the shocks, which is consistent with the findings in OP, Dunne et al. (1988), and Dunne et al. (1989).
In our preferred full regression in column (5), we further control for end-of-period inventory stock as implied by the timing of the model. After controlling for demand shocks, inventories can influence the firm exit through two channels. First, a large inventory stock implies a size effect, making a large firm less likely to exit. Second, a large inventory stock can act as collateral for borrowing money from a bank, making it less likely to quit. Because both channels point to the same direction, after controlling for demand shocks, we observe a negative sign on the inventory stock. We find that the effect of demand shock remains statistically significant and increases in magnitude for all three industries. We report the average marginal effect corresponding to the full regression in the last column of Table 7. Overall, an increase of demand shocks by 1% reduces the probability of firm exit on average by 0.1-0.2 percentage points, as reported in the last column. The marginal effect of productivity on firms' exit decisions remains insignificant in the knitting mills industry, although it is also negative (−0.04).
Overall, our empirical finding has an important implication: A firm's exit may not be mainly driven by its persistent productivity; instead, a firm is more likely to be forced out due to a transitory demand shock. It implies that the firm turnover analysis based on productivity alone (excluding demand shocks) conducted in the literature can be misleading for certain industriesespecially in industries with a volatile demand. Hence, to forecast a firm's exit decision more reliably, we want to stress the need to consider the role of transitory demand shocks.

4.2.
What Drives Firms to Invest More? Productivity measures are often used to understand firm growth, via capital investment, for example. In this subsection, we test the roles played by productivity and demand shocks in determining firms' growth. The timing of our model implies that firms' capital investment decision is a function of its productivity, demand shock, capital Year fixed effects are included in each specification. ***p < 0.01, **p < 0.05, *p < 0.1.
size, and end-of-period inventory stock. Accordingly, we estimate a model of firms' investment decisions based on the following equation: where ξ i jt is an i.i.d. shock independent of a firm's state variables. We use TOBIT as our preferred model because investment is usually lumpy, with a substantial number of zeros in the data. 12 In the first two columns of Tables 8, we estimate the stand-alone effect of productivity and demand shocks on investment levels. It turns out that both productivity and demand shocks have a positive and significant impact on investment. Column (3) measures the joint effect of both shocks, and we find that the coefficient on demand shock becomes insignificant in the presence of productivity for clothing and knitting mills. Column (4) measures a positive effect of both stochastic factors after controlling for capital stock. Similar to the exit regression, we see Year fixed effects are included in each specification. ***p < 0.01, **p < 0.05, *p < 0.1. a large drop in the productivity coefficient once we control for size. This indicates that larger firms are more productive and tend to invest more, which is expected. Column (5) of Table 8 reports the estimation results from the full model as captured in Equation (19). Again, both productivity and demand shocks in all three industries have a positive and significant impact on investment. The coefficient on inventory captures two opposing effects. First, a positive size effect, large inventory stock implies a large firm, and hence it may invest more. Second, if a firm has more finished goods in the warehouse, then fewer goods are needed next period, which may have a negative impact on today's investment. These two effects cause the inventory coefficient to have both positive and negative signs in our results.
The estimation results show that the effect of a 1% increase in productivity on investment (5%-10%) is higher than that of the demand shocks (1%-3%) in all three industries. This implies that, in general, the persistent productivity is a more important factor affecting firms' investment decisions, compared with the short-term demand shocks. Since the coefficient on demand shocks is always significant, it supports our hypothesis that cash flow is also an important determinant of investment and hence firm-size growth.

ROBUSTNESS AND DISCUSSION
5.1. Heckman-Style Correction. In our main results, we argue that the demand shock measure adjusted by the conditional lower bound for observations with zero inventory (z jt ) contains the relevant information in influencing firms' investment and exit decisions. We made this assumption based on the premise that only the conditional lower bound of the i.i.d. unexpected demand shocks have an impact on firm investment and turnover by changing firm inventory, cash-flow, and financial constraints in the zero inventory case. This assumption also affects the production function estimation because we use investment to proxy productivity. However, it might be possible that the demand shocks may affect a firm's decision via other channels, e.g., by affecting manager/shareholder's sentiment/morale. In this case, the actual magnitude of demand shocks may matter when the inventory is zero.
We test the robustness of our results using the alternative measure of demand shocksẑ jt , with the demand shocks for zero inventory cases replaced by its conditional expectation, when controlling for productivity using investment. Because we could not recover the exact magnitude of demand shocks in the case of zero inventory, this Heckman-style correction is the best we could do given the data limitation. The estimation results, as reported in the Online Appendix, are very similar to our main results.

Intercept Method.
In our main results, we assume that firms' inventory share is a parametric function of firm characteristics including firm size, ownership, and location, as specified in Equation (8). We test the robustness of our results here by employing an alternative approach to estimate the inventory share and demand shocks. Instead of adding any parametric assumptions on firms' inventory share, we estimate Equation (7) by treating the inventory share as a firm-specific fixed effect. The obvious advantage of this method is that we leave the firm-level inventory share, λ j , completely flexible and guided by data only. The limitation of this approach, however, is that it requires a long panel data to estimate the firm effect with credibility. The panel data has 15 periods, which is arguably long enough to estimate Equation (7) with firm dummies. However, the panel is unbalanced, with a much shorter tenure on average for each firm. In practice, we keep firms that are present for six years or more in the data in order to ensure a consistent estimation of the fixed effect. This leaves us a smaller subsample for each industry, with 6,191 observations for clothing, 1,992 for plastic products, and 1,316 for knitting mills industry. After estimating demand shocks using Equation (7), we also estimate the productivity using the method outlined in Subsection 2.4 The detailed estimation results are reported in the Online Appendix, and they are consistent with our main results.

Role of Firm Size and a Series of Bad Demand Shocks on Firm Exit.
We conduct further analysis to gain more insight on the impact of demand shocks on firm exit. Specifically, we explore two directions. First, we study whether the effect of demand shock on firm exit changes with firm size. Second, we study the effect of a series of unfavorable demand shocks on firm exit. We further explore the second direction by testing whether the effect of a series of unfavorable demand shocks on firm exit changes with firm size.
To explore the first point, we add an additional interaction term,z jt × Dlarge, in Equation (18). The dummy variable Dlarge equals 1 if its capital stock is above the industry median and 0 otherwise. The results are reported in column (1) for each industry in Tables 9 and 10, with the coefficients in Table 9 and the corresponding marginal effect in Table 10. The coefficients on productivity, demand shocks, and inventory are very similar to our main results in Table 7. However, the coefficients on the new term,z jt × Dlarge, are insignificant, implying that the demand shocks may not have a differential effects on small and larger firms. This is reasonable considering that the demand shockz jt is a fractional deviation to expected sales by its definition and hence already captures some size effect.
We run three additional regressions to examine the second point. In column (2) of Tables 9 and 10, we added the lagged demand shocks in addition to current demand shocks to test whether (3) (1) (3) (1) (3)  demand shocks also have a delayed impact on firm exit. In general, we find no significant delayed effect, except in the clothing industry. In columns (3) and (4), we test whether a series of bad demand shocks in prior years drives firms to exit. For this analysis, we define a new variable, #Badz, as the number of unfavorable (negative) demand shocks a firm has suffered in the past three years, excluding the current period. We find that consecutive unfavorable demand shocks cause a significant impact on firm exit, as captured by the large significant coefficient of #Badz in all three industries. One additional negative demand shock in the past three years increases the probability of exit by 3.1-3.4 percentage points (or 22%-24% given that the average exit probability is about 14%) for the three industries, keeping everything else the same. This result provides further supporting evidence to our main results: If financial problems due to unfavorable demand shocks drive firms to exit, then multiple such unexpected shocks make firms' exit even more likely. However, we find no differential response of large firms to a series of unfavorable demand shocks as compared with small firms, as captured by the insignificant coefficients of the interaction term #Badz × Dlarge in all three industries.
5.4. Discussion: Price Response to Demand Shocks. In our model, we assume that output prices are chosen and committed along with the inputs and production decisions in each period, before observing demand shocks. This assumption is commonly made in the inventory literature, but it is indeed restrictive to the model especially when using yearly data. If firms can further adjust prices after observing the unexpected demand shocks, we may bias the estimates of demand shocks, as pointed out by one anonymous referee. When the demand shock is good, the firm raises prices, sells less than the case without price response, and has a higher end-ofyear inventory. Because we estimate the demand shock by the difference between the realized inventory stock and the targeted inventory, we tend to underestimate the demand shocks in this case of a favorable demand shock. In contrast, when the demand shock is bad, the firm lowers the prices to sell more, resulting in higher inventory than the case without price response. So, we overestimate the demand shocks in this case. Overall, if firms respond to demand shocks by adjusting prices, our measure of demand shocks is biased toward zero. Hence, we may underestimate the dispersion of demand shocks and the role it plays in determining investment and firm dynamics. Hence, we could interpret our analysis to be using only a lower bound of demand shocks. As a result, the role played by the demand shocks may be even larger than predicted using our conservative estimate.

CONCLUSION
We examine the roles played by productivity and unexpected demand shocks on firms' exit and capital investment decisions. We propose an approach to disentangle and recover the unexpected demand shocks from the persistent productivity using the within-firm variation of inventory stocks. Subsequently, we extend the classical production function estimation approach, in the spirit of Olley and Pakes (1996), to acknowledge the roles of inventory and demand shocks in production decisions. This approach is widely applicable because inventory data are readily available in many production data sets.
Our empirical results indicate that both productivity and unexpected demand shocks play important roles in determining firm turnover and investment. This suggests that in explaining these firm activities, we should pay demand shocks necessary attention. In the Colombia data, we find that the persistent productivity plays a relatively more important role in determining firms' capital investment, whereas the unexpected demand shocks are a stronger determinant of firms' exit decisions. Hence, firms are more likely to grow as planned, but can die accidentally. APPENDIX A.1. A Model of Optimal Inventory Choice. The key assumption to derive Equations (7), (8), and (9) is that the inventory share is fixed relative to expected sales, as exemplified in Equation (5). In this Appendix, we first show that this assumption holds for a large class of stockout avoidance inventory models (e.g., Kahn, 1987Kahn, , 1992, 13 which predict a constant stockout probability. We then discuss the conditions under which a constant stockout probability is the optimal choice when the firm optimally chooses production and prices in the presence of demand uncertainty and nonnegativity inventory constraint using Kahn (1987) as an example. We also show that our assumptions in this article are coherent with constant inventory-toexpected-sales ratio (Equation (5)).
A model of optimal inventory with constant stockout probability. We first show that our key assumption, Equation (5), is coherent with a large class of inventory models that predict a constant stockout probability. As assumed in our article, a firm faces uncertainty in demand and a nonnegativity inventory constraint. It fully bears the costs of production, inventory, and stockout. The firm chooses production and output prices to maximize its long-term profits. An increase in inventory holding raises inventory costs as well as production costs (due to increasing marginal costs). At the same time, stocking out is bad for the firm, because it leads to a loss of sales. As a result, many firms try to minimize the inventory but ensure that the stocking out probability is lower than a tolerable level (Holt et al., 1960).
Assume that firm j's optimal inventory management always targets a constant tolerance stockout probability, α j , which is fixed for each firm but may vary across firms depending on firm history and its characteristics.
Given the accounting equation, λ jt + E(Q s jt |I jt ) = inv e jt + Q s jt , we can derive firm j's stockout probability as follows: Pr inv e jt ≤ 0 = Pr λ jt + E Q s jt |I jt − Q s jt ≤ 0 (A.1) = Pr log λ jt + E Q s jt |I jt ≤ log E Q s jt |I jt + z jt = 1 − Pr z jt ≤ log λ jt + E Q s jt |I jt − log E(Q s jt |I jt ≡ α j . The last equality holds by definition. Given that the demand shock is i.i.d. normal z jt ∼ N(0, σ 2 ), this equation is equivalent to, that the expected sales, E(Q s jt |I jt ), are flexibly modeled. It can depend on firm state including productivity, capital stock, and beginning-of-year inventory.
By defining λ j ≡ [exp(σt 1−α j ) − 1], we derive Equation (5), This simple model shows that the key assumption to recover demand shocks in our article is consistent with a large class of inventory models that predict constant stockout probability.
Discussion on the constant stockout probability assumption. Kahn (1987) is a concrete example of an inventory model that predicts constant stockout probability. This article shows that in the presence of demand shocks and nonnegativity constraint on inventory, a monopolistic firm's dynamic optimal production and pricing decisions lead to a constant stockout probability when (1) the marginal production cost is constant, and (2) there are costs of holding inventory and stockout due to delayed/lost sales. Based on this model, Kahn (1987) shows that the model is consistent with many important features of inventory observed in the data, including the fact that production has a larger variation than sales, which cannot be explained by a production smoothing motive alone.
It is straightforward to see that the key prediction of constant stockout probability still remains after a slight modification of Kahn (1987) by allowing for more flexible production costs and constant demand elasticity as assumed in our article. This can be seen directly from equation (27) in Kahn (1987). To save space, we avoid copying all their equations and setup here.

SUPPORTING INFORMATION
Additional supporting information may be found online in the Supporting Information section at the end of the article. Table A1: Production Function Parameters: Heckman-Style correction Table A2: Demand shock and Productivity: Heckman style correction Table A3: Demand shock and productivity across groups: Heckman-style correction Table A4: Correlation patterns: Heckman-style correction Table A5: Descriptive statistics of the inventory share: Heckman-style correction