\section{Introduction}
\label{sec:introduction}

It is well-documented in management, economics as well as operations research that businesses, even in narrowly defined industries, are quite different from one another in terms of productivity. These cross-firm productivity differentials are large, persistent and ubiquitous \citep[see][]{syverson2011}. Research on this phenomenon is therefore unsurprisingly vast and includes attempts to explain it from the perspective of firms' heterogeneous behaviors in research and development \citep[e.g.,][]{griffithetal2004}, corporate operational strategies \citep{smithreece1999}, ability of the managerial teams \citep{demerjianetal2012}, ownership structure \citep{ehrlichetal1994}, employee training and education \citep{moretti2004}, allocation efficiency \citep{songetal2011}, participation in globalization \citep{grossmanhelpman2015} and many others. In most such studies, a common production function/technology is typically assumed for all firms within the industry, and the differences in { operations performance of firms} are {confined to} variation in the {``total factor productivity,''} the Solow residual {\citep{solow1957}}.\footnote{A few studies alternatively specify an ``augmented'' production function which, besides the traditional inputs, also admits various firm-specific shifters such as the productivity-modifying factors mentioned above. {But such studies continue to assume that the same technology frontier applies to all firms.}}

In this paper, we approach the {heterogeneity in firm performance} from a novel perspective in that we explicitly acknowledge the existence of locational effects on the {operations technology of firms} and their underlying productivity. {We} allow the firm-level production function to vary across space, thereby {accommodating potential neighborhood influences on firm production.} In doing so, we are able to examine the role of locational heterogeneity for cross-firm differences in {operations} performance{/efficiency}.

{A firm's location is important for its operations technology. For example, \citet{ketokivi2017locate} show that hospital location is significantly related to {its} performance and {that} a hospital’s choice of strategy can {help} moderate the effect of location {through} the interplay of {local} environmental factors with organizational strategy. As shown in Figure \ref{fig:number}, chemical enterprises in China, the focus of empirical analysis in this paper, are widely {(and unevenly)} distributed {across} space. {Given the sheer size of the country (it is the third largest by area), it is implausible that, even after controlling for firm heterogeneity, all these businesses operate using} the same production technology. Organizations in all industries\textemdash not only hospitals and chemical manufacturers\textemdash develop strategies to respond to {local environment} and {the associated} competitive challenges, and those strategies drive operational decisions regarding investments in new or updated technologies}.

\begin{figure}[t]
	\centering
	\includegraphics[scale=0.26]{map_number.jpg}
	\caption{Spatial Distribution of Manufacturers of Chemicals in China, 2004--2006} \label{fig:number}
\end{figure}

{Theoretically,} there are many reasons to believe that the production technology is location-specific. First, exogenous {local} endowments and institutional environments, such as {laws, regulations and local supply chains}, play a key role in determining firm performance. {The location of firms} {determines key linkages between {the} production, market, supply chain and product development \citep{goldsteinetal2002}}. If we look at the global distribution of the supply chains of many products, the product development and design is usually conducted in developed countries such as the U.S. and European countries, while the manufacturing and assembly process is performed in East Asian countries such as China and Vietnam. This spatial distribution largely reflects the endowment differences in factors of production (e.g., skilled vs.~unskilled labor) and the consequent relative input price differentials across countries.
Analogously, take the heterogeneity in endowment and institutions across different locations \textit{within} a country. There are many more world's leading universities on the East and West Coasts of the U.S.~than in the middle of the country, and they provide thousands of talented graduates each year to the regional development, bolstering growth in flagship industries such as banking and high-tech in those locations. In China, which our empirical application focuses on, networking and political connections are, anecdotally, the key factors for the success of a business in the Northeast regions, whereas the economy on the Southeast Coast is more market-oriented. Furthermore, there are many broadly defined special economics zones (SEZs) in China, which all are characterized by a small designated geographical area, local management, unique benefits and separate customs and administrative procedures \citep[see][]{craneetal2018}. According to a report from the China Development Bank, in 2014, there were 6 SEZs, 14 open coastal cities, 4 pilot free-trade areas and 5 financial reform pilot areas. There were also 31 bonded areas, 114 national high-tech development parks, 164 national agricultural technology parks, 85 national eco-industrial parks, 55 national eco-civilization demonstration areas and 283 national modern agriculture demonstration areas. They spread widely in China and support various economic functions, giving rise to locational heterogeneity in the country's production.

Second, most industries are geographically concentrated in general, whereby firms in the same or related industries tend to spatially cluster, benefiting from agglomeration economies reflected, among other things, in their production technologies that bring about localized \textit{aggregate} increasing returns. Ever since \citet{marshall1920} popularized these ideas, researchers have shown that industry concentration is too great to be explained solely by the differences in exogenous locational factors and that there are at least three behavioral micro-foundations for  agglomeration: benefits from labor market pooling/sharing, efficiency gains from the collocation of industries with input-output relationships that improves the quality of matches and technology spillovers  \citep[see][]{ellison_glaeser1999,duranton2004,ellisonetal2010,singh_marx2013}. The key idea of agglomeration economies is that geographic proximity reduces the transport costs of goods, people and, perhaps more importantly, ideas. While it is more intuitive that the movement of goods and people is hindered by spatial distance, the empirical evidence from prior studies shows that technology spillovers are also highly localized because knowledge transfers require interaction that proximity facilitates \citep[see][]{almeida_Kogut1999,alcacer_Chung2007,singh_marx2013}. Therefore, {owing to the role of local neighborhood influences,} firms that produce the same/similar products but are located in regions with different industry concentration levels are expected to enjoy different agglomeration effects on their {operations}.

Because location is an important factor affecting firm performance, previous empirical studies heavily rely on spatial econometrics to examine the locational/spatial effects on production. Oftentimes, spatially-weighted averages of other firms' outputs and inputs are included as additional regressors in spatial autoregressive (SAR) production-function models \citep[e.g.,][]{glassetal2016,glassetal2020,glassetal2020b, vidoli_Canello2016,serpakrishnan2018, glassetal2019,kutluetal2020,houetal2020}. The appropriateness of such {a conceptualization of firm-level production functions in the presence of locational influences} however remains unclear because {these SAR specifications are difficult to reconcile with the theory of firm.} For instance, the reduced form of such models effectively implies substitutability of the firm's inputs with those of its peers and does not rule out the possibility of the firm's output increasing when the neighboring firms use more inputs even if the firm itself keeps own inputs fixed { and the productivity remains the same. Further, these models continue to implausibly assume that all firms use the same production technology no matter their location. The practical implementation of SAR production-function models is, perhaps, even more problematic: (\textsl{i}) they imply additional, highly nonlinear parameter restrictions necessary to ensure that the conventional production axioms are not violated, and (\textsl{ii}) they are likely unidentifiable from the data given the inapplicability of available proxy-variable estimators and the pervasive lack of valid external instruments at the firm level. We discuss this in detail in Appendix \ref{sec:appx_sar}.}\footnote{But we should note that studies of the nexus between location/geography and firm performance in operations research and management are not all confined to the production theory paradigm; e.g., see \citet{bannisterstolp1995}, \citet{goldsteinetal2002}, \citet{kalnins2004,kalnins2006}, \citet{dahlsorenson2012} and \citet{kulchina2016}.}

In this paper, we consider a semiparametric production function in which both the {input-to-output transformation technology} and  productivity are location-specific. Concretely, using the location information for firms, we let the {input-elasticity} and productivity-process parameters be nonparametric functions of the firm's {geographic location (latitude and longitude)} and estimate these unknown functions via kernel methods. Our methodology captures the cross-firm spatial {influences} through local smoothing, whereby the production technology for each location is calculated as the geographically weighted average of the input-output \textit{relationships} for firms in the nearby locations with larger weights assigned to the firms that are more spatially proximate. This is fundamentally different from the SAR production-function models that formulate {neighborhood influences}  using spatially-weighed averages of the output/inputs \textit{quantities} while keeping the production technology the same for all firms. Consistent with the agglomeration literature, our approach implies that learning and knowledge spillovers are localized and that their chances/intensity diminish with distance. Importantly, by utilizing the data-driven selection of smoothing parameters that regulate spatial weighting of neighboring firms in kernel smoothing, we avoid the need to rely on \textit{ad hoc} specifications of the weighting schemes and spatial radii {of neighborhood influences like the} traditional SAR models do. It also allows us to be agnostic about the channels through which {firm location affects its production,} and our methodology inclusively captures all possible mechanisms of agglomeration economies.

{Our conceptualization of spatial influences by means of locationally-varying parameters is akin to the idea of ``geographically weighted regressions'' (GWR) introduced and popularized in the field of geography by \citet{bfc1996}; also see \citet{fbc-book} and many references therein. Just like ours, the GWR technique aims to model processes that are not constant over space but exhibit local variations and do so using a varying-coefficient specification estimated via kernel smoothing over locations. However, the principal\textemdash and non-trivial\textemdash distinction of our methodology from the GWR approach is in its emphasis on \textit{identification} of the spatially varying relationship. Concretely, for consistency and asymptotic unbiasedness the GWR methods rely on the assumption that (non-spatial) regressors in the relationship of interest are mean-orthogonal to the stochastic disturbance which rules out the presence of correlated unobservables as well as the potential simultaneity of regressors and the outcome variable for reasons other than spatial autoregression. The latter two are, however, more the rule rather than the exception for economic relations, which are affected by behavioral choices, including the firm-level production function.
Recovering the data generating process underlying the firm's production operations from observational data (i.e., its identification) requires tackling the correlation between regressors and the error term that the GWR cannot handle, making it unable to consistently estimate the production technology and firm productivity. This is precisely our focus.\footnote{In effect, our methodology constitutes a generalization of the GWR technique to accommodate endogenous regressors in the context of production-function estimation.}}

The identification of production functions in general, let alone with locational heterogeneity, is not trivial due to the endogeneity issue whereby the firm's input choices are correlated with its productivity. Complexity stems from the latency of firm productivity. Due to rather unsatisfactory performance of the conventional approaches to identification of production functions, such as fixed effects estimation or instrumentation using prices, there is a growing literature targeted at solving endogeneity using a proxy-variable approach \citep[e.g., see][]{op1996,lp2003,acf2015,gnr2013} which has gained wide popularity among empiricists.

To identify the locationally-varying production functions, we develop a semiparametric proxy-variable estimator that accommodates locational heterogeneity across firms. To this end, we build upon  \citet{gnr2013} whose framework we extend to incorporate spatial information about the firms in a semiparametric fashion. More specifically, we make use of the structural link between the production function (of the known varying-coefficient functional form) and the optimality condition for a flexible input derived from the firm's static expected profit maximization problem. We propose a two-step estimation procedure and, to approximate the unknown functional coefficients, employ  local-constant kernel fitting. Based on the estimated location-specific production functions, we further propose a locational productivity differential decomposition to break down the cross-region production differences that cannot be explained by input usage (i.e., the differential in ``total productivity'' of firms across locations) into the contributions attributable to differences in available production technologies  and to differences in {total-factor operations efficiency of firms.}

We apply our model to study locationally heterogeneous production technology among Chinese manufacturing firms in the chemical industry in 2002--2004. Based on the results of the data-driven cross-validation as well as formal statistical tests, the empirical evidence provides strong support to the importance and relevance of location for production. Qualitatively, we find that both technology and {firm} productivity vary significantly across regions. Firms are more likely to exhibit higher {(internal)} returns to scale in regions of agglomeration. However, the connection between {firm} productivity and industry concentration {across space} is unclear. The decomposition analysis reveals that differences in {\textit{technology} (as opposed to in idiosyncratic firm heterogeneity)} are the main source of cross-location total productivity differentials, on average {accounting for 2/3} of the differential.

To summarize, our contribution is as follows. We propose a semiparametric methodology to accommodates locational heterogeneity in the production-function estimation while maintaining the standard structural assumptions about firm production. {Unlike the available SAR-type alternatives, our model explicitly estimates the cross-locational variation in production technology.} To operationalize our methodology, we extend the widely-used proxy-variable identification methods to incorporate {firm location}. Our model as well as the proposed decomposition method for disentangling the effects of location on {firm} productivity from those on technological input-output relationship should provide a valuable addition to the toolkit of {empiricists} interested in studying agglomeration economies and technology spillovers. {In the context of operations management in particular, our methodology will be most useful for empirical studies focused on the analysis of operations efficiency/productivity and} {its ``determinants;'' \citep[e.g.,][are just a few recent examples of such analyses]{ross2004analysis,berenguer2016disentangling,jola2016effect,lam2016impact}. {In the case of multi-input production, the ``total factor productivity'' is among the most popular comprehensive measures of operations efficiency/productivity of the firm,} and our paper shows how to measure the latter robustly when production relationships are not constant over space {and are subject to neighborhood influences. This is particularly interesting because the effects of location, supply chain integration and agglomeration on firm performance have recently attracted much attention among researchers in operations management} \citep[e.g.,][]{goldsteinetal2002,ketokivi2017locate,flynn2010impact}.}

The rest of the paper is organized as follows. Section \ref{sec:model} describes the model of firm-level production {exhibiting} locational heterogeneity. We describe our identification and estimation strategy in Section \ref{sec:identification_estimation}. We provide the locational productivity differential decomposition in Section \ref{sec:decomposition_level}. The empirical application is presented in Section \ref{sec:application}. Section \ref{sec:conclusion} concludes. Supplementary materials are relegated to the Appendix.

\section{Locational Heterogeneity in Production}
\label{sec:model}

Consider the production process of a firm $i$ ($i=1,\dots,n$) in the time period $t$ ($t=1,\dots,T$) in which physical capital $K_{it} {\in\Re_{+}}$, labor $L_{it} {\in\Re_{+}}$ and an intermediate input such as materials $M_{it}{\in\Re_{+}}$ are  transformed into the output $Y_{it}{\in\Re_{+}}$ via a production function given the (unobserved) firm productivity. Also, let $S_{i}$ be the (fixed) location of firm $i$, with the obvious choice being $S_{i}=(\text{lat}_i,\text{long}_i)'$, where $\text{lat}_i$ and $\text{long}_i$ are the latitude and longitude coordinates of the firm's location. Then, the locationally varying production function is
\begin{equation}\label{eq:prodfn_hicks_f}
Y_{it} = F_{|S_{i}}(K_{it},L_{it},M_{it})\exp\left\{\omega_{it}\right\}\exp\left\{\eta_{it}\right\} ,
\end{equation}
where $F_{|S_{i}}(\cdot)$ is the firm's location-specific production {function} that {varies} over space (as captured by $S_i$) to accommodate locational heterogeneity in production technology, $\omega_{it}$ is the firm's persistent Hicks-neutral {total factor productivity capturing its operations efficiency}, and $\eta_{it}$ is a random transitory shock. Note that, so long as the firm's location is fixed, $\omega_{it}$ that persist for the same firm $i$, by implication, then also has the evolution process that is specific to this firm's location $S_i$; we expand on this below.

As in \citet{gnr2013}, \citet{malikovetal2020} and \citet{malikovzhao2021}, physical capital $K_{it}$ and labor $L_{it}$ are said to be subject to adjustment frictions (e.g., time-to-install, hiring/training costs), and the firm optimizes them dynamically at time $t-1$ rendering these predetermined inputs quasi-fixed at time $t$. Materials $M_{it}$ is a freely varying (flexible) input and is determined by the firm statically at time $t$. Thus, both $K_{it}$ and $L_{it}$ are the state variables with dynamic implications and follow their respective deterministic laws of motion:
\begin{equation}\label{eq:k_lawofmotion}
	K_{it}=I_{it-1}+(1-\delta)K_{it-1}\quad \text{and}\quad L_{it}=H_{it-1}+L_{it-1} ,
\end{equation}
where $I_{it}$, $H_{it}$ and $\delta$ are the gross investment, net hiring and the depreciation rate, respectively.

Following the convention, we assume that the risk-neutral firm maximizes a discounted stream of expected life-time profits in perfectly competitive output and factor markets subject to the state variables and expectations about the market structure variables including prices that are common to all firms.\footnote{{
We use the perfect competition and homogeneous price assumption mainly for two reasons: (\textsl{i}) it is the most widely used assumption in the literature on structural identification of production function and productivity, and (\textsl{ii}) this assumption has been {repeatedly} used {when} studying the same data as ours \citep[e.g.,][]{baltagietal2016,malikovetal2020}. Relaxing the perfect competition assumption is possible but non-trivial, and it requires additional assumptions {about} the output demand \citep[e.g.,][]{deLoecker2011product} and/or extra information on firm-specific output prices that are usually not available for manufacturing data \citep[e.g.,][]{deloeckeretal2016} {or imposing \textit{ex ante} structure on the returns to scale \citep[see][]{flynnetal2019}.} It is still a subject of ongoing research. Given {the emphasis of our contribution on incorporating \textit{technological} heterogeneity (associated with firm location, in our case) in the measurement of firm productivity, we opt} to keep all other aspects of {modeling} consistent with {the convention in the literature to ensure meaningful comparability with most available methodologies.}}} Also, for convenience, we denote $\mathcal{I}_{it}$ to be the information set available to the firm $i$ for making the period $t$ production decisions.

In line with the proxy variable literature, we model firm productivity $\omega_{it}$ as a first-order Markov process which we, however, endogenize \`a la \citet{dj2013} and \citet{deloecker2013} by incorporating productivity-enhancing and ``learning'' activities of the firm. To keep our model as general as possible, we denote all such activities via a generic variable $G_{it}$ which, depending on the empirical application of interest, may measure the firm's R\&D expenditures, foreign investments, export status/intensity, etc.\footnote{A scalar variable $G_{it}$ can obviously be replaced with a vector of such variables.} Thus, $\omega_{it}$ evolves according to a location-inhomogeneous controlled first-order Markov processes with transition probability $\mathcal{P}^{\omega}_{|S_i}(\omega_{it}|\omega_{it-1},G_{it-1})$. This implies the following location-specific mean regression for firm productivity:
\begin{equation}\label{eq:productivity_hicks_law}
\omega_{it}=h_{|S_i}\left(\omega_{it-1},G_{it-1}\right)+\zeta_{it},
\end{equation}
where $h_{|S_i}(\cdot)$ is the location-specific conditional mean function of $\omega_{it}$, and $\zeta_{it}$ is a random innovation unanticipated by the firm at period $t-1$ and normalized to zero mean:
$ \mathbb{E}\left[\zeta_{it} | \mathcal{I}_{it-1}\right]=\mathbb{E}\left[\zeta_{it}\right]=0$.

The evolution process in \eqref{eq:productivity_hicks_law} implicitly assumes that productivity-enhancing activities and learning take place with a delay which is why the dependence of $\omega_{it}$ on a control $G_{it}$ is lagged implying that the improvements in firm productivity take a period to materialize. Further, in $\mathbb{E}[\zeta_{it} |\ \mathcal{I}_{it-1}]=0$ we assume that, due to adjustment costs, firms do not experience changes in their productivity-enhancing investments in light of expected \textit{future} productivity innovations. Since the innovation $\zeta_{it}$ represents inherent uncertainty about productivity evolution as well as the uncertainty about the success of productivity-enhancing activities, the firm relies on its knowledge of the \textit{contemporaneous} productivity  $\omega_{it-1}$ when choosing the level of $G_{it-1}$ in period $t-1$ while being unable to anticipate $\zeta_{it}$. These structural timing assumptions are commonly made in models with controlled productivity processes \citep[e.g.,][]{vanbiesebroeck2005, dj2013,dj2018, deloecker2013, malikovetal2020,malikovzhao2021} and are needed to identify the within-firm productivity-improving learning effects.

We now formalize the firm's optimization problem in line with the above discussion. Under risk neutrality, the firm's optimal choice of freely varying input $M_{it}$ is described by the (static) restricted expected profit-maximization problem subject to the already optimal dynamic choice of quasi-fixed inputs:
\begin{align}\label{eq:profitmax}
\max_{M_{it}}\ P_{t}^Y F_{|S_i}(K_{it},L_{it},M_{it})\exp\left\{\omega_{it}\right\}\theta  - P_{t}^M M_{it} ,
\end{align}
where $P_{t}^Y$ and $P_{t}^M$ are respectively the output and material prices that, given the perfect competition assumption, need not vary across firms; and $\theta\equiv\mathbb{E}[\exp\{\eta_{it}\}|\ \mathcal{I}_{it}]$. The first-order condition corresponding to this optimization yields the firm's conditional demand for $M_{it}$.

Building on \citeauthor{dj2018}'s (2013, 2018) treatment of productivity-enhancing R\&D investments (a potential choice of $G_{it}$ in our framework) as a contemporaneous decision, we describe the firm's dynamic optimization problem by the following Bellman equation:
\begin{align}\label{eq:bellman}
	\mathbb{V}_{t}\big(\Xi_{it}\big) = &\max_{I_{it},H_{it},G_{it}} \Big\{ \Pi_{t|S_i}(\Xi_{it}) -
	\text{C}^{I}_{t}(I_{it}) -
	\text{C}^{H}_{t}(H_{it})-
	\text{C}^{G}_{t}(G_{it}) + \mathbb{E}\Big[\mathbb{V}_{t+1}\big(\Xi_{it+1}\big) \Big| \Xi_{it},I_{it},H_{it},G_{it}\Big]\, \Big\} ,
\end{align}
where $\Xi_{it}=(K_{it},L_{it},\omega_{it})'\in \mathcal{I}_{it}$ are the state variables;\footnote{The firm's location $S_i$ is suppressed in the list of state variables due to its time-invariance.} $\Pi_{t|S_i}(\Xi_{it})$ is the restricted profit function derived as a value function corresponding to the static problem in \eqref{eq:profitmax}; and $\text{C}^{\kappa}_t(\cdot)$ is the cost function for capital ($\kappa=I$), labor ($\kappa=H$) and productivity-enhancing activities ($\kappa=G$).\footnote{The assumption of separability of cost functions is unimportant, and one can reformulate \eqref{eq:bellman} using one $\text{C}_{t}(I_{it},H_{it},G_{it})$ for all dynamic production variables.} In the above dynamic problem, the level of productivity-enhancing activities $G_{it+1}$ is chosen in time period $t+1$ unlike the amounts of dynamic inputs $K_{it+1}$ and $L_{it+1}$ that are chosen by the firm in time period $t$ (via $I_{it}$ and $H_{it}$, respectively). Solving \eqref{eq:bellman} for $I_{it}$, $H_{it}$ and $G_{it}$ yields their respective optimal policy functions.

{An important assumption of our structural model of firm production in the presence of locational heterogeneity is that firm location $S_i$ is both fixed and exogenous. However, the identification of locational heterogeneity in production may be complicated by the potentially endogenous spatial sorting problem, whereby more productive firms might \textit{ex ante} sort into the what-then-become high productivity locations. Under this scenario, when we compare firm productivity and technology across locations, we may mistakenly attribute gradients therein to the locational effects such as agglomeration and neighborhood influences, while in actuality it may be merely reflecting the underlying propensity of all firms in a given location to be more productive \textit{a priori}. While there has recently been notable progress in formalizing and understanding these coincident phenomena theoretically \citep[e.g.,][]{behrensetal2014,gaubert2018}, disentangling firm sorting and spatial agglomeration remains a non-trivial task empirically.\footnote{Urban economics literature also distinguishes the third endogenous process usually referred to as the ``selection'' which differs from sorting  in that it occurs \textit{ex post} after the firms had self-sorted into locations and which determines their continuing survival. We abstract away from this low-productivity-driven attrition issue in the light of the growing empirical evidence suggesting that it explains none of spatial productivity differences which, in contrast, are mainly driven by agglomeration economies \citep[see][]{combesetal2012}. Relatedly, the firm attrition out of the sample has also become commonly accepted as a practical non-issue in the productivity literature so long as the data are kept unbalanced. For instance, \citet[][p.324]{lp2003} write: ``The original work by Olley and Pakes devoted significant effort to highlighting the importance of not using an artificially balanced sample (and the selection issues that arise with the balanced sample). They also show once they move to the unbalanced panel, their selection correction does not change their results.''}
However, by including the firm’s own lagged productivity in the autoregressive $\omega_{it}$ process in \eqref{eq:productivity_hicks_law}, we are able (at least to some extent) to account for this potential self-sorting because sorting into locations is heavily influenced by the firm's own productivity (oftentimes stylized as the ``talent'' or ``efficiency'' in theoretical models). That is, the locational heterogeneity in firm productivity and technology in our model is measured after partialling out the contribution of its own past productivity. Incidentally, \citet{deloecker2013} argues the same in the context of productivity effects of exporting and self-selection of exporters.}

\section{Methodology}
\label{sec:identification_estimation}

This section describes our strategy for (structural) identification and estimation of the firm's location-specific production technology and unobserved productivity.

Following the popular practice in the literature \citep[e.g., see][]{op1996,lp2003, dj2013,acf2015,collarddeloecker2015, koningsvanormelingen2015}, we assume the Cobb-Douglas specification for the production function which we adapt to allow for potential locational heterogeneity in production. We do so in a semiparametric fashion as follows:
\begin{equation}\label{eq:prodfn_hicks_cd}
\ln F_{|S_i}(\cdot) = \beta_K(S_i) k_{it}+\beta_L(S_i)l_{it}+\beta_M(S_i)m_{it} ,
\end{equation}
where the lower-case variables denote the logs of the corresponding upper-case variables, and the input elasticity functions $[\beta_K(\cdot),\beta_L(\cdot),\beta_M(\cdot)]'$ are unspecified {smooth} functions of the firm's location $S_i$. {The local smoothness feature of the production {relationship}, including both {the} input elasticities and persistent productivity {process below}, captures the effects of technology spillovers and agglomeration economies} {that give rise to local neighborhood influences}. Our methodology can also adopt more
flexible specifications such as the log-quadratic translog, which provides a natural extension of the log-linear Cobb-Douglas form. See Appendix \ref{sec:appx_tl} for the details on this extension.

Before proceeding further, we formalize the location-specific autoregressive conditional mean function of $\omega_{it}$ in its evolution process  \eqref{eq:productivity_hicks_law}. Following \citet{dj2013,dj2019}, \citet{acf2015}, \citet{griecoetal2016,griecoetal2019} and many others, we adopt a parsimonious first-order autoregressive specification of the Markovian evolution for productivity but take a step further by assuming a more flexible semiparametric location-specific formulation akin to that for the production technology in \eqref{eq:prodfn_hicks_cd}:
\begin{equation}\label{eq:productivity_hicks_lawsp}
h_{|S_i}(\cdot ) = \rho_0(S_i)+ \rho_1(S_i) \omega_{it-1}+\rho_2(S_i)G_{it-1}.
\end{equation}

\subsection{Proxy Variable Identification}
\label{sec:identification}

Substituting for $F_{|S_i}(\cdot)$ in the locationally varying production function \eqref{eq:prodfn_hicks_f} using \eqref{eq:prodfn_hicks_cd},  we obtain
\begin{align}
y_{it} &= \beta_K(S_i) k_{it}+\beta_L(S_i)l_{it}+\beta_M(S_i)m_{it} + \omega_{it}+ \eta_{it} \label{eq:prodfn_hicks_cd2} \\
&= \beta_K(S_i) k_{it}+\beta_L(S_i)l_{it}+\beta_M(S_i)m_{it} +  \rho_0(S_i)+ \rho_1(S_i) \omega_{it-1}+\rho_2(S_i)G_{it-1} + \zeta_{it}+ \eta_{it}, \label{eq:prodfn_hicks_cd3}
\end{align}
where we have also used the Markov process for $\omega_{it}$ from \eqref{eq:productivity_hicks_law} combined with \eqref{eq:productivity_hicks_lawsp} in the second line.

Under our structural assumptions, all right-hand-side covariates in \eqref{eq:prodfn_hicks_cd3} are predetermined and weakly exogenous with respect to $\zeta_{it} + \eta_{it}$, except for the freely varying input $m_{it}$ that the firm chooses in time period $t$ conditional on $\omega_{it}$ (among other state variables) thereby making it a function of $\zeta_{it}$. That is, $m_{it}$ is endogenous.

Prior to finding ways to tackle the endogeneity of $m_{it}$, to consistently estimate \eqref{eq:prodfn_hicks_cd3}, we first need to address the latency of firm productivity $\omega_{it-1}$. A popular solution is a proxy variable approach \`a la \citet{lp2003} whereby latent productivity is controlled for by inverting the firm's conditional demand for an observable static input such as materials. However, such a standard proxy approach generally fails to identify the firm's production function and productivity due to the lack of a valid instrument (from within the production function) for the endogenous $m_{it}$ despite the abundance of predetermined lags of inputs. As recently shown by \citet{gnr2013}, identification cannot be achieved using the standard procedure because \textit{no} exogenous higher-order lag provides excluded relevant variation for $m_{it}$ after conditioning the model on the already included self-instrumenting variables. As a result, the production function remains unidentified in flexible inputs. In order to solve this under-identification problem, \citet{gnr2013} suggest exploiting a structural link between the production function and the firm's (static) first-order condition for the freely varying input. In what follows, we build on this idea which we modify along the lines of \citet{dj2013} and \citet{malikovzhao2021} in explicitly making use of the assumed functional form of production technology.

\textsl{First step}.\textemdash We first focus on the identification of production function in its flexible input $m_{it}$. Specifically, given the technology specification in \eqref{eq:prodfn_hicks_cd}, we seek to identify the material elasticity function $\beta_M(S_i)$. To do so, we consider an equation for the firm's first-order condition for the static optimization in \eqref{eq:profitmax}. The optimality condition with respect to $M_{it}$ in logs is given by (in logs)
\begin{equation}\label{eq:foc_cd}
\ln P_{t}^Y+\beta_K(S_i) k_{it}+\beta_L(S_i)l_{it}+\ln \beta_M(S_i)+[\beta_M(S_i)-1]m_{it} + \omega_{it}+ \ln \theta = \ln P_{t}^M ,
\end{equation}
which can be transformed by subtracting the production function in \eqref{eq:prodfn_hicks_cd2} from it to obtain the following location-specific material share equation:
\begin{equation}\label{eq:fst}
v_{it} = \ln [\beta_M(S_i)\theta] - \eta_{it} ,
\end{equation}
where $v_{it} \equiv \ln \left(P_{t}^M M_{it}\right)-\ln \left( P_{t}^Y Y_{it}\right)$ is the log nominal share of material costs in total revenue, which is observable in the data.

The material share equation in \eqref{eq:fst} is powerful in that it enables us to identify unobservable material elasticity function $\beta_M(S_i)$ using the information about the log material share $v_{it}$. Specifically, we first identify a ``scaled'' material elasticity function $\beta_M(S_i)\times\theta$ using the  moment condition $\mathbb{E}[\eta_{it} | \mathcal{I}_{it}] =\mathbb{E}\left[\eta_{it}|S_i\right]=0$, from where we have that
\begin{equation}\label{eq:fst_ident_theta}
\ln [\beta_M(S_i)\theta] = \mathbb{E}[v_{it}|S_i].
\end{equation}

To identify the material elasticity function $\beta_M(S_i)$ net of constant $\theta$, note that $\theta$ is
\begin{align}\label{eq:theta}
\theta&\equiv \mathbb{E}\left[\exp\left\{ \eta_{it}\right\} \right]=\mathbb{E}\left[\exp\left\{ \eta_{it}\right\} \right]
=\mathbb{E}\left[\exp\left\{ \mathbb{E}[v_{it}|S_i]-v_{it}\right\} \right],
\end{align}
which allows us to isolate $\beta_M(S_i)$ via
\begin{equation}\label{eq:fst_ident}
\beta_M(S_i) = \exp\left\{ \mathbb{E}[v_{it}|S_i] \right\}/
\mathbb{E}\left[\exp\left\{ \mathbb{E}[v_{it}|S_i]-v_{it}\right\} \right].
\end{equation}

By having identified the material elasticity function $\beta_M(S_i)$, we have effectively pinpointed the production technology in the dimension of its endogenous static input thereby effectively circumventing the \citet{gnr2013} critique. This is evident when \eqref{eq:prodfn_hicks_cd3} is rewritten as
\begin{equation}\label{eq:prodfn_hicks_cd4}
y_{it}^* = \beta_K(S_i) k_{it}+\beta_L(S_i)l_{it}+ \rho_0(S_i)+ \rho_1(S_i) \omega_{it-1}+\rho_2(S_i)G_{it-1} + \zeta_{it}+ \eta_{it} ,
\end{equation}
where $y_{it}^*\equiv y_{it} - \beta_M(S_i) m_{it}$ on the left-hand side is already identified/observable and, hence, model in \eqref{eq:prodfn_hicks_cd4} now contains \textit{no} endogenous regressors that need instrumentation.

\textsl{Second step}.\textemdash To identify the rest of the production function, we proxy for latent $\omega_{it-1}$ using the known functional form of the conditional material demand function implied by the static first-order condition in \eqref{eq:foc_cd} which we analytically invert for productivity. Namely, using the inverted (log) material function $\omega_{it}=\ln[ P_{t}^M/P_{t}^Y]-\beta_K(S_i) k_{it}-\beta_L(S_i)l_{it}-\ln [\beta_M(S_i)\theta]+[1-\beta_M(S_i)]m_{it}$ to substitute for $\omega_{it-1}$ in \eqref{eq:prodfn_hicks_cd4}, we get
\begin{align}\label{eq:sst}
y_{it}^* &= \beta_K(S_i) k_{it}+\beta_L(S_i)l_{it}+ \rho_0(S_i)+ \rho_1(S_i) \Big[\nu^*_{it-1}-\beta_K(S_i) k_{it-1}-\beta_L(S_i)l_{it-1}\Big]+\rho_2(S_i)G_{it-1} + \zeta_{it}+ \eta_{it} ,
\end{align}
where $\nu^*_{it-1}=\ln[ P_{t-1}^M/P_{t-1}^Y]-\ln [\beta_M(S_i)\theta]+[1-\beta_M(S_i)]m_{it-1}$ is already identified/observable and predetermined with respect to $\zeta_{it}+ \eta_{it}$.\footnote{{Following the convention {in the} literature \citep[e.g.,][]{op1996,lp2003,acf2015,dj2013,gnr2013}, we assume there is no measurement error in $m_{it}$. However, if the (log) material input is measured with errors, due to {the} reasons such as inventories, subcontracting and outsourcing, it will affect both the first- and the second-step estimation. More specifically, {adjusting} the first step is less problematic if {the measurement error is classical} since $m_{it}$ is in the dependent variable. However, {the second-step} equation \eqref{eq:sst} {will have a new} endogeneity issue due to the measurement error. In such a case, additional {identifying} assumptions are often needed; {see} \citet{hu2020estimating} for an example.}} All regressors in \eqref{eq:sst} are weakly exogenous, and this proxied model is identified based on the moment conditions:
\begin{equation}\label{eq:sst_ident}
\mathbb{E}[ \zeta_{t} + \eta_{t} |\ k_{it},l_{it},k_{it-1},l_{it-1},G_{it-1},\nu^*_{it-1}(m_{it-1}), S_{i} ] = 0.
\end{equation}

With the production technology and the transitory shock ${\eta}_{it}$ successfully identified in the two previous steps, we can readily recover $\omega_{it}$ from \eqref{eq:prodfn_hicks_cd2} via $\omega_{it}=y_{it}- \beta_K(S_i)k_{it}-\beta_L(S_i)l_{it}-\beta_M(S_i)m_{it}-\eta_{it}$.

Our identification methodology is also robust to the \citet{acf2015} critique that focuses on the inability of structural proxy estimators to separably identify the additive production function and productivity proxy. Such an issue normally arises in the wake of perfect functional dependence between freely varying inputs appearing both inside the unknown production function and productivity proxy. Our second-step equation \eqref{eq:sst} does not suffer from such a problem because it contains no (endogenous) variable input on the right-hand side, the corresponding elasticity of which has already been identified from the material share equation in the first step.

\subsection{Semiparametric Estimation}
\label{sec:estimation}

Given the semiparametric varying-coefficient specifications adopted for both the production technology [in \eqref{eq:prodfn_hicks_cd}] and productivity evolution [in \eqref{eq:productivity_hicks_lawsp}], we estimate both the first- and second-step equations \eqref{eq:fst} and \eqref{eq:sst} via \textit{local} least squares. We employ local-constant kernel fitting.

Denote the unknown $\ln [\beta_M(S_i)\theta]$ as some nonparametric function $b_M(S_i)$. Under the assumption that input elasticity functions are smooth and twice continuously differentiable in the neighborhood of $S_i=s$, unknown $b_M(S_i)$ can be locally approximated around $s$ via $b_M(S_i) \approx b_M(s)$ at points $S_i$ close to $s$, $|S_i-s|=o(1)$. Therefore, for locations $S_i$ in the neighborhood of $s$, we can approximate \eqref{eq:fst} by
\begin{equation}\label{eq:fst_est}
v_{it} \approx b_M(s) - \eta_{it} ,
\end{equation}
with the corresponding local-constant kernel estimator of $\ln [\beta_M(s)\theta]$ given by
\begin{equation}\label{eq:fst_est2_pre}
\widehat{b}_M(s) = \left[\sum_i\sum_t \mathcal{K}_{{h}_1}(S_i,s)\right]^{-1}\sum_i\sum_t \mathcal{K}_{{h}_1}(S_i,s)v_{it},
\end{equation}
where {$\mathcal{K}_{h_1}(S_i,s)$ is a kernel} that weights each observation on the basis of proximity of its $S_i$ value to $s$.

{To avoid over-smoothing in dense ranges of the support of the data while under-smoothing in
sparse tails, which a ``fixed'' bandwidth parameter is well-known to produce, we employ an ``adaptive'' bandwidth capable of adapting to the local distribution of the data. Specifically, to weight observations, we use an $h_1$-nearest-neighbor bandwidth $R_{h_1}(s)$ defined as the Euclidean distance between the fixed location $s$ and its $h_1$th nearest location among $\{S_i\}$, i.e.,
\begin{equation}\label{eq:knn-bw}
R_{h_1}(s)=\lVert S_{(h_1)}-s\lVert,
\end{equation}
where $S_{(h_1)}$ is the $h_1$th nearest neighbor of $s$. Evidently, $R_{h_1}(s)$ is just the $h_1$th order statistic on the distances $\lVert S_i-s\lVert$. It is $s$-specific and, hence, adapts to data distribution. Correspondingly, the kernel weight function is given by
\begin{equation}
 \mathcal{K}_{h_1}(S_i,s)=\mathsf{K}\left(\frac{\lVert S_i-s\lVert}{R_{h_1}(s)}\right) ,
\end{equation}
where $\mathsf{K}(\cdot)$ is a (non-negative) smooth kernel function such that $\int \mathsf{K}(\lVert u\lVert)du=1$; we use a second-order Gaussian kernel.

The key parameter here that controls the degree of smoothing in the first-step estimator \eqref{eq:fst_est2_pre} is the number of nearest neighbors (i.e., locations) $h_1$, which diverges to $\infty$ as $n\to \infty$ but slowly: $h_1/n\to 0$. We select the optimal $h_1$ using the data-driven cross-validation procedure. Also note that, despite the location $S_i$ being multivariate, the parameter $h_1$ is a scalar because it modulates a univariate quantity, namely the distance. Hence, the  bandwidth $R_{h_1}(s)$ is also scalar. That is, unlike in the case of a more standard kernel fitting based on fixed bandwidths when the data are weighted using the product of univariate kernels corresponding to each element in $S_i-s$, the adaptive kernel fitting weights data using a \textit{norm} of the vector $S_i-s$. For this reason, when employing nearest neighbor methods, the elements of smoothing variables  are typically rescaled so that they are all comparable because, when $S_i$ is multivariate, the nearest neighbor ordering is not scale-invariant. In our case however, we do \textit{not} rescale the elements of $S_i$ (i.e., latitude and longitude) because they are already measured on the same scale and the (partial) distances therein have a concrete physical interpretation.

From \eqref{eq:fst_ident},} the first-step estimator of $\beta_M(s)$ is
\begin{equation}\label{eq:fst_est2}
\widehat{\beta}_M(s) = nT\exp\left\{ \widehat{b}_M(s) \right\}\Big/ \sum_i\sum_t\exp\left\{ \widehat{b}_M(s)-v_{it}\right\} .
\end{equation}

We construct $\widehat{y}_{it}^*\equiv y_{it} - \widehat{\beta}_M(S_i) m_{it}$ and $\widehat{\nu}^*_{it-1}=\ln[ P_{t-1}^M/P_{t-1}^Y]-\ln [\widehat{\beta}_M(S_i)\theta]+[1-\widehat{\beta}_M(S_i)]m_{it-1}$ using the first-step local estimates of $\beta_M(S_i)$. Analogous to the first-step estimation, we then locally approximate each unknown parameter function in \eqref{eq:sst} around $S_i=s$ via local-constant approach. Therefore, for locations $S_i$ near $s$, we have
\begin{align}\label{eq:sst_est}
\widehat{y}_{it}^* &\approx \beta_K(s) k_{it}+\beta_L(s)l_{it}+ \rho_0(s)+ \rho_1(s) \Big[\widehat{\nu}^*_{it-1}-\beta_K(s) k_{it-1}-\beta_L(s)l_{it-1}\Big]+\rho_2(s)G_{it-1} + \zeta_{it}+ \eta_{it}.
\end{align}

Denoting all unknown parameters in \eqref{eq:sst_est} collectively as $\Theta(s)=[\beta_K(s),\beta_L(s),\rho_0(s),\rho_1(s),\rho_2(s)]'$, we estimate the second-step equation via locally weighted {nonlinear} least squares. The corresponding {kernel} estimator is
\begin{align}\label{eq:sst_est2}
\widehat{\Theta}(s) = \arg\min_{\Theta(s)}\ \sum_i\sum_t &\ \mathcal{K}_{{h}_2}(S_i,s)\Big( \widehat{y}_{it}^* - \beta_K(s) k_{it}-\beta_L(s)l_{it}\ - \notag \\
&\ \rho_0(s)- \rho_1(s) \Big[\widehat{\nu}^*_{it-1}-\beta_K(s) k_{it-1}-\beta_L(s)l_{it-1}\Big]+\rho_2(s)G_{it-1} \Big)^2,
\end{align}
where {$h_2$ is the number of nearest neighbors of a fixed location $s$ in the second-step estimation. It diverges faster than does the first-step smoothing parameter $h_1$} so that the first-step estimation has an asymptotically ignorable impact on the second step.

Lastly, the firm productivity is estimated as $\widehat{\omega}_{it}=y_{it}- \widehat{\beta}_K(S_i)k_{it}-\widehat{\beta}_L(S_i)l_{it}-\widehat{\beta}_M(S_i)m_{it}-\widehat{\eta}_{it}$ using the results from both steps.

\medskip

{
\noindent\textbf{Finite-Sample Performance.} Before applying our proposed methodology to the data, we first study its performance in a small set of Monte Carlo simulations. The results are encouraging, and simulation experiments show that our estimator recovers the true parameters well. As expected of a consistent estimator, the estimation becomes more stable as the sample size grows. For details, see Appendix \ref{sec:appex_sim}.

\medskip

\noindent\textbf{Inference.} Due to a multi-step nature of our estimator as well as the presence of nonparametric components, computation of the asymptotic variance of the estimators is not simple. For statistical inference, we therefore use bootstrap. We approximate sampling distributions of the estimators via wild residual block bootstrap that takes into account a panel structure of the data, with all the steps bootstrapped jointly owing to a sequential nature of our estimation procedure. The bootstrap algorithm is described in Appendix \ref{sec:appx_inference}.

\medskip

\noindent\textbf{Testing of Location Invariance.} Given that our semiparametric locationally varying production model nests a more traditional fixed-parameter specification that implies locational invariance of the production function and the productivity evolution as a special case, we can formally discriminate between the two models to see if the data support our more flexible modeling approach. We discuss this specification test in detail in Appendix \ref{sec:appx_test}.
}

\section{Locational Productivity Differential Decomposition}
\label{sec:decomposition_level}

Since the production function can vary across space, a meaningful comparison of productivity for firms dispersed across space now requires that locational differences in technology be explicitly controlled. That is, the productivity differential between two firms is no longer limited to the difference in their firm-specific total factor productivities $\omega_{it}$ (unless they both belong to the same location) because either one of the firms may have access to a more productive technology $F_S(\cdot)$. Given that locational heterogeneity in production is the principal focus of our paper, in what follows, we provide a procedure for measuring and decomposing firm productivity differentials across any two locations of choice.

Let $\mathcal{L}(s,t)$ represent a set of $n_{t}^s$ firms operating in location $s$ in the year $t$. For each of these firms, the estimated Cobb-Douglas production function (net of random shocks) in logs is
\begin{equation}\label{eq:prodfn_hicks_cd-s}
	\widehat{y}_{it}^s = \widehat{\beta}_K(s) k_{it}^s+\widehat{\beta}_L(s)l_{it}^s+\widehat{\beta}_M(s)m_{it}^s + \widehat{\omega}_{it}^s,
\end{equation}
where we have also explicitly indexed these firms' observable output/inputs as well as the estimated productivities using the location. Averaging over these firms, we arrive at the ``mean'' production function for location $s$ in time $t$:
\begin{equation}\label{eq:prodfn_hicks_cd-save}
\overline{y}_{t}^s = \widehat{\beta}_K(s) \overline{k}_{t}^s+\widehat{\beta}_L(s)\overline{l}_{t}^s+\widehat{\beta}_M(s)\overline{m}_{t}^s + \overline{\omega}_{t}^s,
\end{equation}
where $\overline{y}_{t}^s= \tfrac{1}{n^s_t}\sum_i\widehat{y}_{it}^s\mathbbm{1}\{i\in \mathcal{L}(s,t)\}$, $\overline{x}_{t}^s=\tfrac{1}{n^s_t}\sum_i x_{it}^s\mathbbm{1}\{i\in \mathcal{L}(s,t)\}$ for $x\in \{k,l,m\}$, and $\overline{\omega}_{t}^s= \tfrac{1}{n^s_t}\sum_i\widehat{\omega}_{it}^s\mathbbm{1}\{i\in \mathcal{L}(s,t)\}$.

Taking the difference between \eqref{eq:prodfn_hicks_cd-save} and the analogous mean production function for the benchmark location of interest $\kappa$ in the same year, we obtain the mean \textit{output} differential between these two locations {(in logs)}:
\begin{equation}\label{eq:prodfn_hicks_cd-skdif}
\underbrace{\overline{y}_{t}^s - \overline{y}_{t}^{\kappa}}_{\Delta\overline{y}_{t}^{s,\kappa}}= \left[\widehat{\beta}_K(s) \overline{k}_{t}^s+\widehat{\beta}_L(s)\overline{l}_{t}^s +\widehat{\beta}_M(s)\overline{m}_{t}^s\right] -
\left[\widehat{\beta}_K(\kappa) \overline{k}_{t}^{\kappa}+\widehat{\beta}_L(\kappa)\overline{l}_{t}^{\kappa} +\widehat{\beta}_M(\kappa)\overline{m}_{t}^{\kappa}\right]
+ \Big[ \overline{\omega}_{t}^s - \overline{\omega}_{t}^{\kappa}\Big] .
\end{equation}

To derive the mean \textit{productivity} differential (net of input differences) between these two locations, we add and subtract the $s$ location's production technology evaluated at the $\kappa$ location's inputs, i.e., \mbox{ $\left[\widehat{\beta}_K(s) \overline{k}_{t}^{\kappa}+\widehat{\beta}_L(s)\overline{l}_{t}^{\kappa} +\widehat{\beta}_M(s)\overline{m}_{t}^{\kappa}\right]$}, in \eqref{eq:prodfn_hicks_cd-skdif}:
\begin{align}\label{eq:prodfn_hicks_cd-decomp}
\Delta \overline{\text{PROD}}_{t}^{s,\kappa} &\equiv \Delta\overline{y}_{t}^{s,\kappa} - \widehat{\beta}_K(s) \Delta \overline{k}_{t}^{s,\kappa} -\widehat{\beta}_L(s)\Delta \overline{l}_{t}^{s,\kappa} -\widehat{\beta}_M(s)\Delta \overline{m}_{t}^{s,\kappa} \notag \\
& =\underbrace{\left[\widehat{\beta}_K(s)-\widehat{\beta}_K(\kappa)\right]  \overline{k}_{t}^{\kappa}+
\left[\widehat{\beta}_L(s)-\widehat{\beta}_L(\kappa)\right] \overline{l}_{t}^{\kappa} +
\left[\widehat{\beta}_M(s)-\widehat{\beta}_M(\kappa)\right] \overline{m}_{t}^{\kappa}}_{\Delta\overline{\text{TECH}}_{t}^{s,\kappa}} + \underbrace{\Big[ \overline{\omega}_{t}^s - \overline{\omega}_{t}^{\kappa}\Big]}_{\Delta\overline{\text{TFP}}_{t}^{s,\kappa}},
\end{align}
where  $\Delta\overline{x}_{t}^{s,\kappa}=\overline{x}_{t}^{s}-\overline{x}_{t}^{\kappa}$ for $x\in \{k,l,m\}$.

Equation \eqref{eq:prodfn_hicks_cd-decomp} measures mean productivity differential across space and provides a \textit{counterfactual} decomposition thereof. By utilizing the counterfactual output that, given its location-specific technology, the average firm in location $s$ would have produced using the mean inputs employed by the firms in location $\kappa$ in year $t$ $\big[\widehat{\beta}_K(s) \overline{k}_{t}^{\kappa}+\widehat{\beta}_L(s)\overline{l}_{t}^{\kappa} +\widehat{\beta}_M(s)\overline{m}_{t}^{\kappa}\big]$, we are able to measure the locational differential in the mean productivity of firms in the locations $s$ and $\kappa$ that is \textit{un}explained by their different input usage: $\Delta \overline{\text{PROD}}_{t}^{s,\kappa}$. More importantly, we can then decompose this locational differential in the total productivity into the contribution attributable to the  difference in production technologies $\Delta\overline{\text{TECH}}_{t}^{s,\kappa}$ and to the  difference in the average total-factor {operations efficiencies} $\Delta\overline{\text{TFP}}_{t}^{s,\kappa}$.

The locational productivity differential decomposition in \eqref{eq:prodfn_hicks_cd-decomp} is time-varying, but should one be interested in a scalar measure of locational heterogeneity for the entire sample period, time-specific averages can be replaced with the  ``grand'' averages computed by pooling over all time periods.

\section{Empirical Application}
\label{sec:application}

Using our proposed model and estimation methodology, we explore the locationally heterogeneous production technology among manufacturers in the Chinese chemical industry. We report location-specific elasticity and productivity estimates for these firms and then decompose differences in their productivity across space to study if the latter are mainly driven by the use of different production technologies or the underlying total factor productivity differentials.

\subsection{Data}
\label{sec:data}

We use the data from \citet{baltagietal2016}. The dataset is a panel of $n=12,490$  manufacturers of chemicals continuously observed over the 2004--2006 period ($T=3$). The industry includes manufacturing of basic chemical materials (inorganic acids and bases, inorganic salts and organic raw chemical materials), fertilizers, pesticides, paints, coatings and adhesives, synthetic materials (plastic, synthetic resin and fiber) as well as daily chemical products (soap and cleaning compounds). The original source of these firm-level data is the Chinese Industrial Enterprises Database survey conducted by China's National Bureau of Statistics (NBS) which covers all state-owned firms and all non-state-owned firms with sales above 5 million Yuan (about \$0.6 million). \citet{baltagietal2016} have geocoded the location of each firm at the zipcode level in terms of the longitude and latitude (the ``$S$'' variables) using their postcode information in the dataset. The  coordinates are constructed for the location of each firm's headquarters and are time-invariant. By focusing on the continually operating firms, we mitigate a potential impact of spatial sorting (as well as the attrition due to non-survival) on the estimation results and treat the firm location as fixed (exogenous). The total number of observations is 37,470.

Figure \ref{fig:number} shows the spatial distribution of firms in our dataset on a map of mainland China (we omit area in the West with no data in our sample). The majority are located on the East Coast and in the Southeast of China, especially around the Yangtze River Delta that is generally comprised of Shanghai and the surrounding areas, the southern Jiangsu province and the northern Zhejiang province.

\begin{table}[t]
	\centering
	\caption{Data Summary Statistics}\label{tab:datasummary}
	\footnotesize
	\makebox[\linewidth]{
		\begin{tabular}{lrrrr}
			\toprule[1pt]
			Variables& Mean & 1st Qu. & Median  & 3rd Qu.\\
			\midrule
			&\multicolumn{4}{c}{\it \textemdash Production Function Variables\textemdash} \\[2pt]
			Output         & 86,381.98 & 11,021.09 & 23,489.53 & 59,483.71 \\
			Capital      & 35,882.40  & 1,951.47 & 5,319.28 & 17,431.35 \\
			Labor       & 199.07  & 43.00       & 80.00       & 178.00      \\
			Materials      & 48,487.82 & 5,896.49 & 12,798.35 & 33,063.81 \\[2pt]

			&\multicolumn{4}{c}{\it \textemdash Productivity Controls\textemdash} \\[2pt]
			Skilled Labor Share  	& 0.174    & 0.042    & 0.111    & 0.242    \\
			Foreign Equity Share 	& 0.140     & 0.000        & 0.000        & 0.000        \\
			Exporter        & 0.237    &   &   &      \\
			State-Owned   & 0.051    &   &   &       \\[2pt]

			&\multicolumn{4}{c}{\it \textemdash Location Variables\textemdash} \\[2pt]
			Longitude     & 2.041    & 1.984    & 2.068    & 2.102    \\
			Latitude    & 0.557    & 0.504    & 0.547    & 0.632    \\
			\midrule
			\multicolumn{5}{p{9.3cm}}{\scriptsize Output, capital and materials are in 1,000s of 1998 RMB. Labor is measured in the number of employees. The skilled labor share and foreign equity share are unit-free proportions. The exporter and state-owned variables are binary indicators. The location coordinates are in radians.} \\
			\bottomrule[1pt]
		\end{tabular}
	}
\end{table}

The key production variables are defined as follows. Output ($Y$) is measured using sales. The labor input ($L$) is measured by the number of employees. Capital stock ($K$) is the net fixed assets for production and operation, and the materials ($M$) are defined as the expenditure on direct materials. Output, capital and materials are deflated to the 1998 values using the producer price index, the price index for investment in fixed assets and the purchasing price index for industrial inputs, respectively, where the price indices are obtained from the NBS. The unit of monetary values is thousands RMB (Chinese Yuan).

We include four productivity-modifying variables in the evolution process of firm productivity $\omega_{it}$: the share of high-skilled workers ($G_1$), which is defined as the fraction of workers with a university or comparable education and is time-invariant because the data on workers' education level are only available for 2004; the foreign equity share ($G_2$), which is measured by the proportion of equity provided by foreign investors; a binary export status indicator ($G_3$), which takes value one if the firm is an exporter and zero otherwise; and a binary state/public ownership status indicator ($G_4$), which takes value one if the firm is state-owned and zero otherwise.

Table \ref{tab:datasummary} shows the summary statistics, including the mean, 1st quartile, median and 3rd quartile for the variables. For the production-function variables, the mean values are significantly larger than their medians, which suggests that their distributions are skewed to the right. Among firms in the chemical industry, 23.7\% are exporters and 5.1\% are state-owned. Most firms do not have foreign investors, and the average ratio of foreign to total equity is 0.14. On average, 17.4\% of employees in the industry have a college degree or equivalent.

\subsection{Estimation Results}
\label{sec:results}

In order to estimate the locationally varying (semiparametric) production function and firm productivity process in \eqref{eq:prodfn_hicks_cd}--\eqref{eq:productivity_hicks_lawsp}, we use the data-driven leave-one-location-out cross-validation method to choose the optimal {number of nearest neighboring locations in each step of the estimation ($h_1$ and $h_2$) to smooth over ``contextual'' location variables} $S_i$ inside the unknown functional coefficients. {This smoothing parameters regulate} spatial weighting of neighboring firms in kernel {fitting} and, as noted earlier, by selecting it via a data-driven procedure, we avoid the need to rely on \textit{ad hoc} specifications of both the spatial weights and radii defining the extent of {neighborhood influences}. The optimal {$h_1$ and $h_2$ values are 520 and 340 firm-years in the first- and second-step estimation, respectively. On average across all $s$, the corresponding adaptive bandwidths are 0.0171 and 0.0169 radians.} These bandwidth values are reasonable, given our sample size and the standard deviations of the longitude and latitude,\footnote{For the reference, the sample standard deviations for the longitude and latitude are respectively 0.0889 and 0.0941 radians.} and, evidently, are \textit{not} too large to ``smooth out'' the firm location {to imply location invariance/homogeneity. In fact, we can argue this more formally if kernel-smoothing is done using \textit{fixed} bandwidths so that we can rely on the theoretical results by \citet{halletal2007}, whereby local-constant kernel methods can remove irrelevant regressors via data-driven over-smoothing (i.e., by selecting large bandwidths). When we re-estimate our locationally-varying model in this manner, the optimal fixed bandwidths for the longitude and latitude in the first-step estimation are 0.009 and 0.010 radians, respectively; the corresponding second-step bandwidths are 0.024 and 0.023 radians. Just like in the case of adaptive bandwidths, these bandwidth values are fairly small relative to variation in the data, providing strong evidence in support of the overall relevancy of geographic location for firm production (i.e., against location invariance). Our location-varying formulation of the production technology and productivity is also formally supported by the \citet{ullah1985} specification test described in Appendix \ref{sec:appx_test}. Using cross-validated fixed bandwidths,} the bootstrap $p$-value is {0.001.} At the conventional significance level, our locationally heterogeneous production model is confidently preferred to a location-invariant formulation.

{In what follows, we discuss our semiparametric results obtained using adaptive bandwidths. For inference, we use the bias-corrected bootstrap percentile intervals as described in Appendix \ref{sec:appx_inference}. The number of bootstrap replications is set to $B=1,000$.}

\paragraph{Production Function.} We first report production-function estimates from our main model in which the production technology is locationally heterogeneous. We then compare these estimates with those obtained from the more conventional, {location-invariant} model that \textit{a priori} assumes common production technology for all firms. {The latter ``global'' formulation of the production function postulates constancy of the production relationship over space. This model is therefore fully parametric (with constant coefficients) and a special case of our locationally-varying model when $S_i$ is fixed across all $i$. Its estimation is straightforward and follows directly from \eqref{eq:fst_est2_pre}--\eqref{eq:sst_est} by letting the adaptive bandwidths in both steps diverge to $\infty$ which, in effect, obviates the need to locally weight the data because all kernels will be the same (for details, see Appendix \ref{sec:appx_test}).}\footnote{{Following a suggestion provided by a referee, we also estimate the location-invariant model {with location fixed effects added to the production function during the estimation.} We find the results do not change much from including these location effects, and therefore these results are not reported.}}

\begin{table}[p]
	\centering
	\caption{Input Elasticity Estimates}\label{tab:coef}
	\footnotesize
	\makebox[\linewidth]{
		\begin{tabular}{lcccc|c}
			\toprule[1pt]
			& \multicolumn{4}{c}{\it Locationally Varying} & \it Location-Invariant \\
			& Mean & 1st Qu. & Median  & 3rd Qu.& Point Estimate\\
			\midrule

			Capital                  & 0.112           & 0.095            & 0.115           & 0.128          & 0.130             \\
			& (0.104, 0.130)  & (0.083, 0.116)   & (0.110, 0.130)    & (0.119, 0.147) & (0.118, 0.141)   \\
			Labor                    & 0.303           & 0.272            & 0.293           & 0.342          & 0.299            \\
			& (0.285, 0.308)  & (0.248, 0.284)    & (0.278, 0.293)  & (0.313, 0.356) & (0.280, 0.318)   \\
			Materials                 & 0.480           & 0.452            & 0.481           & 0.503          & 0.495            \\
			& (0.466, 0.501)  & (0.414, 0.467)     & (0.437, 0.502)   & (0.456, 0.524) & (0.460, 0.519)   \\
			\midrule
			\multicolumn{6}{p{13cm}}{\scriptsize The left panel summarizes point estimates of $\beta_{\kappa}(S_i)\ \forall\ \kappa\in\{K, L, M\}$ with the corresponding two-sided 95\% bias-corrected confidence intervals in parentheses. The right panel reports their counterparts from a fixed-coefficient location-invariant model. } \\
			\bottomrule[1pt]
		\end{tabular}
	}
\end{table}

\begin{figure}[p]
	\centering
	\includegraphics[scale=0.36]{capital.jpg}\includegraphics[scale=0.36]{labor.jpg}
	\includegraphics[scale=0.36]{material.jpg}\includegraphics[scale=0.36]{RTS.jpg}
	\caption{Input Elasticity Estimates \\ {\small (Notes: Vertical lines correspond to location-invariant estimates)}} \label{fig:coef_elas}
\end{figure}

Since our model has location-specific input elasticities, there is a distribution of them (over space) and Table \ref{tab:coef} summarizes their point estimates. The table also reports the elasticity estimates from the alternative, location-invariant model. The corresponding two-sided 95\% bias-corrected confidence intervals for these statistics are reported in parentheses. Based on our model, the mean (median) capital, labor and material elasticity estimates are {0.112, 0.303 and 0.480 (0.115, 0.293 and 0.481),} respectively. Importantly, these location-specific elasticities show significant variation. {For the capital and labor inputs, the first quartiles are significantly different from the third quartiles.} Within the inter-quartile interval of their point estimates, elasticities of capital, labor and materials respectively increase by {0.033, 0.070 and 0.051, which in turn correspond to the 35\%, 26\% and 11\% changes.}

In comparison, the elasticity estimates from the location-invariant production function with fixed coefficients are all larger than the corresponding {median} estimates from our model and fall in between the second and third quartiles of our locationally-varying point estimates. Figure \ref{fig:coef_elas} provides visualization of the non-negligible technological heterogeneity in the chemicals production technology across different locations in China, which the traditional location-invariant model assumes away. The figure plots histograms of the estimated location-specific input elasticities (and the returns to scale) with the location-invariant counterpart estimates depicted by vertical lines. Consistent with the results in Table \ref{tab:coef}, all distributions show relatively wide dispersion, and the locationally homogeneous {model} is apparently unable to provide a reasonable representation of production technology across different regions.

\begin{table}[t]
	\centering
	\caption{Locationally Varying Returns to Scale Estimates}\label{tab:RTC}
	\footnotesize
	\makebox[\linewidth]{
		\begin{tabular}{lcccc|cc}
			\toprule[1pt]
			& Mean & 1st Qu. & Median  & 3rd Qu.& $= 1$ &$<1$ \\
			\midrule
			RTS & 0.895          & 0.875          & 0.903         & 0.929              & 21.6\%            &  82.3\%        \\
			& (0.820, 0.931) & (0.801, 0.912) & (0.827, 0.942) & (0.855, 0.968) & &  \\
			\midrule
			\multicolumn{7}{p{11.8cm}}{\scriptsize The left panel summarizes point estimates of $\sum_{\kappa}\beta_{\kappa}(S_i)$ with $\kappa\in\{K, L, M\}$ with the corresponding two-sided 95\% bias-corrected confidence intervals in parentheses. The counterpart estimate of the returns to scale from a fixed-coefficient location-invariant model is 0.924 (0.865, 0.969). The right panel reports the shares of locations in which location-specific point estimates are (\textit{i}) not significantly different from 1 (constant returns to scale) and (\textit{ii}) statistically less than 1 (decreasing returns to scale). The former classification is based on a two-sided test, the latter is on a one-sided test.} \\
			\bottomrule[1pt]
		\end{tabular}
	}
\end{table}

Table \ref{tab:RTC} provides summary statistics of the estimated returns to scale (RTS) from our locationally varying production function (also see the bottom-right plot in Figure \ref{fig:coef_elas}). The mean RTS is {0.895, and the median is 0.903, with the inter-quartile range being 0.054.} The right panel of Table \ref{tab:RTC} reports the fraction of locations in which the Chinese manufacturers of chemicals exhibit constant or decreasing returns to scale. This classification is based on the RTS point estimate being statistically equal to or less than one, respectively, at the 5\% significance level. The ``$=1$'' classification is based on a two-sided test, whereas the ``$<1$'' test is one-sided. In most locations in China {(82.3\%)}, the production technologies of the chemicals firms exhibit \textit{dis}economies of scale, but {21.6\%} regions show evidence of the constant returns to scale (i.e., scale efficiency).

\begin{figure}[t]
	\centering
	\includegraphics[scale=0.3]{map.Returns.to.Scale.jpg}
	\caption{Spatial Distribution of Returns to Scale Estimates \\
		{\small	(Notes: The color shade cutoffs correspond to the first, second (median) and third quartiles)}  } \label{fig:rts}
\end{figure}

To further explore the locational heterogeneity in the production technology for chemicals in China, we plot the spatial distribution of the RTS estimates in the country in Figure \ref{fig:rts}. We find that the firms {with the largest RTS are mainly located in the Southeast Coast provinces and some parts of the West and Northeast China.} The area nearby Beijing also exhibits larger RTS. There are a few possible explanations of such a geographic distribution of the returns to scale. As noted earlier, spillovers and agglomeration have positive effects on the marginal productivity of inputs which typically take form of the scale effects, and they may explain the high RTS on the Southeast Coast and in the Beijing area. Locality-specific resources, culture and polices can also facilitate firms' production process. For example, the rich endowment of the raw materials like coal, phosphate rock and sulfur make the provinces such as Guizhou, Yunnan and Qinghai among the largest fertilizer production zones in China. Furthermore, RTS is also related to the life cycle of a firm. Usually, it is the small, young and fast-growth firms that enjoy higher RTS, whereas the more mature firms that have grown bigger will have transitioned to the low-RTS scale. This may explain the prevalence of the higher-RTS firms in the West and Northeast China.

\paragraph{Productivity Process.} We now analyze our semiparametric estimates of the firm productivity process in \eqref{eq:productivity_hicks_lawsp}. Table \ref{tab:prod.coef} summarizes point estimates of  the location-specific marginal effects of productivity determinants in the evolution process of $\omega_{it}$, with the corresponding two-sided 95\% bias-corrected confidence intervals in parentheses. In the last column of the left panel, for each productivity-enhancing control $G_{it}$, we also report the share of locations in which location-specific point estimates are statistically positive (at a 5\% significance level) as inferred via a one-sided test.

\begin{table}[p]
	\centering
	\caption{Productivity Process Coefficient Estimates}\label{tab:prod.coef}
	\footnotesize
	\makebox[\linewidth]{
		\begin{tabular}{lccccc|c}
			\toprule[1pt]
			          & \multicolumn{5}{c}{\it Locationally Varying} & \it Location-Invariant \\
			Variables& Mean & 1st Qu. & Median  & 3rd Qu.& $>0$ & Point Estimate\\
			\midrule
			Lagged Productivity        & 0.576 & 0.518 & 0.597 & 0.641 & 99.9\% & 0.497          \\
			& (0.540, 0.591) & (0.469, 0.541) & (0.553, 0.614) & (0.580, 0.665) &   & (0.455, 0.530)   \\
			Skilled Labor Share & 0.387 & 0.287 & 0.419 & 0.500  & 85.7\%  & 0.387            \\
			& (0.346, 0.395) & (0.241, 0.309) & (0.345, 0.459) & (0.471, 0.493) &   & (0.345, 0.425)    \\
			Foreign Equity Share         & 0.054 & --0.001 & 0.062 & 0.103 & 47.7\% & 0.056		            \\
			& (0.006, 0.074) & (--0.034, 0.066) & (0.033, 0.069) & (0.099, 0.099) &  & (0.036, 0.075) 	   \\
			Exporter              & --0.001 & --0.032 & --0.005 & 0.038 & 24.0\% & 0.006 	            \\
			& (--0.011, 0.018) & (--0.041, --0.016) & (--0.012, 0.013) & 	(0.025, 0.067) &  & (--0.008, 0.018) 	  \\
			State-Owned           & 0.005 & --0.052 & 0.007 & 	0.073 & 	29.6\% & 	--0.043            \\
			& (--0.021, 0.010) & 	(--0.101, --0.014) & (--0.028, 0.025) & 	(0.062, 0.076) &  & (--0.072, --0.009) 		 \\
			\midrule
			\multicolumn{7}{p{16.5cm}}{\scriptsize The left panel summarizes point estimates of $\rho_j(S_i)\ \forall\ j=1,\dots,\dim(G)$ with the corresponding two-sided 95\% bias-corrected confidence intervals in parentheses. Reported is also a share of locations in which location-specific point estimates are statistically positive as inferred via a one-sided test. The right panel reports the counterparts from a fixed-coefficient location-invariant model.} \\
			\bottomrule[1pt]
		\end{tabular}
	}
\end{table}

\begin{figure}[p]
	\centering
	\includegraphics[scale=0.33]{lag_productivity.jpg}
	\includegraphics[scale=0.33]{lag_share_of_skilled_labor.jpg}\includegraphics[scale=0.33]{lag_capital_ratio.jpg}
	\includegraphics[scale=0.33]{lag_export.jpg}\includegraphics[scale=0.33]{lag_state-owned.jpg}
	\caption{Productivity Process Coefficient Estimates \\ {\small (Notes: Vertical lines correspond to location-invariant estimates)}} \label{fig:coef_prod}
\end{figure}

The autoregressive coefficient on the lagged productivity, which measures the persistence of $\omega_{it}$, is {0.576 at the mean and 0.597 at the median, with the quartile statistics varying from 0.518 to 0.641.} It is significantly positive for firms in {virtually} all locations. For firms in most locations {(85.7\%)}, skilled labor has a large and significantly positive effect on productivity: a percentage point increase in the skilled labor share is associated with an improvement in the next period's firm productivity by about 0.4\%, on average. Point estimates of the foreign ownership effect are positive {in the majority of locations}, but firms in only about half the locations benefit from a statistically positive productivity-boosting effect of the inbound foreign direct investment, with the average magnitude of only {7/50} of that attributable to hiring more skilled labor. In line with the empirical evidence reported for China's manufacturing in the literature \citep[see][and references therein]{malikovetal2020}, firms in most regions show insignificant {(and negative)} effects of the export status on productivity. The ``learning by exporting'' effects are very limited and statistically positive in {a quarter} of locations only. Interestingly, we find that state/public ownership is a significantly positive contributor to the improvements in firm productivity in about a third of the locations in which the Chinese chemicals manufacturing firms operate. This may be because the less productive state firms exited the market during the market-oriented transition in the late 1990s and early 2000s (prior to our sample period), and the remaining state-owned firms are larger and more productive \citep[also see][]{hsiehsong2015,zhaoqiankumbhakar2020}. Another potential reason may be that state ownership could have brought non-trivial financing benefits to these firms which, otherwise, were usually financially constrained due to the under-developed financial market in China during that period.

The far right panel of Table \ref{tab:prod.coef} reports productivity effects of the $G_{it}$ controls estimated using the location-invariant model. Note that, under the assumption of a location-invariant production, the evolution process of $\omega_{it}$ becomes a parametric linear model, and there is only one point estimate of each fixed marginal effect for all firms. Comparing these estimates with the {median} estimates from our model, the location-invariant marginal effects tend to be smaller. While the persistence coefficient as well as fixed coefficients on the skilled labor and foreign equity shares are positive and statistically significant, the location-invariant estimate of the state ownership effect on productivity is however significantly negative (for all firms, by design). Together with the tendency of a location-invariant model to underestimate, this underscores the importance of allowing sufficient flexibility in modeling heterogeneity across firms (across different locations, in our case) besides the usual Hicks-neutral TFP.

The contrast between the two models is even more apparent in Figure \ref{fig:coef_prod}, which plots the distributions of estimated marginal effects of the productivity-enhancing controls. Like before, the location-invariant counterparts are depicted by vertical lines. The distribution of each productivity modifier spans a relatively wide range, and the corresponding location-invariant estimates are evidently not good representatives for the {centrality} of these distributions. For example, the productivity-boosting effect of the firm's skilled labor roughly varies between {0.06 and 0.61\% per unit percentage point increase in the skilled labor share, depending on the location.} The distribution of this marginal effect across locations is somewhat left-skewed, and the corresponding location-invariant effect estimate evidently does not measure central tendency of these locationally-varying effects well. Similar observations can be made about other varying coefficients in the productivity process.

\paragraph{Productivity Decomposition.} We now examine the average productivity differentials for firms in different regions. To this end, we perform the locational decomposition proposed in Section \ref{sec:decomposition_level} to identify the sources of production differences that cannot be explained by input usage. Recall that, by our decomposition, the locational differential in the mean total productivity ($\Delta \overline{\text{PROD}}^{s,\kappa}_t$) accounts for the cross-regional variation in both the input elasticities ($\Delta\overline{\text{TECH}}_{t}^{s,\kappa}$) and the total factor productivity ($\Delta\overline{\text{TFP}}^{s,\kappa}$). It is therefore more inclusive than the conventional analyses that rely on fitting a common production technology for all firms regardless of their locations and thus confine cross-firm heterogeneity to differences in $\omega_{it}$ only.

\begin{table}[t]
	\centering
	\caption{Locational Productivity Differential Decomposition}\label{tab:decom}
	\footnotesize
	\makebox[\linewidth]{
		\begin{tabular}{lcccc}
			\toprule[1pt]
			Components& Mean & 1st Qu. & Median  & 3rd Qu.\\
			\midrule
			& \multicolumn{4}{c}{\it Locationally Varying Model} \\
			$\Delta\overline{\text{TECH}}^{s,\kappa}$                 & 1.292 & 1.135 & 1.331 & 1.521         \\
			$\Delta\overline{\text{TFP}}^{s,\kappa}$                   & 0.574 & 0.203 & 0.571 & 0.893        \\
			$\Delta \overline{\text{PROD}}^{s,\kappa}$              & 1.866 & 1.652 & 1.869 & 2.086         \\
			\midrule
			& \multicolumn{4}{c}{\it Location-Invariant Model} \\
			$\Delta \overline{\text{PROD}}^{s,\kappa}$ & 1.797 & 1.589 & 1.816 & 2.040          \\
			\midrule
			\multicolumn{5}{p{7cm}}{\scriptsize The top panel summarizes point estimates of the locational mean productivity differential $\Delta \overline{\text{PROD}}^{s,\kappa}=\Delta\overline{\text{TECH}}^{s,\kappa}+ \Delta\overline{\text{TFP}}^{s,\kappa}$ with the corresponding two-sided 95\% bias-corrected confidence intervals in parentheses. The bottom panel reports the counterparts from a fixed-coefficient location-invariant model for which, by construction, $\Delta \overline{\text{PROD}}^{s,\kappa}= \Delta\overline{\text{TFP}}^{s,\kappa}$ with $\Delta\overline{\text{TECH}}^{s,\kappa}=0$. In both cases, the decomposition is pooled for the entire sample period and the benchmark/reference location $\kappa$ is the one with the smallest mean production: $\kappa=\arg\min_{s} \overline{y}^{s}$.} \\
			\bottomrule[1pt]
		\end{tabular}
	}
\end{table}

Table \ref{tab:decom} presents the decomposition results (across locations $s$) following \eqref{eq:prodfn_hicks_cd-decomp}. Because we just have three years of data, we perform the decomposition by pooling over the entire sample period. Thus, reported are the average decomposition results across 2002--2004. Also note that, for a fixed benchmark location $\kappa$, the decomposition is done for each $s$-location separately. For the benchmark/reference location $\kappa$, we choose the zipcode with the smallest mean production, i.e., $\kappa=\arg\min_{s} \overline{y}^{s}$, where $\overline{y}^{s}$ is defined as the time average of  \eqref{eq:prodfn_hicks_cd-save}.\footnote{Obviously, the choice of a reference location is inconsequential because its role is effectively that of a normalization.} Therefore, the numbers ($\times 100\%$) in Table \ref{tab:decom} can be interpreted as the percentage differences between the chemicals manufacturers operating in various locations ($s$) versus those from the least-production-scale region $(\kappa)$ in China. Because the reference location is fixed, the results are comparable across $s$.

Based on our estimates, the mean productivity differential is {1.866,} which means that, compared to the location with the smallest scale of chemicals production, other locations are, on average, {187\%} more productive (or more effective in the input usage). {The inter-quartile range of the average productivity differential spans from 1.652 and 2.086. Economically, these differences are large: firms that are located at the third quartile of the locational productivity distribution are about 43\% more productive than firms at the first quartile.} When we decompose the productivity differential into the technology and TFP differentials, on average, {$\Delta\overline{\text{TECH}}^{s,\kappa}$ is 2.3 times as large as $\Delta\overline{\text{TFP}}^{s,\kappa}$ and accounts for about 69\%} of the total productivity differences across locations.\footnote{That is, the ratio of $\Delta\overline{\text{TECH}}^{s,\kappa}$ to $\Delta\overline{\text{PROD}}^{s,\kappa}$ is 0.69.} This suggests that the cross-location {technological} heterogeneity in China's chemicals industry explains most of the productivity differential and that the regional {TFP differences are \textit{relatively} more modest.}

Table \ref{tab:decom} also summarizes the locational productivity differential estimates from the standard location-invariant model. Given that this model assumes fixed coefficients (same technology for all firms), we cannot perform a decomposition here, and all cross-location variation in productivity is \textit{a priori} attributed to TFP by design. Compared with our locationally-varying model, this model {yields similar} total productivity differentials across regions but, due to its inability to recognize technological differences, it {grossly} over-estimates cross-location differences in TFP.

\begin{figure}[t]
	\centering
	\includegraphics[scale=0.29]{map.Difference.in.Tchnologies.jpg}\includegraphics[scale=0.29]{map.Difference.in.Productivities.jpg}
	\caption{Locational Productivity Differential Decomposition Estimates Across Space \\ {\small (Notes: The color shade cutoffs correspond to the first, second (median) and third quartiles)} } \label{fig:decomposition_map}
\end{figure}

To explore the spatial heterogeneity in the decomposition components, we plot the spatial distributions of $\Delta\overline{\text{TECH}}^{s,\kappa}$, $\Delta\overline{\text{TFP}}^{s,\kappa}$ and $\Delta \overline{\text{PROD}}^{s,\kappa}$ on the map in Figure \ref{fig:decomposition_map}. The spatial distribution of $\Delta\overline{\text{TECH}}^{s,\kappa}$ aligns {remarkably} with that of RTS in Figure \ref{fig:rts}. Noticeably, the regions of agglomeration in the chemicals industry (see Figure \ref{fig:number}) tend to demonstrate large technology differentials. In contrast, the spatial distribution of $\Delta\overline{\text{TFP}}^{s,\kappa}$ shows quite a different pattern, whereby the locations of large TFP (differentials) are less concentrated. Unlike with the $\Delta\overline{\text{TECH}}^{s,\kappa}$ map, the dark-shaded regions on the $\Delta\overline{\text{TFP}}^{s,\kappa}$ map are widely spread around and have no clear overlapping with the main agglomeration regions in the industry. The comparison between these two maps suggests that, at least for the Chinese chemicals manufacturing firms, the widely-documented agglomeration effects on firm productivity are associated more with the scale effects via production technology rather than the improvements in overall TFP. That is, by locating closer to other firms in the same industry, it may be easier for a firm to pick up production technologies and know-hows that improve productiveness of inputs technologically and thus expand the input requirement set corresponding to the firm's output level\footnote{And more generally, shifting the \textit{family} of firm's isoquants corresponding to a fixed level of $\omega_{it}$ toward the origin.} \textit{given} its total factor productivity. Instead, agglomeration effects that increase the effectiveness of transforming all factors into the outputs via available technology (by adopting better business practices or management strategies) may be less likely to spill among the Chinese manufacturers of chemicals. Importantly, if we \textit{a priori} assume the fixed-coefficient production function common to all firms, the technological effects of agglomeration (via input elasticities) would be wrongly attributed to the TFP differentials.

\section{Concluding Remarks}
\label{sec:conclusion}

Although it is widely documented {in the operations management literature} that the firm's location matters for its performance, few empirical studies {of operations efficiency} explicitly control for it. {This paper fills in this gap by providing a semiparametric methodology for the} identification of production functions in which locational factors have heterogeneous effects on the firm's production technology and productivity evolution. {Our approach is novel in that we
explicitly model spatial variation in parameters in the production-function estimation.} We generalize the popular Cobb-Douglas production function in a semiparametric fashion by writing the input elasticities and productivity parameters as unknown functions of the firm's {geographic} location. In doing so, not only do we render the production {technology} location-specific but also accommodate {neighborhood influences on firm operations} with the strength thereof depending on the distance between {firms. Importantly, this enables us to examine the role of cross-location differences in explaining the variation in operational productivity among firms.

The proposed model is superior to the alternative SAR-type production-function formulations because it (i) explicitly estimates the locational variation in production functions, (ii) is readily reconcilable with the conventional production axioms and, more importantly, (iii) can be identified from the data by building on the popular proxy-variable methods, which we extend to incorporate locational heterogeneity in firm production.} Our methodology provides a practical tool for examining the effects of agglomeration and technology spillovers on firm performance {and will be most useful for empiricists focused on the analysis of operations efficiency/productivity and its ``determinants.''}

Using the methods proposed in our paper, we can {separate the effects of firm location on} production technology from those on firm productivity and find evidence consistent with the conclusion that agglomeration economies affect {the productivity of Chinese chemicals manufacturers mainly through the scale effects of production \textit{technology} rather than the improvements in overall TFP.} Comparing our flexible semiparametric model with the more conventional parametric model that postulates a common technology for all firms regardless of their location, we show that the latter does not provide {an adequate representation of} the industry and that the conclusion based on its results can be misleading. {For managerial implications, our study re-emphasizes the importance of firm location for its operations efficiency in manufacturing industries. Our findings also suggest that hiring skilled labor has a larger productivity effect compared to other widely-discussed productivity-enhancing techniques, such as learning by exporting. }

\section{Introduction}
\label{sec:introduction}

It is well-documented in management, economics as well as operations research that businesses, even in narrowly defined industries, are quite different from one another in terms of productivity. These cross-firm productivity differentials are large, persistent and ubiquitous \citep[see][]{syverson2011}. Research on this phenomenon is therefore unsurprisingly vast and includes attempts to explain it from the perspective of firms' heterogeneous behaviors in research and development \citep[e.g.,][]{griffithetal2004}, corporate operational strategies \citep{smithreece1999}, ability of the managerial teams \citep{demerjianetal2012}, ownership structure \citep{ehrlichetal1994}, employee training and education \citep{moretti2004}, allocation efficiency \citep{songetal2011}, participation in globalization \citep{grossmanhelpman2015} and many others. In most such studies, a common production function/technology is typically assumed for all firms within the industry, and the differences in { operations performance of firms} are {confined to} variation in the {``total factor productivity,''} the Solow residual {\citep{solow1957}}.\footnote{A few studies alternatively specify an ``augmented'' production function which, besides the traditional inputs, also admits various firm-specific shifters such as the productivity-modifying factors mentioned above. {But such studies continue to assume that the same technology frontier applies to all firms.}}

In this paper, we approach the {heterogeneity in firm performance} from a novel perspective in that we explicitly acknowledge the existence of locational effects on the {operations technology of firms} and their underlying productivity. {We} allow the firm-level production function to vary across space, thereby {accommodating potential neighborhood influences on firm production.} In doing so, we are able to examine the role of locational heterogeneity for cross-firm differences in {operations} performance{/efficiency}.

{A firm's location is important for its operations technology. For example, \citet{ketokivi2017locate} show that hospital location is significantly related to {its} performance and {that} a hospital’s choice of strategy can {help} moderate the effect of location {through} the interplay of {local} environmental factors with organizational strategy. As shown in Figure \ref{fig:number}, chemical enterprises in China, the focus of empirical analysis in this paper, are widely {(and unevenly)} distributed {across} space. {Given the sheer size of the country (it is the third largest by area), it is implausible that, even after controlling for firm heterogeneity, all these businesses operate using} the same production technology. Organizations in all industries\textemdash not only hospitals and chemical manufacturers\textemdash develop strategies to respond to {local environment} and {the associated} competitive challenges, and those strategies drive operational decisions regarding investments in new or updated technologies}.

\begin{figure}[t]
	\centering
	\includegraphics[scale=0.26]{map_number.jpg}
	\caption{Spatial Distribution of Manufacturers of Chemicals in China, 2004--2006} \label{fig:number}
\end{figure}

{Theoretically,} there are many reasons to believe that the production technology is location-specific. First, exogenous {local} endowments and institutional environments, such as {laws, regulations and local supply chains}, play a key role in determining firm performance. {The location of firms} {determines key linkages between {the} production, market, supply chain and product development \citep{goldsteinetal2002}}. If we look at the global distribution of the supply chains of many products, the product development and design is usually conducted in developed countries such as the U.S. and European countries, while the manufacturing and assembly process is performed in East Asian countries such as China and Vietnam. This spatial distribution largely reflects the endowment differences in factors of production (e.g., skilled vs.~unskilled labor) and the consequent relative input price differentials across countries.
Analogously, take the heterogeneity in endowment and institutions across different locations \textit{within} a country. There are many more world's leading universities on the East and West Coasts of the U.S.~than in the middle of the country, and they provide thousands of talented graduates each year to the regional development, bolstering growth in flagship industries such as banking and high-tech in those locations. In China, which our empirical application focuses on, networking and political connections are, anecdotally, the key factors for the success of a business in the Northeast regions, whereas the economy on the Southeast Coast is more market-oriented. Furthermore, there are many broadly defined special economics zones (SEZs) in China, which all are characterized by a small designated geographical area, local management, unique benefits and separate customs and administrative procedures \citep[see][]{craneetal2018}. According to a report from the China Development Bank, in 2014, there were 6 SEZs, 14 open coastal cities, 4 pilot free-trade areas and 5 financial reform pilot areas. There were also 31 bonded areas, 114 national high-tech development parks, 164 national agricultural technology parks, 85 national eco-industrial parks, 55 national eco-civilization demonstration areas and 283 national modern agriculture demonstration areas. They spread widely in China and support various economic functions, giving rise to locational heterogeneity in the country's production.

Second, most industries are geographically concentrated in general, whereby firms in the same or related industries tend to spatially cluster, benefiting from agglomeration economies reflected, among other things, in their production technologies that bring about localized \textit{aggregate} increasing returns. Ever since \citet{marshall1920} popularized these ideas, researchers have shown that industry concentration is too great to be explained solely by the differences in exogenous locational factors and that there are at least three behavioral micro-foundations for  agglomeration: benefits from labor market pooling/sharing, efficiency gains from the collocation of industries with input-output relationships that improves the quality of matches and technology spillovers  \citep[see][]{ellison_glaeser1999,duranton2004,ellisonetal2010,singh_marx2013}. The key idea of agglomeration economies is that geographic proximity reduces the transport costs of goods, people and, perhaps more importantly, ideas. While it is more intuitive that the movement of goods and people is hindered by spatial distance, the empirical evidence from prior studies shows that technology spillovers are also highly localized because knowledge transfers require interaction that proximity facilitates \citep[see][]{almeida_Kogut1999,alcacer_Chung2007,singh_marx2013}. Therefore, {owing to the role of local neighborhood influences,} firms that produce the same/similar products but are located in regions with different industry concentration levels are expected to enjoy different agglomeration effects on their {operations}.

Because location is an important factor affecting firm performance, previous empirical studies heavily rely on spatial econometrics to examine the locational/spatial effects on production. Oftentimes, spatially-weighted averages of other firms' outputs and inputs are included as additional regressors in spatial autoregressive (SAR) production-function models \citep[e.g.,][]{glassetal2016,glassetal2020,glassetal2020b, vidoli_Canello2016,serpakrishnan2018, glassetal2019,kutluetal2020,houetal2020}. The appropriateness of such {a conceptualization of firm-level production functions in the presence of locational influences} however remains unclear because {these SAR specifications are difficult to reconcile with the theory of firm.} For instance, the reduced form of such models effectively implies substitutability of the firm's inputs with those of its peers and does not rule out the possibility of the firm's output increasing when the neighboring firms use more inputs even if the firm itself keeps own inputs fixed { and the productivity remains the same. Further, these models continue to implausibly assume that all firms use the same production technology no matter their location. The practical implementation of SAR production-function models is, perhaps, even more problematic: (\textsl{i}) they imply additional, highly nonlinear parameter restrictions necessary to ensure that the conventional production axioms are not violated, and (\textsl{ii}) they are likely unidentifiable from the data given the inapplicability of available proxy-variable estimators and the pervasive lack of valid external instruments at the firm level. We discuss this in detail in Appendix \ref{sec:appx_sar}.}\footnote{But we should note that studies of the nexus between location/geography and firm performance in operations research and management are not all confined to the production theory paradigm; e.g., see \citet{bannisterstolp1995}, \citet{goldsteinetal2002}, \citet{kalnins2004,kalnins2006}, \citet{dahlsorenson2012} and \citet{kulchina2016}.}

In this paper, we consider a semiparametric production function in which both the {input-to-output transformation technology} and  productivity are location-specific. Concretely, using the location information for firms, we let the {input-elasticity} and productivity-process parameters be nonparametric functions of the firm's {geographic location (latitude and longitude)} and estimate these unknown functions via kernel methods. Our methodology captures the cross-firm spatial {influences} through local smoothing, whereby the production technology for each location is calculated as the geographically weighted average of the input-output \textit{relationships} for firms in the nearby locations with larger weights assigned to the firms that are more spatially proximate. This is fundamentally different from the SAR production-function models that formulate {neighborhood influences}  using spatially-weighed averages of the output/inputs \textit{quantities} while keeping the production technology the same for all firms. Consistent with the agglomeration literature, our approach implies that learning and knowledge spillovers are localized and that their chances/intensity diminish with distance. Importantly, by utilizing the data-driven selection of smoothing parameters that regulate spatial weighting of neighboring firms in kernel smoothing, we avoid the need to rely on \textit{ad hoc} specifications of the weighting schemes and spatial radii {of neighborhood influences like the} traditional SAR models do. It also allows us to be agnostic about the channels through which {firm location affects its production,} and our methodology inclusively captures all possible mechanisms of agglomeration economies.

{Our conceptualization of spatial influences by means of locationally-varying parameters is akin to the idea of ``geographically weighted regressions'' (GWR) introduced and popularized in the field of geography by \citet{bfc1996}; also see \citet{fbc-book} and many references therein. Just like ours, the GWR technique aims to model processes that are not constant over space but exhibit local variations and do so using a varying-coefficient specification estimated via kernel smoothing over locations. However, the principal\textemdash and non-trivial\textemdash distinction of our methodology from the GWR approach is in its emphasis on \textit{identification} of the spatially varying relationship. Concretely, for consistency and asymptotic unbiasedness the GWR methods rely on the assumption that (non-spatial) regressors in the relationship of interest are mean-orthogonal to the stochastic disturbance which rules out the presence of correlated unobservables as well as the potential simultaneity of regressors and the outcome variable for reasons other than spatial autoregression. The latter two are, however, more the rule rather than the exception for economic relations, which are affected by behavioral choices, including the firm-level production function.
Recovering the data generating process underlying the firm's production operations from observational data (i.e., its identification) requires tackling the correlation between regressors and the error term that the GWR cannot handle, making it unable to consistently estimate the production technology and firm productivity. This is precisely our focus.\footnote{In effect, our methodology constitutes a generalization of the GWR technique to accommodate endogenous regressors in the context of production-function estimation.}}

The identification of production functions in general, let alone with locational heterogeneity, is not trivial due to the endogeneity issue whereby the firm's input choices are correlated with its productivity. Complexity stems from the latency of firm productivity. Due to rather unsatisfactory performance of the conventional approaches to identification of production functions, such as fixed effects estimation or instrumentation using prices, there is a growing literature targeted at solving endogeneity using a proxy-variable approach \citep[e.g., see][]{op1996,lp2003,acf2015,gnr2013} which has gained wide popularity among empiricists.

To identify the locationally-varying production functions, we develop a semiparametric proxy-variable estimator that accommodates locational heterogeneity across firms. To this end, we build upon  \citet{gnr2013} whose framework we extend to incorporate spatial information about the firms in a semiparametric fashion. More specifically, we make use of the structural link between the production function (of the known varying-coefficient functional form) and the optimality condition for a flexible input derived from the firm's static expected profit maximization problem. We propose a two-step estimation procedure and, to approximate the unknown functional coefficients, employ  local-constant kernel fitting. Based on the estimated location-specific production functions, we further propose a locational productivity differential decomposition to break down the cross-region production differences that cannot be explained by input usage (i.e., the differential in ``total productivity'' of firms across locations) into the contributions attributable to differences in available production technologies  and to differences in {total-factor operations efficiency of firms.}

We apply our model to study locationally heterogeneous production technology among Chinese manufacturing firms in the chemical industry in 2002--2004. Based on the results of the data-driven cross-validation as well as formal statistical tests, the empirical evidence provides strong support to the importance and relevance of location for production. Qualitatively, we find that both technology and {firm} productivity vary significantly across regions. Firms are more likely to exhibit higher {(internal)} returns to scale in regions of agglomeration. However, the connection between {firm} productivity and industry concentration {across space} is unclear. The decomposition analysis reveals that differences in {\textit{technology} (as opposed to in idiosyncratic firm heterogeneity)} are the main source of cross-location total productivity differentials, on average {accounting for 2/3} of the differential.

To summarize, our contribution is as follows. We propose a semiparametric methodology to accommodates locational heterogeneity in the production-function estimation while maintaining the standard structural assumptions about firm production. {Unlike the available SAR-type alternatives, our model explicitly estimates the cross-locational variation in production technology.} To operationalize our methodology, we extend the widely-used proxy-variable identification methods to incorporate {firm location}. Our model as well as the proposed decomposition method for disentangling the effects of location on {firm} productivity from those on technological input-output relationship should provide a valuable addition to the toolkit of {empiricists} interested in studying agglomeration economies and technology spillovers. {In the context of operations management in particular, our methodology will be most useful for empirical studies focused on the analysis of operations efficiency/productivity and} {its ``determinants;'' \citep[e.g.,][are just a few recent examples of such analyses]{ross2004analysis,berenguer2016disentangling,jola2016effect,lam2016impact}. {In the case of multi-input production, the ``total factor productivity'' is among the most popular comprehensive measures of operations efficiency/productivity of the firm,} and our paper shows how to measure the latter robustly when production relationships are not constant over space {and are subject to neighborhood influences. This is particularly interesting because the effects of location, supply chain integration and agglomeration on firm performance have recently attracted much attention among researchers in operations management} \citep[e.g.,][]{goldsteinetal2002,ketokivi2017locate,flynn2010impact}.}

The rest of the paper is organized as follows. Section \ref{sec:model} describes the model of firm-level production {exhibiting} locational heterogeneity. We describe our identification and estimation strategy in Section \ref{sec:identification_estimation}. We provide the locational productivity differential decomposition in Section \ref{sec:decomposition_level}. The empirical application is presented in Section \ref{sec:application}. Section \ref{sec:conclusion} concludes. Supplementary materials are relegated to the Appendix.

\section{Locational Heterogeneity in Production}
\label{sec:model}

Consider the production process of a firm $i$ ($i=1,\dots,n$) in the time period $t$ ($t=1,\dots,T$) in which physical capital $K_{it} {\in\Re_{+}}$, labor $L_{it} {\in\Re_{+}}$ and an intermediate input such as materials $M_{it}{\in\Re_{+}}$ are  transformed into the output $Y_{it}{\in\Re_{+}}$ via a production function given the (unobserved) firm productivity. Also, let $S_{i}$ be the (fixed) location of firm $i$, with the obvious choice being $S_{i}=(\text{lat}_i,\text{long}_i)'$, where $\text{lat}_i$ and $\text{long}_i$ are the latitude and longitude coordinates of the firm's location. Then, the locationally varying production function is
\begin{equation}\label{eq:prodfn_hicks_f}
Y_{it} = F_{|S_{i}}(K_{it},L_{it},M_{it})\exp\left\{\omega_{it}\right\}\exp\left\{\eta_{it}\right\} ,
\end{equation}
where $F_{|S_{i}}(\cdot)$ is the firm's location-specific production {function} that {varies} over space (as captured by $S_i$) to accommodate locational heterogeneity in production technology, $\omega_{it}$ is the firm's persistent Hicks-neutral {total factor productivity capturing its operations efficiency}, and $\eta_{it}$ is a random transitory shock. Note that, so long as the firm's location is fixed, $\omega_{it}$ that persist for the same firm $i$, by implication, then also has the evolution process that is specific to this firm's location $S_i$; we expand on this below.

As in \citet{gnr2013}, \citet{malikovetal2020} and \citet{malikovzhao2021}, physical capital $K_{it}$ and labor $L_{it}$ are said to be subject to adjustment frictions (e.g., time-to-install, hiring/training costs), and the firm optimizes them dynamically at time $t-1$ rendering these predetermined inputs quasi-fixed at time $t$. Materials $M_{it}$ is a freely varying (flexible) input and is determined by the firm statically at time $t$. Thus, both $K_{it}$ and $L_{it}$ are the state variables with dynamic implications and follow their respective deterministic laws of motion:
\begin{equation}\label{eq:k_lawofmotion}
	K_{it}=I_{it-1}+(1-\delta)K_{it-1}\quad \text{and}\quad L_{it}=H_{it-1}+L_{it-1} ,
\end{equation}
where $I_{it}$, $H_{it}$ and $\delta$ are the gross investment, net hiring and the depreciation rate, respectively.

Following the convention, we assume that the risk-neutral firm maximizes a discounted stream of expected life-time profits in perfectly competitive output and factor markets subject to the state variables and expectations about the market structure variables including prices that are common to all firms.\footnote{{
We use the perfect competition and homogeneous price assumption mainly for two reasons: (\textsl{i}) it is the most widely used assumption in the literature on structural identification of production function and productivity, and (\textsl{ii}) this assumption has been {repeatedly} used {when} studying the same data as ours \citep[e.g.,][]{baltagietal2016,malikovetal2020}. Relaxing the perfect competition assumption is possible but non-trivial, and it requires additional assumptions {about} the output demand \citep[e.g.,][]{deLoecker2011product} and/or extra information on firm-specific output prices that are usually not available for manufacturing data \citep[e.g.,][]{deloeckeretal2016} {or imposing \textit{ex ante} structure on the returns to scale \citep[see][]{flynnetal2019}.} It is still a subject of ongoing research. Given {the emphasis of our contribution on incorporating \textit{technological} heterogeneity (associated with firm location, in our case) in the measurement of firm productivity, we opt} to keep all other aspects of {modeling} consistent with {the convention in the literature to ensure meaningful comparability with most available methodologies.}}} Also, for convenience, we denote $\mathcal{I}_{it}$ to be the information set available to the firm $i$ for making the period $t$ production decisions.

In line with the proxy variable literature, we model firm productivity $\omega_{it}$ as a first-order Markov process which we, however, endogenize \`a la \citet{dj2013} and \citet{deloecker2013} by incorporating productivity-enhancing and ``learning'' activities of the firm. To keep our model as general as possible, we denote all such activities via a generic variable $G_{it}$ which, depending on the empirical application of interest, may measure the firm's R\&D expenditures, foreign investments, export status/intensity, etc.\footnote{A scalar variable $G_{it}$ can obviously be replaced with a vector of such variables.} Thus, $\omega_{it}$ evolves according to a location-inhomogeneous controlled first-order Markov processes with transition probability $\mathcal{P}^{\omega}_{|S_i}(\omega_{it}|\omega_{it-1},G_{it-1})$. This implies the following location-specific mean regression for firm productivity:
\begin{equation}\label{eq:productivity_hicks_law}
\omega_{it}=h_{|S_i}\left(\omega_{it-1},G_{it-1}\right)+\zeta_{it},
\end{equation}
where $h_{|S_i}(\cdot)$ is the location-specific conditional mean function of $\omega_{it}$, and $\zeta_{it}$ is a random innovation unanticipated by the firm at period $t-1$ and normalized to zero mean:
$ \mathbb{E}\left[\zeta_{it} | \mathcal{I}_{it-1}\right]=\mathbb{E}\left[\zeta_{it}\right]=0$.

The evolution process in \eqref{eq:productivity_hicks_law} implicitly assumes that productivity-enhancing activities and learning take place with a delay which is why the dependence of $\omega_{it}$ on a control $G_{it}$ is lagged implying that the improvements in firm productivity take a period to materialize. Further, in $\mathbb{E}[\zeta_{it} |\ \mathcal{I}_{it-1}]=0$ we assume that, due to adjustment costs, firms do not experience changes in their productivity-enhancing investments in light of expected \textit{future} productivity innovations. Since the innovation $\zeta_{it}$ represents inherent uncertainty about productivity evolution as well as the uncertainty about the success of productivity-enhancing activities, the firm relies on its knowledge of the \textit{contemporaneous} productivity  $\omega_{it-1}$ when choosing the level of $G_{it-1}$ in period $t-1$ while being unable to anticipate $\zeta_{it}$. These structural timing assumptions are commonly made in models with controlled productivity processes \citep[e.g.,][]{vanbiesebroeck2005, dj2013,dj2018, deloecker2013, malikovetal2020,malikovzhao2021} and are needed to identify the within-firm productivity-improving learning effects.

We now formalize the firm's optimization problem in line with the above discussion. Under risk neutrality, the firm's optimal choice of freely varying input $M_{it}$ is described by the (static) restricted expected profit-maximization problem subject to the already optimal dynamic choice of quasi-fixed inputs:
\begin{align}\label{eq:profitmax}
\max_{M_{it}}\ P_{t}^Y F_{|S_i}(K_{it},L_{it},M_{it})\exp\left\{\omega_{it}\right\}\theta  - P_{t}^M M_{it} ,
\end{align}
where $P_{t}^Y$ and $P_{t}^M$ are respectively the output and material prices that, given the perfect competition assumption, need not vary across firms; and $\theta\equiv\mathbb{E}[\exp\{\eta_{it}\}|\ \mathcal{I}_{it}]$. The first-order condition corresponding to this optimization yields the firm's conditional demand for $M_{it}$.

Building on \citeauthor{dj2018}'s (2013, 2018) treatment of productivity-enhancing R\&D investments (a potential choice of $G_{it}$ in our framework) as a contemporaneous decision, we describe the firm's dynamic optimization problem by the following Bellman equation:
\begin{align}\label{eq:bellman}
	\mathbb{V}_{t}\big(\Xi_{it}\big) = &\max_{I_{it},H_{it},G_{it}} \Big\{ \Pi_{t|S_i}(\Xi_{it}) -
	\text{C}^{I}_{t}(I_{it}) -
	\text{C}^{H}_{t}(H_{it})-
	\text{C}^{G}_{t}(G_{it}) + \mathbb{E}\Big[\mathbb{V}_{t+1}\big(\Xi_{it+1}\big) \Big| \Xi_{it},I_{it},H_{it},G_{it}\Big]\, \Big\} ,
\end{align}
where $\Xi_{it}=(K_{it},L_{it},\omega_{it})'\in \mathcal{I}_{it}$ are the state variables;\footnote{The firm's location $S_i$ is suppressed in the list of state variables due to its time-invariance.} $\Pi_{t|S_i}(\Xi_{it})$ is the restricted profit function derived as a value function corresponding to the static problem in \eqref{eq:profitmax}; and $\text{C}^{\kappa}_t(\cdot)$ is the cost function for capital ($\kappa=I$), labor ($\kappa=H$) and productivity-enhancing activities ($\kappa=G$).\footnote{The assumption of separability of cost functions is unimportant, and one can reformulate \eqref{eq:bellman} using one $\text{C}_{t}(I_{it},H_{it},G_{it})$ for all dynamic production variables.} In the above dynamic problem, the level of productivity-enhancing activities $G_{it+1}$ is chosen in time period $t+1$ unlike the amounts of dynamic inputs $K_{it+1}$ and $L_{it+1}$ that are chosen by the firm in time period $t$ (via $I_{it}$ and $H_{it}$, respectively). Solving \eqref{eq:bellman} for $I_{it}$, $H_{it}$ and $G_{it}$ yields their respective optimal policy functions.

{An important assumption of our structural model of firm production in the presence of locational heterogeneity is that firm location $S_i$ is both fixed and exogenous. However, the identification of locational heterogeneity in production may be complicated by the potentially endogenous spatial sorting problem, whereby more productive firms might \textit{ex ante} sort into the what-then-become high productivity locations. Under this scenario, when we compare firm productivity and technology across locations, we may mistakenly attribute gradients therein to the locational effects such as agglomeration and neighborhood influences, while in actuality it may be merely reflecting the underlying propensity of all firms in a given location to be more productive \textit{a priori}. While there has recently been notable progress in formalizing and understanding these coincident phenomena theoretically \citep[e.g.,][]{behrensetal2014,gaubert2018}, disentangling firm sorting and spatial agglomeration remains a non-trivial task empirically.\footnote{Urban economics literature also distinguishes the third endogenous process usually referred to as the ``selection'' which differs from sorting  in that it occurs \textit{ex post} after the firms had self-sorted into locations and which determines their continuing survival. We abstract away from this low-productivity-driven attrition issue in the light of the growing empirical evidence suggesting that it explains none of spatial productivity differences which, in contrast, are mainly driven by agglomeration economies \citep[see][]{combesetal2012}. Relatedly, the firm attrition out of the sample has also become commonly accepted as a practical non-issue in the productivity literature so long as the data are kept unbalanced. For instance, \citet[][p.324]{lp2003} write: ``The original work by Olley and Pakes devoted significant effort to highlighting the importance of not using an artificially balanced sample (and the selection issues that arise with the balanced sample). They also show once they move to the unbalanced panel, their selection correction does not change their results.''}
However, by including the firm’s own lagged productivity in the autoregressive $\omega_{it}$ process in \eqref{eq:productivity_hicks_law}, we are able (at least to some extent) to account for this potential self-sorting because sorting into locations is heavily influenced by the firm's own productivity (oftentimes stylized as the ``talent'' or ``efficiency'' in theoretical models). That is, the locational heterogeneity in firm productivity and technology in our model is measured after partialling out the contribution of its own past productivity. Incidentally, \citet{deloecker2013} argues the same in the context of productivity effects of exporting and self-selection of exporters.}

\section{Methodology}
\label{sec:identification_estimation}

This section describes our strategy for (structural) identification and estimation of the firm's location-specific production technology and unobserved productivity.

Following the popular practice in the literature \citep[e.g., see][]{op1996,lp2003, dj2013,acf2015,collarddeloecker2015, koningsvanormelingen2015}, we assume the Cobb-Douglas specification for the production function which we adapt to allow for potential locational heterogeneity in production. We do so in a semiparametric fashion as follows:
\begin{equation}\label{eq:prodfn_hicks_cd}
\ln F_{|S_i}(\cdot) = \beta_K(S_i) k_{it}+\beta_L(S_i)l_{it}+\beta_M(S_i)m_{it} ,
\end{equation}
where the lower-case variables denote the logs of the corresponding upper-case variables, and the input elasticity functions $[\beta_K(\cdot),\beta_L(\cdot),\beta_M(\cdot)]'$ are unspecified {smooth} functions of the firm's location $S_i$. {The local smoothness feature of the production {relationship}, including both {the} input elasticities and persistent productivity {process below}, captures the effects of technology spillovers and agglomeration economies} {that give rise to local neighborhood influences}. Our methodology can also adopt more
flexible specifications such as the log-quadratic translog, which provides a natural extension of the log-linear Cobb-Douglas form. See Appendix \ref{sec:appx_tl} for the details on this extension.

Before proceeding further, we formalize the location-specific autoregressive conditional mean function of $\omega_{it}$ in its evolution process  \eqref{eq:productivity_hicks_law}. Following \citet{dj2013,dj2019}, \citet{acf2015}, \citet{griecoetal2016,griecoetal2019} and many others, we adopt a parsimonious first-order autoregressive specification of the Markovian evolution for productivity but take a step further by assuming a more flexible semiparametric location-specific formulation akin to that for the production technology in \eqref{eq:prodfn_hicks_cd}:
\begin{equation}\label{eq:productivity_hicks_lawsp}
h_{|S_i}(\cdot ) = \rho_0(S_i)+ \rho_1(S_i) \omega_{it-1}+\rho_2(S_i)G_{it-1}.
\end{equation}

\subsection{Proxy Variable Identification}
\label{sec:identification}

Substituting for $F_{|S_i}(\cdot)$ in the locationally varying production function \eqref{eq:prodfn_hicks_f} using \eqref{eq:prodfn_hicks_cd},  we obtain
\begin{align}
y_{it} &= \beta_K(S_i) k_{it}+\beta_L(S_i)l_{it}+\beta_M(S_i)m_{it} + \omega_{it}+ \eta_{it} \label{eq:prodfn_hicks_cd2} \\
&= \beta_K(S_i) k_{it}+\beta_L(S_i)l_{it}+\beta_M(S_i)m_{it} +  \rho_0(S_i)+ \rho_1(S_i) \omega_{it-1}+\rho_2(S_i)G_{it-1} + \zeta_{it}+ \eta_{it}, \label{eq:prodfn_hicks_cd3}
\end{align}
where we have also used the Markov process for $\omega_{it}$ from \eqref{eq:productivity_hicks_law} combined with \eqref{eq:productivity_hicks_lawsp} in the second line.

Under our structural assumptions, all right-hand-side covariates in \eqref{eq:prodfn_hicks_cd3} are predetermined and weakly exogenous with respect to $\zeta_{it} + \eta_{it}$, except for the freely varying input $m_{it}$ that the firm chooses in time period $t$ conditional on $\omega_{it}$ (among other state variables) thereby making it a function of $\zeta_{it}$. That is, $m_{it}$ is endogenous.

Prior to finding ways to tackle the endogeneity of $m_{it}$, to consistently estimate \eqref{eq:prodfn_hicks_cd3}, we first need to address the latency of firm productivity $\omega_{it-1}$. A popular solution is a proxy variable approach \`a la \citet{lp2003} whereby latent productivity is controlled for by inverting the firm's conditional demand for an observable static input such as materials. However, such a standard proxy approach generally fails to identify the firm's production function and productivity due to the lack of a valid instrument (from within the production function) for the endogenous $m_{it}$ despite the abundance of predetermined lags of inputs. As recently shown by \citet{gnr2013}, identification cannot be achieved using the standard procedure because \textit{no} exogenous higher-order lag provides excluded relevant variation for $m_{it}$ after conditioning the model on the already included self-instrumenting variables. As a result, the production function remains unidentified in flexible inputs. In order to solve this under-identification problem, \citet{gnr2013} suggest exploiting a structural link between the production function and the firm's (static) first-order condition for the freely varying input. In what follows, we build on this idea which we modify along the lines of \citet{dj2013} and \citet{malikovzhao2021} in explicitly making use of the assumed functional form of production technology.

\textsl{First step}.\textemdash We first focus on the identification of production function in its flexible input $m_{it}$. Specifically, given the technology specification in \eqref{eq:prodfn_hicks_cd}, we seek to identify the material elasticity function $\beta_M(S_i)$. To do so, we consider an equation for the firm's first-order condition for the static optimization in \eqref{eq:profitmax}. The optimality condition with respect to $M_{it}$ in logs is given by (in logs)
\begin{equation}\label{eq:foc_cd}
\ln P_{t}^Y+\beta_K(S_i) k_{it}+\beta_L(S_i)l_{it}+\ln \beta_M(S_i)+[\beta_M(S_i)-1]m_{it} + \omega_{it}+ \ln \theta = \ln P_{t}^M ,
\end{equation}
which can be transformed by subtracting the production function in \eqref{eq:prodfn_hicks_cd2} from it to obtain the following location-specific material share equation:
\begin{equation}\label{eq:fst}
v_{it} = \ln [\beta_M(S_i)\theta] - \eta_{it} ,
\end{equation}
where $v_{it} \equiv \ln \left(P_{t}^M M_{it}\right)-\ln \left( P_{t}^Y Y_{it}\right)$ is the log nominal share of material costs in total revenue, which is observable in the data.

The material share equation in \eqref{eq:fst} is powerful in that it enables us to identify unobservable material elasticity function $\beta_M(S_i)$ using the information about the log material share $v_{it}$. Specifically, we first identify a ``scaled'' material elasticity function $\beta_M(S_i)\times\theta$ using the  moment condition $\mathbb{E}[\eta_{it} | \mathcal{I}_{it}] =\mathbb{E}\left[\eta_{it}|S_i\right]=0$, from where we have that
\begin{equation}\label{eq:fst_ident_theta}
\ln [\beta_M(S_i)\theta] = \mathbb{E}[v_{it}|S_i].
\end{equation}

To identify the material elasticity function $\beta_M(S_i)$ net of constant $\theta$, note that $\theta$ is
\begin{align}\label{eq:theta}
\theta&\equiv \mathbb{E}\left[\exp\left\{ \eta_{it}\right\} \right]=\mathbb{E}\left[\exp\left\{ \eta_{it}\right\} \right]
=\mathbb{E}\left[\exp\left\{ \mathbb{E}[v_{it}|S_i]-v_{it}\right\} \right],
\end{align}
which allows us to isolate $\beta_M(S_i)$ via
\begin{equation}\label{eq:fst_ident}
\beta_M(S_i) = \exp\left\{ \mathbb{E}[v_{it}|S_i] \right\}/
\mathbb{E}\left[\exp\left\{ \mathbb{E}[v_{it}|S_i]-v_{it}\right\} \right].
\end{equation}

By having identified the material elasticity function $\beta_M(S_i)$, we have effectively pinpointed the production technology in the dimension of its endogenous static input thereby effectively circumventing the \citet{gnr2013} critique. This is evident when \eqref{eq:prodfn_hicks_cd3} is rewritten as
\begin{equation}\label{eq:prodfn_hicks_cd4}
y_{it}^* = \beta_K(S_i) k_{it}+\beta_L(S_i)l_{it}+ \rho_0(S_i)+ \rho_1(S_i) \omega_{it-1}+\rho_2(S_i)G_{it-1} + \zeta_{it}+ \eta_{it} ,
\end{equation}
where $y_{it}^*\equiv y_{it} - \beta_M(S_i) m_{it}$ on the left-hand side is already identified/observable and, hence, model in \eqref{eq:prodfn_hicks_cd4} now contains \textit{no} endogenous regressors that need instrumentation.

\textsl{Second step}.\textemdash To identify the rest of the production function, we proxy for latent $\omega_{it-1}$ using the known functional form of the conditional material demand function implied by the static first-order condition in \eqref{eq:foc_cd} which we analytically invert for productivity. Namely, using the inverted (log) material function $\omega_{it}=\ln[ P_{t}^M/P_{t}^Y]-\beta_K(S_i) k_{it}-\beta_L(S_i)l_{it}-\ln [\beta_M(S_i)\theta]+[1-\beta_M(S_i)]m_{it}$ to substitute for $\omega_{it-1}$ in \eqref{eq:prodfn_hicks_cd4}, we get
\begin{align}\label{eq:sst}
y_{it}^* &= \beta_K(S_i) k_{it}+\beta_L(S_i)l_{it}+ \rho_0(S_i)+ \rho_1(S_i) \Big[\nu^*_{it-1}-\beta_K(S_i) k_{it-1}-\beta_L(S_i)l_{it-1}\Big]+\rho_2(S_i)G_{it-1} + \zeta_{it}+ \eta_{it} ,
\end{align}
where $\nu^*_{it-1}=\ln[ P_{t-1}^M/P_{t-1}^Y]-\ln [\beta_M(S_i)\theta]+[1-\beta_M(S_i)]m_{it-1}$ is already identified/observable and predetermined with respect to $\zeta_{it}+ \eta_{it}$.\footnote{{Following the convention {in the} literature \citep[e.g.,][]{op1996,lp2003,acf2015,dj2013,gnr2013}, we assume there is no measurement error in $m_{it}$. However, if the (log) material input is measured with errors, due to {the} reasons such as inventories, subcontracting and outsourcing, it will affect both the first- and the second-step estimation. More specifically, {adjusting} the first step is less problematic if {the measurement error is classical} since $m_{it}$ is in the dependent variable. However, {the second-step} equation \eqref{eq:sst} {will have a new} endogeneity issue due to the measurement error. In such a case, additional {identifying} assumptions are often needed; {see} \citet{hu2020estimating} for an example.}} All regressors in \eqref{eq:sst} are weakly exogenous, and this proxied model is identified based on the moment conditions:
\begin{equation}\label{eq:sst_ident}
\mathbb{E}[ \zeta_{t} + \eta_{t} |\ k_{it},l_{it},k_{it-1},l_{it-1},G_{it-1},\nu^*_{it-1}(m_{it-1}), S_{i} ] = 0.
\end{equation}

With the production technology and the transitory shock ${\eta}_{it}$ successfully identified in the two previous steps, we can readily recover $\omega_{it}$ from \eqref{eq:prodfn_hicks_cd2} via $\omega_{it}=y_{it}- \beta_K(S_i)k_{it}-\beta_L(S_i)l_{it}-\beta_M(S_i)m_{it}-\eta_{it}$.

Our identification methodology is also robust to the \citet{acf2015} critique that focuses on the inability of structural proxy estimators to separably identify the additive production function and productivity proxy. Such an issue normally arises in the wake of perfect functional dependence between freely varying inputs appearing both inside the unknown production function and productivity proxy. Our second-step equation \eqref{eq:sst} does not suffer from such a problem because it contains no (endogenous) variable input on the right-hand side, the corresponding elasticity of which has already been identified from the material share equation in the first step.

\subsection{Semiparametric Estimation}
\label{sec:estimation}

Given the semiparametric varying-coefficient specifications adopted for both the production technology [in \eqref{eq:prodfn_hicks_cd}] and productivity evolution [in \eqref{eq:productivity_hicks_lawsp}], we estimate both the first- and second-step equations \eqref{eq:fst} and \eqref{eq:sst} via \textit{local} least squares. We employ local-constant kernel fitting.

Denote the unknown $\ln [\beta_M(S_i)\theta]$ as some nonparametric function $b_M(S_i)$. Under the assumption that input elasticity functions are smooth and twice continuously differentiable in the neighborhood of $S_i=s$, unknown $b_M(S_i)$ can be locally approximated around $s$ via $b_M(S_i) \approx b_M(s)$ at points $S_i$ close to $s$, $|S_i-s|=o(1)$. Therefore, for locations $S_i$ in the neighborhood of $s$, we can approximate \eqref{eq:fst} by
\begin{equation}\label{eq:fst_est}
v_{it} \approx b_M(s) - \eta_{it} ,
\end{equation}
with the corresponding local-constant kernel estimator of $\ln [\beta_M(s)\theta]$ given by
\begin{equation}\label{eq:fst_est2_pre}
\widehat{b}_M(s) = \left[\sum_i\sum_t \mathcal{K}_{{h}_1}(S_i,s)\right]^{-1}\sum_i\sum_t \mathcal{K}_{{h}_1}(S_i,s)v_{it},
\end{equation}
where {$\mathcal{K}_{h_1}(S_i,s)$ is a kernel} that weights each observation on the basis of proximity of its $S_i$ value to $s$.

{To avoid over-smoothing in dense ranges of the support of the data while under-smoothing in
sparse tails, which a ``fixed'' bandwidth parameter is well-known to produce, we employ an ``adaptive'' bandwidth capable of adapting to the local distribution of the data. Specifically, to weight observations, we use an $h_1$-nearest-neighbor bandwidth $R_{h_1}(s)$ defined as the Euclidean distance between the fixed location $s$ and its $h_1$th nearest location among $\{S_i\}$, i.e.,
\begin{equation}\label{eq:knn-bw}
R_{h_1}(s)=\lVert S_{(h_1)}-s\lVert,
\end{equation}
where $S_{(h_1)}$ is the $h_1$th nearest neighbor of $s$. Evidently, $R_{h_1}(s)$ is just the $h_1$th order statistic on the distances $\lVert S_i-s\lVert$. It is $s$-specific and, hence, adapts to data distribution. Correspondingly, the kernel weight function is given by
\begin{equation}
 \mathcal{K}_{h_1}(S_i,s)=\mathsf{K}\left(\frac{\lVert S_i-s\lVert}{R_{h_1}(s)}\right) ,
\end{equation}
where $\mathsf{K}(\cdot)$ is a (non-negative) smooth kernel function such that $\int \mathsf{K}(\lVert u\lVert)du=1$; we use a second-order Gaussian kernel.

The key parameter here that controls the degree of smoothing in the first-step estimator \eqref{eq:fst_est2_pre} is the number of nearest neighbors (i.e., locations) $h_1$, which diverges to $\infty$ as $n\to \infty$ but slowly: $h_1/n\to 0$. We select the optimal $h_1$ using the data-driven cross-validation procedure. Also note that, despite the location $S_i$ being multivariate, the parameter $h_1$ is a scalar because it modulates a univariate quantity, namely the distance. Hence, the  bandwidth $R_{h_1}(s)$ is also scalar. That is, unlike in the case of a more standard kernel fitting based on fixed bandwidths when the data are weighted using the product of univariate kernels corresponding to each element in $S_i-s$, the adaptive kernel fitting weights data using a \textit{norm} of the vector $S_i-s$. For this reason, when employing nearest neighbor methods, the elements of smoothing variables  are typically rescaled so that they are all comparable because, when $S_i$ is multivariate, the nearest neighbor ordering is not scale-invariant. In our case however, we do \textit{not} rescale the elements of $S_i$ (i.e., latitude and longitude) because they are already measured on the same scale and the (partial) distances therein have a concrete physical interpretation.

From \eqref{eq:fst_ident},} the first-step estimator of $\beta_M(s)$ is
\begin{equation}\label{eq:fst_est2}
\widehat{\beta}_M(s) = nT\exp\left\{ \widehat{b}_M(s) \right\}\Big/ \sum_i\sum_t\exp\left\{ \widehat{b}_M(s)-v_{it}\right\} .
\end{equation}

We construct $\widehat{y}_{it}^*\equiv y_{it} - \widehat{\beta}_M(S_i) m_{it}$ and $\widehat{\nu}^*_{it-1}=\ln[ P_{t-1}^M/P_{t-1}^Y]-\ln [\widehat{\beta}_M(S_i)\theta]+[1-\widehat{\beta}_M(S_i)]m_{it-1}$ using the first-step local estimates of $\beta_M(S_i)$. Analogous to the first-step estimation, we then locally approximate each unknown parameter function in \eqref{eq:sst} around $S_i=s$ via local-constant approach. Therefore, for locations $S_i$ near $s$, we have
\begin{align}\label{eq:sst_est}
\widehat{y}_{it}^* &\approx \beta_K(s) k_{it}+\beta_L(s)l_{it}+ \rho_0(s)+ \rho_1(s) \Big[\widehat{\nu}^*_{it-1}-\beta_K(s) k_{it-1}-\beta_L(s)l_{it-1}\Big]+\rho_2(s)G_{it-1} + \zeta_{it}+ \eta_{it}.
\end{align}

Denoting all unknown parameters in \eqref{eq:sst_est} collectively as $\Theta(s)=[\beta_K(s),\beta_L(s),\rho_0(s),\rho_1(s),\rho_2(s)]'$, we estimate the second-step equation via locally weighted {nonlinear} least squares. The corresponding {kernel} estimator is
\begin{align}\label{eq:sst_est2}
\widehat{\Theta}(s) = \arg\min_{\Theta(s)}\ \sum_i\sum_t &\ \mathcal{K}_{{h}_2}(S_i,s)\Big( \widehat{y}_{it}^* - \beta_K(s) k_{it}-\beta_L(s)l_{it}\ - \notag \\
&\ \rho_0(s)- \rho_1(s) \Big[\widehat{\nu}^*_{it-1}-\beta_K(s) k_{it-1}-\beta_L(s)l_{it-1}\Big]+\rho_2(s)G_{it-1} \Big)^2,
\end{align}
where {$h_2$ is the number of nearest neighbors of a fixed location $s$ in the second-step estimation. It diverges faster than does the first-step smoothing parameter $h_1$} so that the first-step estimation has an asymptotically ignorable impact on the second step.

Lastly, the firm productivity is estimated as $\widehat{\omega}_{it}=y_{it}- \widehat{\beta}_K(S_i)k_{it}-\widehat{\beta}_L(S_i)l_{it}-\widehat{\beta}_M(S_i)m_{it}-\widehat{\eta}_{it}$ using the results from both steps.

\medskip

{
\noindent\textbf{Finite-Sample Performance.} Before applying our proposed methodology to the data, we first study its performance in a small set of Monte Carlo simulations. The results are encouraging, and simulation experiments show that our estimator recovers the true parameters well. As expected of a consistent estimator, the estimation becomes more stable as the sample size grows. For details, see Appendix \ref{sec:appex_sim}.

\medskip

\noindent\textbf{Inference.} Due to a multi-step nature of our estimator as well as the presence of nonparametric components, computation of the asymptotic variance of the estimators is not simple. For statistical inference, we therefore use bootstrap. We approximate sampling distributions of the estimators via wild residual block bootstrap that takes into account a panel structure of the data, with all the steps bootstrapped jointly owing to a sequential nature of our estimation procedure. The bootstrap algorithm is described in Appendix \ref{sec:appx_inference}.

\medskip

\noindent\textbf{Testing of Location Invariance.} Given that our semiparametric locationally varying production model nests a more traditional fixed-parameter specification that implies locational invariance of the production function and the productivity evolution as a special case, we can formally discriminate between the two models to see if the data support our more flexible modeling approach. We discuss this specification test in detail in Appendix \ref{sec:appx_test}.
}

\section{Locational Productivity Differential Decomposition}
\label{sec:decomposition_level}

Since the production function can vary across space, a meaningful comparison of productivity for firms dispersed across space now requires that locational differences in technology be explicitly controlled. That is, the productivity differential between two firms is no longer limited to the difference in their firm-specific total factor productivities $\omega_{it}$ (unless they both belong to the same location) because either one of the firms may have access to a more productive technology $F_S(\cdot)$. Given that locational heterogeneity in production is the principal focus of our paper, in what follows, we provide a procedure for measuring and decomposing firm productivity differentials across any two locations of choice.

Let $\mathcal{L}(s,t)$ represent a set of $n_{t}^s$ firms operating in location $s$ in the year $t$. For each of these firms, the estimated Cobb-Douglas production function (net of random shocks) in logs is
\begin{equation}\label{eq:prodfn_hicks_cd-s}
	\widehat{y}_{it}^s = \widehat{\beta}_K(s) k_{it}^s+\widehat{\beta}_L(s)l_{it}^s+\widehat{\beta}_M(s)m_{it}^s + \widehat{\omega}_{it}^s,
\end{equation}
where we have also explicitly indexed these firms' observable output/inputs as well as the estimated productivities using the location. Averaging over these firms, we arrive at the ``mean'' production function for location $s$ in time $t$:
\begin{equation}\label{eq:prodfn_hicks_cd-save}
\overline{y}_{t}^s = \widehat{\beta}_K(s) \overline{k}_{t}^s+\widehat{\beta}_L(s)\overline{l}_{t}^s+\widehat{\beta}_M(s)\overline{m}_{t}^s + \overline{\omega}_{t}^s,
\end{equation}
where $\overline{y}_{t}^s= \tfrac{1}{n^s_t}\sum_i\widehat{y}_{it}^s\mathbbm{1}\{i\in \mathcal{L}(s,t)\}$, $\overline{x}_{t}^s=\tfrac{1}{n^s_t}\sum_i x_{it}^s\mathbbm{1}\{i\in \mathcal{L}(s,t)\}$ for $x\in \{k,l,m\}$, and $\overline{\omega}_{t}^s= \tfrac{1}{n^s_t}\sum_i\widehat{\omega}_{it}^s\mathbbm{1}\{i\in \mathcal{L}(s,t)\}$.

Taking the difference between \eqref{eq:prodfn_hicks_cd-save} and the analogous mean production function for the benchmark location of interest $\kappa$ in the same year, we obtain the mean \textit{output} differential between these two locations {(in logs)}:
\begin{equation}\label{eq:prodfn_hicks_cd-skdif}
\underbrace{\overline{y}_{t}^s - \overline{y}_{t}^{\kappa}}_{\Delta\overline{y}_{t}^{s,\kappa}}= \left[\widehat{\beta}_K(s) \overline{k}_{t}^s+\widehat{\beta}_L(s)\overline{l}_{t}^s +\widehat{\beta}_M(s)\overline{m}_{t}^s\right] -
\left[\widehat{\beta}_K(\kappa) \overline{k}_{t}^{\kappa}+\widehat{\beta}_L(\kappa)\overline{l}_{t}^{\kappa} +\widehat{\beta}_M(\kappa)\overline{m}_{t}^{\kappa}\right]
+ \Big[ \overline{\omega}_{t}^s - \overline{\omega}_{t}^{\kappa}\Big] .
\end{equation}

To derive the mean \textit{productivity} differential (net of input differences) between these two locations, we add and subtract the $s$ location's production technology evaluated at the $\kappa$ location's inputs, i.e., \mbox{ $\left[\widehat{\beta}_K(s) \overline{k}_{t}^{\kappa}+\widehat{\beta}_L(s)\overline{l}_{t}^{\kappa} +\widehat{\beta}_M(s)\overline{m}_{t}^{\kappa}\right]$}, in \eqref{eq:prodfn_hicks_cd-skdif}:
\begin{align}\label{eq:prodfn_hicks_cd-decomp}
\Delta \overline{\text{PROD}}_{t}^{s,\kappa} &\equiv \Delta\overline{y}_{t}^{s,\kappa} - \widehat{\beta}_K(s) \Delta \overline{k}_{t}^{s,\kappa} -\widehat{\beta}_L(s)\Delta \overline{l}_{t}^{s,\kappa} -\widehat{\beta}_M(s)\Delta \overline{m}_{t}^{s,\kappa} \notag \\
& =\underbrace{\left[\widehat{\beta}_K(s)-\widehat{\beta}_K(\kappa)\right]  \overline{k}_{t}^{\kappa}+
\left[\widehat{\beta}_L(s)-\widehat{\beta}_L(\kappa)\right] \overline{l}_{t}^{\kappa} +
\left[\widehat{\beta}_M(s)-\widehat{\beta}_M(\kappa)\right] \overline{m}_{t}^{\kappa}}_{\Delta\overline{\text{TECH}}_{t}^{s,\kappa}} + \underbrace{\Big[ \overline{\omega}_{t}^s - \overline{\omega}_{t}^{\kappa}\Big]}_{\Delta\overline{\text{TFP}}_{t}^{s,\kappa}},
\end{align}
where  $\Delta\overline{x}_{t}^{s,\kappa}=\overline{x}_{t}^{s}-\overline{x}_{t}^{\kappa}$ for $x\in \{k,l,m\}$.

Equation \eqref{eq:prodfn_hicks_cd-decomp} measures mean productivity differential across space and provides a \textit{counterfactual} decomposition thereof. By utilizing the counterfactual output that, given its location-specific technology, the average firm in location $s$ would have produced using the mean inputs employed by the firms in location $\kappa$ in year $t$ $\big[\widehat{\beta}_K(s) \overline{k}_{t}^{\kappa}+\widehat{\beta}_L(s)\overline{l}_{t}^{\kappa} +\widehat{\beta}_M(s)\overline{m}_{t}^{\kappa}\big]$, we are able to measure the locational differential in the mean productivity of firms in the locations $s$ and $\kappa$ that is \textit{un}explained by their different input usage: $\Delta \overline{\text{PROD}}_{t}^{s,\kappa}$. More importantly, we can then decompose this locational differential in the total productivity into the contribution attributable to the  difference in production technologies $\Delta\overline{\text{TECH}}_{t}^{s,\kappa}$ and to the  difference in the average total-factor {operations efficiencies} $\Delta\overline{\text{TFP}}_{t}^{s,\kappa}$.

The locational productivity differential decomposition in \eqref{eq:prodfn_hicks_cd-decomp} is time-varying, but should one be interested in a scalar measure of locational heterogeneity for the entire sample period, time-specific averages can be replaced with the  ``grand'' averages computed by pooling over all time periods.

\section{Empirical Application}
\label{sec:application}

Using our proposed model and estimation methodology, we explore the locationally heterogeneous production technology among manufacturers in the Chinese chemical industry. We report location-specific elasticity and productivity estimates for these firms and then decompose differences in their productivity across space to study if the latter are mainly driven by the use of different production technologies or the underlying total factor productivity differentials.

\subsection{Data}
\label{sec:data}

We use the data from \citet{baltagietal2016}. The dataset is a panel of $n=12,490$  manufacturers of chemicals continuously observed over the 2004--2006 period ($T=3$). The industry includes manufacturing of basic chemical materials (inorganic acids and bases, inorganic salts and organic raw chemical materials), fertilizers, pesticides, paints, coatings and adhesives, synthetic materials (plastic, synthetic resin and fiber) as well as daily chemical products (soap and cleaning compounds). The original source of these firm-level data is the Chinese Industrial Enterprises Database survey conducted by China's National Bureau of Statistics (NBS) which covers all state-owned firms and all non-state-owned firms with sales above 5 million Yuan (about \$0.6 million). \citet{baltagietal2016} have geocoded the location of each firm at the zipcode level in terms of the longitude and latitude (the ``$S$'' variables) using their postcode information in the dataset. The  coordinates are constructed for the location of each firm's headquarters and are time-invariant. By focusing on the continually operating firms, we mitigate a potential impact of spatial sorting (as well as the attrition due to non-survival) on the estimation results and treat the firm location as fixed (exogenous). The total number of observations is 37,470.

Figure \ref{fig:number} shows the spatial distribution of firms in our dataset on a map of mainland China (we omit area in the West with no data in our sample). The majority are located on the East Coast and in the Southeast of China, especially around the Yangtze River Delta that is generally comprised of Shanghai and the surrounding areas, the southern Jiangsu province and the northern Zhejiang province.

\begin{table}[t]
	\centering
	\caption{Data Summary Statistics}\label{tab:datasummary}
	\footnotesize
	\makebox[\linewidth]{
		\begin{tabular}{lrrrr}
			\toprule[1pt]
			Variables& Mean & 1st Qu. & Median  & 3rd Qu.\\
			\midrule
			&\multicolumn{4}{c}{\it \textemdash Production Function Variables\textemdash} \\[2pt]
			Output         & 86,381.98 & 11,021.09 & 23,489.53 & 59,483.71 \\
			Capital      & 35,882.40  & 1,951.47 & 5,319.28 & 17,431.35 \\
			Labor       & 199.07  & 43.00       & 80.00       & 178.00      \\
			Materials      & 48,487.82 & 5,896.49 & 12,798.35 & 33,063.81 \\[2pt]

			&\multicolumn{4}{c}{\it \textemdash Productivity Controls\textemdash} \\[2pt]
			Skilled Labor Share  	& 0.174    & 0.042    & 0.111    & 0.242    \\
			Foreign Equity Share 	& 0.140     & 0.000        & 0.000        & 0.000        \\
			Exporter        & 0.237    &   &   &      \\
			State-Owned   & 0.051    &   &   &       \\[2pt]

			&\multicolumn{4}{c}{\it \textemdash Location Variables\textemdash} \\[2pt]
			Longitude     & 2.041    & 1.984    & 2.068    & 2.102    \\
			Latitude    & 0.557    & 0.504    & 0.547    & 0.632    \\
			\midrule
			\multicolumn{5}{p{9.3cm}}{\scriptsize Output, capital and materials are in 1,000s of 1998 RMB. Labor is measured in the number of employees. The skilled labor share and foreign equity share are unit-free proportions. The exporter and state-owned variables are binary indicators. The location coordinates are in radians.} \\
			\bottomrule[1pt]
		\end{tabular}
	}
\end{table}

The key production variables are defined as follows. Output ($Y$) is measured using sales. The labor input ($L$) is measured by the number of employees. Capital stock ($K$) is the net fixed assets for production and operation, and the materials ($M$) are defined as the expenditure on direct materials. Output, capital and materials are deflated to the 1998 values using the producer price index, the price index for investment in fixed assets and the purchasing price index for industrial inputs, respectively, where the price indices are obtained from the NBS. The unit of monetary values is thousands RMB (Chinese Yuan).

We include four productivity-modifying variables in the evolution process of firm productivity $\omega_{it}$: the share of high-skilled workers ($G_1$), which is defined as the fraction of workers with a university or comparable education and is time-invariant because the data on workers' education level are only available for 2004; the foreign equity share ($G_2$), which is measured by the proportion of equity provided by foreign investors; a binary export status indicator ($G_3$), which takes value one if the firm is an exporter and zero otherwise; and a binary state/public ownership status indicator ($G_4$), which takes value one if the firm is state-owned and zero otherwise.

Table \ref{tab:datasummary} shows the summary statistics, including the mean, 1st quartile, median and 3rd quartile for the variables. For the production-function variables, the mean values are significantly larger than their medians, which suggests that their distributions are skewed to the right. Among firms in the chemical industry, 23.7\% are exporters and 5.1\% are state-owned. Most firms do not have foreign investors, and the average ratio of foreign to total equity is 0.14. On average, 17.4\% of employees in the industry have a college degree or equivalent.

\subsection{Estimation Results}
\label{sec:results}

In order to estimate the locationally varying (semiparametric) production function and firm productivity process in \eqref{eq:prodfn_hicks_cd}--\eqref{eq:productivity_hicks_lawsp}, we use the data-driven leave-one-location-out cross-validation method to choose the optimal {number of nearest neighboring locations in each step of the estimation ($h_1$ and $h_2$) to smooth over ``contextual'' location variables} $S_i$ inside the unknown functional coefficients. {This smoothing parameters regulate} spatial weighting of neighboring firms in kernel {fitting} and, as noted earlier, by selecting it via a data-driven procedure, we avoid the need to rely on \textit{ad hoc} specifications of both the spatial weights and radii defining the extent of {neighborhood influences}. The optimal {$h_1$ and $h_2$ values are 520 and 340 firm-years in the first- and second-step estimation, respectively. On average across all $s$, the corresponding adaptive bandwidths are 0.0171 and 0.0169 radians.} These bandwidth values are reasonable, given our sample size and the standard deviations of the longitude and latitude,\footnote{For the reference, the sample standard deviations for the longitude and latitude are respectively 0.0889 and 0.0941 radians.} and, evidently, are \textit{not} too large to ``smooth out'' the firm location {to imply location invariance/homogeneity. In fact, we can argue this more formally if kernel-smoothing is done using \textit{fixed} bandwidths so that we can rely on the theoretical results by \citet{halletal2007}, whereby local-constant kernel methods can remove irrelevant regressors via data-driven over-smoothing (i.e., by selecting large bandwidths). When we re-estimate our locationally-varying model in this manner, the optimal fixed bandwidths for the longitude and latitude in the first-step estimation are 0.009 and 0.010 radians, respectively; the corresponding second-step bandwidths are 0.024 and 0.023 radians. Just like in the case of adaptive bandwidths, these bandwidth values are fairly small relative to variation in the data, providing strong evidence in support of the overall relevancy of geographic location for firm production (i.e., against location invariance). Our location-varying formulation of the production technology and productivity is also formally supported by the \citet{ullah1985} specification test described in Appendix \ref{sec:appx_test}. Using cross-validated fixed bandwidths,} the bootstrap $p$-value is {0.001.} At the conventional significance level, our locationally heterogeneous production model is confidently preferred to a location-invariant formulation.

{In what follows, we discuss our semiparametric results obtained using adaptive bandwidths. For inference, we use the bias-corrected bootstrap percentile intervals as described in Appendix \ref{sec:appx_inference}. The number of bootstrap replications is set to $B=1,000$.}

\paragraph{Production Function.} We first report production-function estimates from our main model in which the production technology is locationally heterogeneous. We then compare these estimates with those obtained from the more conventional, {location-invariant} model that \textit{a priori} assumes common production technology for all firms. {The latter ``global'' formulation of the production function postulates constancy of the production relationship over space. This model is therefore fully parametric (with constant coefficients) and a special case of our locationally-varying model when $S_i$ is fixed across all $i$. Its estimation is straightforward and follows directly from \eqref{eq:fst_est2_pre}--\eqref{eq:sst_est} by letting the adaptive bandwidths in both steps diverge to $\infty$ which, in effect, obviates the need to locally weight the data because all kernels will be the same (for details, see Appendix \ref{sec:appx_test}).}\footnote{{Following a suggestion provided by a referee, we also estimate the location-invariant model {with location fixed effects added to the production function during the estimation.} We find the results do not change much from including these location effects, and therefore these results are not reported.}}

\begin{table}[p]
	\centering
	\caption{Input Elasticity Estimates}\label{tab:coef}
	\footnotesize
	\makebox[\linewidth]{
		\begin{tabular}{lcccc|c}
			\toprule[1pt]
			& \multicolumn{4}{c}{\it Locationally Varying} & \it Location-Invariant \\
			& Mean & 1st Qu. & Median  & 3rd Qu.& Point Estimate\\
			\midrule

			Capital                  & 0.112           & 0.095            & 0.115           & 0.128          & 0.130             \\
			& (0.104, 0.130)  & (0.083, 0.116)   & (0.110, 0.130)    & (0.119, 0.147) & (0.118, 0.141)   \\
			Labor                    & 0.303           & 0.272            & 0.293           & 0.342          & 0.299            \\
			& (0.285, 0.308)  & (0.248, 0.284)    & (0.278, 0.293)  & (0.313, 0.356) & (0.280, 0.318)   \\
			Materials                 & 0.480           & 0.452            & 0.481           & 0.503          & 0.495            \\
			& (0.466, 0.501)  & (0.414, 0.467)     & (0.437, 0.502)   & (0.456, 0.524) & (0.460, 0.519)   \\
			\midrule
			\multicolumn{6}{p{13cm}}{\scriptsize The left panel summarizes point estimates of $\beta_{\kappa}(S_i)\ \forall\ \kappa\in\{K, L, M\}$ with the corresponding two-sided 95\% bias-corrected confidence intervals in parentheses. The right panel reports their counterparts from a fixed-coefficient location-invariant model. } \\
			\bottomrule[1pt]
		\end{tabular}
	}
\end{table}

\begin{figure}[p]
	\centering
	\includegraphics[scale=0.36]{capital.jpg}\includegraphics[scale=0.36]{labor.jpg}
	\includegraphics[scale=0.36]{material.jpg}\includegraphics[scale=0.36]{RTS.jpg}
	\caption{Input Elasticity Estimates \\ {\small (Notes: Vertical lines correspond to location-invariant estimates)}} \label{fig:coef_elas}
\end{figure}

Since our model has location-specific input elasticities, there is a distribution of them (over space) and Table \ref{tab:coef} summarizes their point estimates. The table also reports the elasticity estimates from the alternative, location-invariant model. The corresponding two-sided 95\% bias-corrected confidence intervals for these statistics are reported in parentheses. Based on our model, the mean (median) capital, labor and material elasticity estimates are {0.112, 0.303 and 0.480 (0.115, 0.293 and 0.481),} respectively. Importantly, these location-specific elasticities show significant variation. {For the capital and labor inputs, the first quartiles are significantly different from the third quartiles.} Within the inter-quartile interval of their point estimates, elasticities of capital, labor and materials respectively increase by {0.033, 0.070 and 0.051, which in turn correspond to the 35\%, 26\% and 11\% changes.}

In comparison, the elasticity estimates from the location-invariant production function with fixed coefficients are all larger than the corresponding {median} estimates from our model and fall in between the second and third quartiles of our locationally-varying point estimates. Figure \ref{fig:coef_elas} provides visualization of the non-negligible technological heterogeneity in the chemicals production technology across different locations in China, which the traditional location-invariant model assumes away. The figure plots histograms of the estimated location-specific input elasticities (and the returns to scale) with the location-invariant counterpart estimates depicted by vertical lines. Consistent with the results in Table \ref{tab:coef}, all distributions show relatively wide dispersion, and the locationally homogeneous {model} is apparently unable to provide a reasonable representation of production technology across different regions.

\begin{table}[t]
	\centering
	\caption{Locationally Varying Returns to Scale Estimates}\label{tab:RTC}
	\footnotesize
	\makebox[\linewidth]{
		\begin{tabular}{lcccc|cc}
			\toprule[1pt]
			& Mean & 1st Qu. & Median  & 3rd Qu.& $= 1$ &$<1$ \\
			\midrule
			RTS & 0.895          & 0.875          & 0.903         & 0.929              & 21.6\%            &  82.3\%        \\
			& (0.820, 0.931) & (0.801, 0.912) & (0.827, 0.942) & (0.855, 0.968) & &  \\
			\midrule
			\multicolumn{7}{p{11.8cm}}{\scriptsize The left panel summarizes point estimates of $\sum_{\kappa}\beta_{\kappa}(S_i)$ with $\kappa\in\{K, L, M\}$ with the corresponding two-sided 95\% bias-corrected confidence intervals in parentheses. The counterpart estimate of the returns to scale from a fixed-coefficient location-invariant model is 0.924 (0.865, 0.969). The right panel reports the shares of locations in which location-specific point estimates are (\textit{i}) not significantly different from 1 (constant returns to scale) and (\textit{ii}) statistically less than 1 (decreasing returns to scale). The former classification is based on a two-sided test, the latter is on a one-sided test.} \\
			\bottomrule[1pt]
		\end{tabular}
	}
\end{table}

Table \ref{tab:RTC} provides summary statistics of the estimated returns to scale (RTS) from our locationally varying production function (also see the bottom-right plot in Figure \ref{fig:coef_elas}). The mean RTS is {0.895, and the median is 0.903, with the inter-quartile range being 0.054.} The right panel of Table \ref{tab:RTC} reports the fraction of locations in which the Chinese manufacturers of chemicals exhibit constant or decreasing returns to scale. This classification is based on the RTS point estimate being statistically equal to or less than one, respectively, at the 5\% significance level. The ``$=1$'' classification is based on a two-sided test, whereas the ``$<1$'' test is one-sided. In most locations in China {(82.3\%)}, the production technologies of the chemicals firms exhibit \textit{dis}economies of scale, but {21.6\%} regions show evidence of the constant returns to scale (i.e., scale efficiency).

\begin{figure}[t]
	\centering
	\includegraphics[scale=0.3]{map.Returns.to.Scale.jpg}
	\caption{Spatial Distribution of Returns to Scale Estimates \\
		{\small	(Notes: The color shade cutoffs correspond to the first, second (median) and third quartiles)}  } \label{fig:rts}
\end{figure}

To further explore the locational heterogeneity in the production technology for chemicals in China, we plot the spatial distribution of the RTS estimates in the country in Figure \ref{fig:rts}. We find that the firms {with the largest RTS are mainly located in the Southeast Coast provinces and some parts of the West and Northeast China.} The area nearby Beijing also exhibits larger RTS. There are a few possible explanations of such a geographic distribution of the returns to scale. As noted earlier, spillovers and agglomeration have positive effects on the marginal productivity of inputs which typically take form of the scale effects, and they may explain the high RTS on the Southeast Coast and in the Beijing area. Locality-specific resources, culture and polices can also facilitate firms' production process. For example, the rich endowment of the raw materials like coal, phosphate rock and sulfur make the provinces such as Guizhou, Yunnan and Qinghai among the largest fertilizer production zones in China. Furthermore, RTS is also related to the life cycle of a firm. Usually, it is the small, young and fast-growth firms that enjoy higher RTS, whereas the more mature firms that have grown bigger will have transitioned to the low-RTS scale. This may explain the prevalence of the higher-RTS firms in the West and Northeast China.

\paragraph{Productivity Process.} We now analyze our semiparametric estimates of the firm productivity process in \eqref{eq:productivity_hicks_lawsp}. Table \ref{tab:prod.coef} summarizes point estimates of  the location-specific marginal effects of productivity determinants in the evolution process of $\omega_{it}$, with the corresponding two-sided 95\% bias-corrected confidence intervals in parentheses. In the last column of the left panel, for each productivity-enhancing control $G_{it}$, we also report the share of locations in which location-specific point estimates are statistically positive (at a 5\% significance level) as inferred via a one-sided test.

\begin{table}[p]
	\centering
	\caption{Productivity Process Coefficient Estimates}\label{tab:prod.coef}
	\footnotesize
	\makebox[\linewidth]{
		\begin{tabular}{lccccc|c}
			\toprule[1pt]
			          & \multicolumn{5}{c}{\it Locationally Varying} & \it Location-Invariant \\
			Variables& Mean & 1st Qu. & Median  & 3rd Qu.& $>0$ & Point Estimate\\
			\midrule
			Lagged Productivity        & 0.576 & 0.518 & 0.597 & 0.641 & 99.9\% & 0.497          \\
			& (0.540, 0.591) & (0.469, 0.541) & (0.553, 0.614) & (0.580, 0.665) &   & (0.455, 0.530)   \\
			Skilled Labor Share & 0.387 & 0.287 & 0.419 & 0.500  & 85.7\%  & 0.387            \\
			& (0.346, 0.395) & (0.241, 0.309) & (0.345, 0.459) & (0.471, 0.493) &   & (0.345, 0.425)    \\
			Foreign Equity Share         & 0.054 & --0.001 & 0.062 & 0.103 & 47.7\% & 0.056		            \\
			& (0.006, 0.074) & (--0.034, 0.066) & (0.033, 0.069) & (0.099, 0.099) &  & (0.036, 0.075) 	   \\
			Exporter              & --0.001 & --0.032 & --0.005 & 0.038 & 24.0\% & 0.006 	            \\
			& (--0.011, 0.018) & (--0.041, --0.016) & (--0.012, 0.013) & 	(0.025, 0.067) &  & (--0.008, 0.018) 	  \\
			State-Owned           & 0.005 & --0.052 & 0.007 & 	0.073 & 	29.6\% & 	--0.043            \\
			& (--0.021, 0.010) & 	(--0.101, --0.014) & (--0.028, 0.025) & 	(0.062, 0.076) &  & (--0.072, --0.009) 		 \\
			\midrule
			\multicolumn{7}{p{16.5cm}}{\scriptsize The left panel summarizes point estimates of $\rho_j(S_i)\ \forall\ j=1,\dots,\dim(G)$ with the corresponding two-sided 95\% bias-corrected confidence intervals in parentheses. Reported is also a share of locations in which location-specific point estimates are statistically positive as inferred via a one-sided test. The right panel reports the counterparts from a fixed-coefficient location-invariant model.} \\
			\bottomrule[1pt]
		\end{tabular}
	}
\end{table}

\begin{figure}[p]
	\centering
	\includegraphics[scale=0.33]{lag_productivity.jpg}
	\includegraphics[scale=0.33]{lag_share_of_skilled_labor.jpg}\includegraphics[scale=0.33]{lag_capital_ratio.jpg}
	\includegraphics[scale=0.33]{lag_export.jpg}\includegraphics[scale=0.33]{lag_state-owned.jpg}
	\caption{Productivity Process Coefficient Estimates \\ {\small (Notes: Vertical lines correspond to location-invariant estimates)}} \label{fig:coef_prod}
\end{figure}

The autoregressive coefficient on the lagged productivity, which measures the persistence of $\omega_{it}$, is {0.576 at the mean and 0.597 at the median, with the quartile statistics varying from 0.518 to 0.641.} It is significantly positive for firms in {virtually} all locations. For firms in most locations {(85.7\%)}, skilled labor has a large and significantly positive effect on productivity: a percentage point increase in the skilled labor share is associated with an improvement in the next period's firm productivity by about 0.4\%, on average. Point estimates of the foreign ownership effect are positive {in the majority of locations}, but firms in only about half the locations benefit from a statistically positive productivity-boosting effect of the inbound foreign direct investment, with the average magnitude of only {7/50} of that attributable to hiring more skilled labor. In line with the empirical evidence reported for China's manufacturing in the literature \citep[see][and references therein]{malikovetal2020}, firms in most regions show insignificant {(and negative)} effects of the export status on productivity. The ``learning by exporting'' effects are very limited and statistically positive in {a quarter} of locations only. Interestingly, we find that state/public ownership is a significantly positive contributor to the improvements in firm productivity in about a third of the locations in which the Chinese chemicals manufacturing firms operate. This may be because the less productive state firms exited the market during the market-oriented transition in the late 1990s and early 2000s (prior to our sample period), and the remaining state-owned firms are larger and more productive \citep[also see][]{hsiehsong2015,zhaoqiankumbhakar2020}. Another potential reason may be that state ownership could have brought non-trivial financing benefits to these firms which, otherwise, were usually financially constrained due to the under-developed financial market in China during that period.

The far right panel of Table \ref{tab:prod.coef} reports productivity effects of the $G_{it}$ controls estimated using the location-invariant model. Note that, under the assumption of a location-invariant production, the evolution process of $\omega_{it}$ becomes a parametric linear model, and there is only one point estimate of each fixed marginal effect for all firms. Comparing these estimates with the {median} estimates from our model, the location-invariant marginal effects tend to be smaller. While the persistence coefficient as well as fixed coefficients on the skilled labor and foreign equity shares are positive and statistically significant, the location-invariant estimate of the state ownership effect on productivity is however significantly negative (for all firms, by design). Together with the tendency of a location-invariant model to underestimate, this underscores the importance of allowing sufficient flexibility in modeling heterogeneity across firms (across different locations, in our case) besides the usual Hicks-neutral TFP.

The contrast between the two models is even more apparent in Figure \ref{fig:coef_prod}, which plots the distributions of estimated marginal effects of the productivity-enhancing controls. Like before, the location-invariant counterparts are depicted by vertical lines. The distribution of each productivity modifier spans a relatively wide range, and the corresponding location-invariant estimates are evidently not good representatives for the {centrality} of these distributions. For example, the productivity-boosting effect of the firm's skilled labor roughly varies between {0.06 and 0.61\% per unit percentage point increase in the skilled labor share, depending on the location.} The distribution of this marginal effect across locations is somewhat left-skewed, and the corresponding location-invariant effect estimate evidently does not measure central tendency of these locationally-varying effects well. Similar observations can be made about other varying coefficients in the productivity process.

\paragraph{Productivity Decomposition.} We now examine the average productivity differentials for firms in different regions. To this end, we perform the locational decomposition proposed in Section \ref{sec:decomposition_level} to identify the sources of production differences that cannot be explained by input usage. Recall that, by our decomposition, the locational differential in the mean total productivity ($\Delta \overline{\text{PROD}}^{s,\kappa}_t$) accounts for the cross-regional variation in both the input elasticities ($\Delta\overline{\text{TECH}}_{t}^{s,\kappa}$) and the total factor productivity ($\Delta\overline{\text{TFP}}^{s,\kappa}$). It is therefore more inclusive than the conventional analyses that rely on fitting a common production technology for all firms regardless of their locations and thus confine cross-firm heterogeneity to differences in $\omega_{it}$ only.

\begin{table}[t]
	\centering
	\caption{Locational Productivity Differential Decomposition}\label{tab:decom}
	\footnotesize
	\makebox[\linewidth]{
		\begin{tabular}{lcccc}
			\toprule[1pt]
			Components& Mean & 1st Qu. & Median  & 3rd Qu.\\
			\midrule
			& \multicolumn{4}{c}{\it Locationally Varying Model} \\
			$\Delta\overline{\text{TECH}}^{s,\kappa}$                 & 1.292 & 1.135 & 1.331 & 1.521         \\
			$\Delta\overline{\text{TFP}}^{s,\kappa}$                   & 0.574 & 0.203 & 0.571 & 0.893        \\
			$\Delta \overline{\text{PROD}}^{s,\kappa}$              & 1.866 & 1.652 & 1.869 & 2.086         \\
			\midrule
			& \multicolumn{4}{c}{\it Location-Invariant Model} \\
			$\Delta \overline{\text{PROD}}^{s,\kappa}$ & 1.797 & 1.589 & 1.816 & 2.040          \\
			\midrule
			\multicolumn{5}{p{7cm}}{\scriptsize The top panel summarizes point estimates of the locational mean productivity differential $\Delta \overline{\text{PROD}}^{s,\kappa}=\Delta\overline{\text{TECH}}^{s,\kappa}+ \Delta\overline{\text{TFP}}^{s,\kappa}$ with the corresponding two-sided 95\% bias-corrected confidence intervals in parentheses. The bottom panel reports the counterparts from a fixed-coefficient location-invariant model for which, by construction, $\Delta \overline{\text{PROD}}^{s,\kappa}= \Delta\overline{\text{TFP}}^{s,\kappa}$ with $\Delta\overline{\text{TECH}}^{s,\kappa}=0$. In both cases, the decomposition is pooled for the entire sample period and the benchmark/reference location $\kappa$ is the one with the smallest mean production: $\kappa=\arg\min_{s} \overline{y}^{s}$.} \\
			\bottomrule[1pt]
		\end{tabular}
	}
\end{table}

Table \ref{tab:decom} presents the decomposition results (across locations $s$) following \eqref{eq:prodfn_hicks_cd-decomp}. Because we just have three years of data, we perform the decomposition by pooling over the entire sample period. Thus, reported are the average decomposition results across 2002--2004. Also note that, for a fixed benchmark location $\kappa$, the decomposition is done for each $s$-location separately. For the benchmark/reference location $\kappa$, we choose the zipcode with the smallest mean production, i.e., $\kappa=\arg\min_{s} \overline{y}^{s}$, where $\overline{y}^{s}$ is defined as the time average of  \eqref{eq:prodfn_hicks_cd-save}.\footnote{Obviously, the choice of a reference location is inconsequential because its role is effectively that of a normalization.} Therefore, the numbers ($\times 100\%$) in Table \ref{tab:decom} can be interpreted as the percentage differences between the chemicals manufacturers operating in various locations ($s$) versus those from the least-production-scale region $(\kappa)$ in China. Because the reference location is fixed, the results are comparable across $s$.

Based on our estimates, the mean productivity differential is {1.866,} which means that, compared to the location with the smallest scale of chemicals production, other locations are, on average, {187\%} more productive (or more effective in the input usage). {The inter-quartile range of the average productivity differential spans from 1.652 and 2.086. Economically, these differences are large: firms that are located at the third quartile of the locational productivity distribution are about 43\% more productive than firms at the first quartile.} When we decompose the productivity differential into the technology and TFP differentials, on average, {$\Delta\overline{\text{TECH}}^{s,\kappa}$ is 2.3 times as large as $\Delta\overline{\text{TFP}}^{s,\kappa}$ and accounts for about 69\%} of the total productivity differences across locations.\footnote{That is, the ratio of $\Delta\overline{\text{TECH}}^{s,\kappa}$ to $\Delta\overline{\text{PROD}}^{s,\kappa}$ is 0.69.} This suggests that the cross-location {technological} heterogeneity in China's chemicals industry explains most of the productivity differential and that the regional {TFP differences are \textit{relatively} more modest.}

Table \ref{tab:decom} also summarizes the locational productivity differential estimates from the standard location-invariant model. Given that this model assumes fixed coefficients (same technology for all firms), we cannot perform a decomposition here, and all cross-location variation in productivity is \textit{a priori} attributed to TFP by design. Compared with our locationally-varying model, this model {yields similar} total productivity differentials across regions but, due to its inability to recognize technological differences, it {grossly} over-estimates cross-location differences in TFP.

\begin{figure}[t]
	\centering
	\includegraphics[scale=0.29]{map.Difference.in.Tchnologies.jpg}\includegraphics[scale=0.29]{map.Difference.in.Productivities.jpg}
	\caption{Locational Productivity Differential Decomposition Estimates Across Space \\ {\small (Notes: The color shade cutoffs correspond to the first, second (median) and third quartiles)} } \label{fig:decomposition_map}
\end{figure}

To explore the spatial heterogeneity in the decomposition components, we plot the spatial distributions of $\Delta\overline{\text{TECH}}^{s,\kappa}$, $\Delta\overline{\text{TFP}}^{s,\kappa}$ and $\Delta \overline{\text{PROD}}^{s,\kappa}$ on the map in Figure \ref{fig:decomposition_map}. The spatial distribution of $\Delta\overline{\text{TECH}}^{s,\kappa}$ aligns {remarkably} with that of RTS in Figure \ref{fig:rts}. Noticeably, the regions of agglomeration in the chemicals industry (see Figure \ref{fig:number}) tend to demonstrate large technology differentials. In contrast, the spatial distribution of $\Delta\overline{\text{TFP}}^{s,\kappa}$ shows quite a different pattern, whereby the locations of large TFP (differentials) are less concentrated. Unlike with the $\Delta\overline{\text{TECH}}^{s,\kappa}$ map, the dark-shaded regions on the $\Delta\overline{\text{TFP}}^{s,\kappa}$ map are widely spread around and have no clear overlapping with the main agglomeration regions in the industry. The comparison between these two maps suggests that, at least for the Chinese chemicals manufacturing firms, the widely-documented agglomeration effects on firm productivity are associated more with the scale effects via production technology rather than the improvements in overall TFP. That is, by locating closer to other firms in the same industry, it may be easier for a firm to pick up production technologies and know-hows that improve productiveness of inputs technologically and thus expand the input requirement set corresponding to the firm's output level\footnote{And more generally, shifting the \textit{family} of firm's isoquants corresponding to a fixed level of $\omega_{it}$ toward the origin.} \textit{given} its total factor productivity. Instead, agglomeration effects that increase the effectiveness of transforming all factors into the outputs via available technology (by adopting better business practices or management strategies) may be less likely to spill among the Chinese manufacturers of chemicals. Importantly, if we \textit{a priori} assume the fixed-coefficient production function common to all firms, the technological effects of agglomeration (via input elasticities) would be wrongly attributed to the TFP differentials.

\section{Concluding Remarks}
\label{sec:conclusion}

Although it is widely documented {in the operations management literature} that the firm's location matters for its performance, few empirical studies {of operations efficiency} explicitly control for it. {This paper fills in this gap by providing a semiparametric methodology for the} identification of production functions in which locational factors have heterogeneous effects on the firm's production technology and productivity evolution. {Our approach is novel in that we
explicitly model spatial variation in parameters in the production-function estimation.} We generalize the popular Cobb-Douglas production function in a semiparametric fashion by writing the input elasticities and productivity parameters as unknown functions of the firm's {geographic} location. In doing so, not only do we render the production {technology} location-specific but also accommodate {neighborhood influences on firm operations} with the strength thereof depending on the distance between {firms. Importantly, this enables us to examine the role of cross-location differences in explaining the variation in operational productivity among firms.

The proposed model is superior to the alternative SAR-type production-function formulations because it (i) explicitly estimates the locational variation in production functions, (ii) is readily reconcilable with the conventional production axioms and, more importantly, (iii) can be identified from the data by building on the popular proxy-variable methods, which we extend to incorporate locational heterogeneity in firm production.} Our methodology provides a practical tool for examining the effects of agglomeration and technology spillovers on firm performance {and will be most useful for empiricists focused on the analysis of operations efficiency/productivity and its ``determinants.''}

Using the methods proposed in our paper, we can {separate the effects of firm location on} production technology from those on firm productivity and find evidence consistent with the conclusion that agglomeration economies affect {the productivity of Chinese chemicals manufacturers mainly through the scale effects of production \textit{technology} rather than the improvements in overall TFP.} Comparing our flexible semiparametric model with the more conventional parametric model that postulates a common technology for all firms regardless of their location, we show that the latter does not provide {an adequate representation of} the industry and that the conclusion based on its results can be misleading. {For managerial implications, our study re-emphasizes the importance of firm location for its operations efficiency in manufacturing industries. Our findings also suggest that hiring skilled labor has a larger productivity effect compared to other widely-discussed productivity-enhancing techniques, such as learning by exporting. }