# Latent class models with persistence in regime changes: a distributed lag analysis

Luis Orea, K Hervé Dakpo

<figure><img src="image_1.png" /></figure>

## To cite this version:

Luis Orea, K Hervé Dakpo. Latent class models with persistence in regime changes: a distributed lag analysis. Journal of Productivity Analysis, inPress, 10.1007/s11123-025-00782-2. hal-05322436

HAL Id: hal-05322436

https://hal.inrae.fr/hal-05322436v1

Submitted on 20 Oct 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>
# Latent class models with persistence in regime changes: a distributed lag analysis

Luis Orea*

University of Oviedo, Department of Economics, Oviedo Efficiency Group

Avenida del Cristo, s/n, 33071 Oviedo, Spain

[lorea@uniovi.es](mailto:lorea@uniovi.es)

K Hervé Dakpo

Université Paris-Saclay, INRAE, AgroParisTech

PSAE, F-91120, Palaiseau, France

[k-herve.dakpo@inrae.fr](mailto:k-herve.dakpo@inrae.fr)

September 24, 2025

## Abstract

One of the approaches to address the issue of production heterogeneity is to use latent class models. In most of these models, class membership either does not vary or might change freely over time. While the first assumption becomes increasingly untenable as the number of observed periods becomes larger, the second assumption is difficult to justify if important factors exist that prevent firms from switching classes back and forth several times. The present paper aims to develop a latent class model that allows firms to change from one class to another over time while permitting some degree of persistence in class membership. Our model can be used in settings with more than two classes and estimated using unbalanced panel datasets. An application of the empirical model in the context of dairy farm intensification is also provided. We find evidence of moderate resistance to replacing one milk production system with another in this sector, especially for small farms. Despite this, the standard latent class model performs reasonably well in terms of class-membership probabilities and temporal patterns.

**Keywords:** dairy farms, intensification, latent class model, class persistence, stochastic frontier, technical efficiency.

**JEL classification:** Q12, C23.

<footnote>* Corresponding author.</footnote>
# 1. Introduction

One of the most critical problems in applied econometrics is dealing with unobserved heterogeneity. The increasing availability of large panel data sets has enabled the estimation of models with varying coefficients across firms. This development explains the recent contributions to heterogeneous-coefficient models using parametric and non-parametric techniques.<fnref n="1" /> Compared to conventional homogeneous-coefficient models, heterogeneous-coefficient specifications offer certain advantages. For example, Malikov and Sun (2017) highlight that ignoring potential parameter heterogeneity can lead to biased estimates and misleading policy implications. Similarly, Gude, et al. (2018) observe that heterogeneous-coefficient (spatial) models can provide richer policy insights by allowing policy measures to be tailored more precisely to each unit.

The classical approach models time-invariant heterogeneity as a parameter (fixed effects) or a random term (random effects). More generally, the random parameter models assume that all individual parameters follow a continuous multivariate distribution. Another approach to modeling unobserved heterogeneity is to recognize that the observations in the sample may come from different populations. This approach is followed by the *latent class models*, also known as *finite mixture models*.

A conventional latent class model (hereafter, LCM) assumes a finite number of classes or regimes, where each observation in the sample is probabilistically allocated to a particular class. A specific function is estimated for each class by maximum likelihood (ML) in a single stage. The allocation of observations to a specific class depends on the estimated class membership probabilities, reflecting the uncertainty regarding each observation's 'true' classification. Greene (2005) notes that the LCM is a discrete analog of the random parameters model, as, in contrast to conventional random parameters models, the LCM framework captures only between-class heterogeneity, and individual heterogeneity is not allowed (e.g., all firms belonging to a particular class share the same technology). However, as Alvarez, et al. (2024) show, this does not prevent the calculation of observation-specific coefficients, akin to the random coefficients

<footnote n="1">¹ As Gude, et al. (2018) underline, parametric and non-parametric approaches have strengths and weaknesses, and each must be carefully considered when constructing models. For instance, non-parametric models, which use kernel smoothing methods to relax parametric assumptions, can better track heterogeneous coefficients (Li and Racine, 2007), but are only practical when there are few continuous regressors or many observations.</footnote>
model. Orea and Kumbhakar (2004) and Greene (2005) introduced panel-type specifications of the latent class model, where class membership is fully persistent over time, imposing that firms stay in the same class over the whole sample period.<fnref n="2" /> When the panel spans many years, that assumption becomes restrictive because firms in many industries do switch technologies—albeit not costlessly. Realistically, class membership is highly but not perfectly persistent: switching involves adjustment costs, information gaps, and sunk investments, so that transitions are infrequent rather than impossible. For instance, Humlum (2019) and Koch, et al. (2021) allow the technology of the manufacturing firms to differ if their production processes have been automated (i.e., if they use robots to perform automatable tasks or not). Despite the potential benefits of adopting robots and other automated technologies, the adoption rates of these technologies are often small due to significant sunk adoption costs. The adoption costs in manufacturing involve expenses that have nothing to do with the production process itself, such as expenditures for installation, costs of training, expertise and consultation, and other indirect costs associated with the hassle of robot adoption, the lack of standardization of industrial robots, their compatibility, etc. (see e.g., Ghobakhloo, et al. (2022)). This explains why the Markov process used in this literature to model a firm's persistent productivity always assumes that robot-driven improvements in firm productivity take one or more periods to materialize, i.e., technological change is gradual. A second example is the rapid diffusion of automatic milking systems (AMS) in north-west Europe (Lundström and Lindblom, 2021). For instance, a recent review projects that roughly half of the dairy cows in north-west Europe could be robot-milked by 2025 (Tangorra, et al., 2022), marking a decisive shift toward capital-intensive, labor-saving technology. Because each robot requires a six-figure investment and barn redesign (Salfer, et al., 2017), the resulting sunk costs and loan covenants make a return to extensive production costly. Hence, class membership becomes highly persistent, though not completely irreversible.

For instance, in general, dairy farming, transitions from extensive to intensive systems seldom occur in a single leap; instead, they unfold through a sequence of incremental, overlapping steps because economic and managerial frictions make an 'all-at-once' switch prohibitively risky. Large, indivisible investments—robotic milkers, precision-feeding stations, purpose-built free-stall barns—must be financed and amortized, so farmers typically begin with lower-cost actions

<footnote n="2">² Applications of the panel-type LCM can be found in Alvarez and del Corral (2010), Cullmann (2010), Dakpo, et al. (2024), Kellermann and Salhofer (2014), Pestana Barros (2009).</footnote>
such as increasing concentrate feed and stocking density to test whether higher output can be
sustained. Each stage carries a learning curve: staff must master ration formulation, health-
monitoring software, or milking-robot maintenance, often drawing on advisers, suppliers, and
peer networks for know-how. This 'social learning' cushion mistakes and gradually lowers the
marginal cost of the next upgrade, thereby reducing 'productivity inertia' and what Dixit and
Pindyck (1994) call the *real option* value of waiting. Evidence from Asturias illustrates the
process: holdings first push existing tie-stall infrastructure to its limit, then—if labor and land
constraints persist—commit to barn redesign and high-genetic-merit replacements (Alvarez, et
al., 2008). Because each tranche of capital is effectively sunk once installed, the option to
reverse course remains but becomes increasingly expensive; persistence in a given technology
class is therefore high, though not absolute. In summary, gradual switching is, thus, the
economically efficient response when (i) capital is lumpy, (ii) know-how accumulates with use,
and (iii) future prices or policies remain uncertain.

Other authors have estimated their LCM using a *pooled-type* specification for the probability
of class membership. In these models, the class-membership probabilities are realizations of an
i.i.d. (independent and identically distributed) process. As successive probabilities are
independent, observations can switch *freely* (at least in theory) from one class to another over
time. Applications of the pooled-type LCM in agricultural economics can be found in Orea, et
al. (2015), Dakpo, et al. (2021), Dakpo, et al. (2021), Latruffe, et al. (2023). For instance, in
their application for Spanish dairy farms, Orea, et al. (2015) allocate each farm to the class with
the higher *posterior* probability.<fnref n="3" /> As the posterior probabilities can vary over time, their farms
are allowed to switch between the extensive and intensive regimes. They take advantage of the
pooled nature of their LCM to examine the effect of previous land consolidation processes in
the region on 'farms' adoption of extensive or intensive milk production systems. In their
application for the economic development of the European regions, Alvarez, et al. (2024) do
not restrict their regions to remaining in the same class over time. Their LCM allows for some
regions to switch from one class to another. Despite this flexibility, they find class allocations
relatively stable, with only 21% of regions switching classes over time. They leave for future
research, the analysis of the factors that prevent regions from transitioning from poor to rich

<footnote n="3">³ The posterior probabilities consider the prior probabilities' determinants and the relative goodness-of-fit of each class to predict each observation's likelihood of belonging to each class.</footnote>
and reinforcing the poverty or development trap (see, e.g., Battisti and Parmeter (2013), Diemer, et al. (2022)).

The present paper aims to elaborate an LCM that allows observations (firms, individuals, regions, etc.) to change from one class to another with some degree of persistence in class membership, mimicking some of the above-mentioned dynamics. In this case, most observations stay in the same regime in any given year, yet positive transition probabilities allow them to respond to shocks, learning, and policy incentives. A latent-class specification that allows current class membership to reflect this persistence yet not the immutable dynamics, matches the stepwise reality far better than models that assume either costless annual switching or lifelong technological status.

To deal with this issue, Tsionas and Kumbhakar (2004) introduced a Markov switching stochastic frontier model where class persistence is captured by a matrix of transition probabilities jointly estimated using Bayesian techniques. We take a different (frequentist) approach and employ distributed-lag (DL) techniques to develop a latent class model with persistence in regime changes. Our distributed-lag latent class model (hereafter, DL-LCM) relies on ideas borrowed from two pieces of literature: the distributed lag models of expectations and the stochastic frontier models with dynamic inefficiency.

Our DL-LCM model and the Bayesian framework of Tsionas and Kumbhakar (2004) are best viewed as complements. The DL-LCM is estimated by conventional maximum likelihood, so—thanks to the closed-form likelihood that the distributed-lag structure provides—it is computationally light and exploits the full power of large samples. By contrast, the Tsionas-Kumbhakar model relies on simulation-based Bayesian routines. As pointed out by a reviewer, modern Bayesian software —such as Stan and JAGS—nowadays handles many aspects of Bayesian estimation automatically.<fnref n="4" /> The two models also diverge in the way they handle state dynamics. Our DL-LCM allows covariates to shape both class membership and the persistence of that membership over time, offering fine-grained heterogeneity across producers. Tsionas and Kumbhakar impose a common transition matrix across observations but permit regime-specific persistence and asymmetric transition probabilities—an attractive feature in macro

<footnote n="4">⁴ To date, Markov-switching extensions of latent-class models have been developed solely within a Bayesian framework; an equivalent formulation for frequentist estimation is still lacking. It would be interesting to use such software in future work to compare Bayesian and frequentist approaches in terms of empirical results and computational cost.</footnote>
applications where positive and negative shocks can have different effects (see, e.g., Beaudry and Koop (1993) in the case of negative and positive productivity shocks on GNP).

We apply this new model to a panel data set of Spanish dairy farms. The dairy sector is an interesting case study in the context of this paper because, over the last decades, it has undergone a strong process of intensification. This process proves that farms have changed their milk production systems over time. In general, the intensification of production takes the form of an increase in the number of dairy cows per hectare (higher stocking rate), the acquisition of genetically improved dairy cattle, and an increase of the share of concentrates in the diet. For this reason, we expect that the technologies of extensive and intensive farms may differ. However, the researcher does not directly observe the use of one technology or another. At most, only partial technological indicators, such as the ratios of concentrates per cow or livestock density, are available. For this reason, latent class modeling has been used, among others, by Alvarez and del Corral (2010), Dakpo, et al. (2021), Orea, et al. (2015) and Sauer and Paul (2013) to identify extensive and intensive technologies in milk production. Therefore, casting the technology identification issue in the framework of an LCM with time-varying probabilities of class (technology) membership seems to be an appropriate empirical approach. The paper is organized as follows: Section 2 describes the standard latent class model. In Section 3, we develop the model with class persistence. Section 4 contains the data and the empirical model. The paper ends with some conclusions.

## 2. The standard LCM

This section outlines the main characteristics of a simple pooled-type LCM. As we are also interested in studying differences in productive efficiency between extensive and intensive farms, we will model the farm's production function using a stochastic frontier (SF) analysis approach.<fnref n="5" /> This approach augments the typical production function by adding a one-sided random term that reflects technical inefficiency in production. Consider a panel of *i* = 1, ..., *N* farms observed at most in *T* periods. The farm's output and generic input *s* are denoted by *Y*<sub>*it*</sub>

<footnote n="5">⁵ A comprehensive summary of this literature can be found in Kumbhakar and Lovell (2000), Parmeter and Kumbhakar (2014), and Sickles and Zelenyuk (2019).</footnote>
and $X_{s,it}$ respectively, and their log values are denoted in lowercase by $y_{it}$ and $x_{s,it}$. A general specification of a production frontier in a given class $j = 1, ..., J$ can be written as follows:<fnref n="6" />

$$y_{it} = \alpha_j + \beta'_{j}x_{it} + v_{it|j} - u_{it|j}, \quad (1)$$

where $i$ stands for farms, $t$ for time, $y_{it}$ is a measure of farms' output, $x_{it} = (x_{1,it}, ..., x_{S,it})$ is a $S \times 1$ vector of production factors, $\beta_j = (\beta_{1,j}, ..., \beta_{S,j})$ is a $S \times 1$ vector of parameters, $v_{it|j} \sim N(0, \sigma_{v,j}^2)$ is the traditional noise term that follows a normal distribution with zero mean, $u_{it|j} \sim N^+[0, \sigma_{u,j}^2(d_{it})]$ is a one-sided random term capturing technical inefficiency and $d_{it} = (d_{1,it}, ..., d_{D,it})$ is a $D \times 1$ vector of efficiency determinants that includes a vector of ones. As is customary in the stochastic frontier literature, $ln\sigma_{u,j}^2$ is modeled as a linear function of the set of efficiency determinants, $d_{it}$. Moreover, the technological characteristics vary across classes as both $\alpha_j$ and $\beta_j$ are class-specific parameters.

Encompassing in $\theta_j = (\alpha_j, \beta_j, \sigma_{v,j}, \sigma_{u,j})$ all parameters associated with class $j$, the conditional likelihood function of an observation belonging to class $j$ can be denoted by $LF_{it|j}(\theta_j)$. The model is estimated by maximum likelihood (ML) once the $j$-specific likelihood functions, $LF_{it|j}(\theta_j)$, are weighted using the following prior class membership probabilities:

$$\Pi_{it|j}(\Delta) = \frac{\exp(\delta'_{j}q_{it})}{\sum_{h=1}^{J} \exp(\delta'_{h}q_{it})}, \quad j = 1, ..., J, \quad \delta_{j} = 0, \quad (2)$$

where $q_{it} = (q_{1,it}, ..., q_{H,it})$ is a $H \times 1$ vector of farm-specific characteristics (including a vector of ones) that are related to the latent problem being modeled, $\delta_j = (\delta_{1,j}, ..., \delta_{H,j})$ is a $H \times 1$ vector of parameters to be estimated, and $\Delta = (\delta_1, ..., \delta_J)$. The farm $i$ and period $t$ unconditional likelihood function can thus be expressed as:

$$LF_{it}(\theta, \Delta) = \sum_{j=1}^{J} LF_{it|j}(\theta_j) \cdot \Pi_{it|j}(\Delta), \quad (3)$$

<footnote n="6">⁶ Researchers usually determine the number of latent classes $J$ with information-criterion tests such as the AIC or BIC. In our dairy-farm application we fix $J = 2$, because each farm operates either an extensive or an intensive milk-production system. For general applicability, however, we derive the theory for an arbitrary number of classes $J$.</footnote>
where $\Theta = (\theta_1, ..., \theta_j)$, $0 \le \Pi_{it|j}(\Delta) \le 1$ and $\sum_{j=1}^J \Pi_{it|j}(\Delta) = 1$. The overall likelihood function resulting from (2) and (3) is a continuous function of the vectors of parameters $\Theta$ and $\Delta$, and can be written as:

$$ \ln LF(\Theta, \Delta) = \sum_{i=1}^{N} \sum_{t=E_i}^{T_i} \ln LF_{it}(\Theta, \Delta) \\ = \sum_{i=1}^{N} \sum_{t=E_i}^{T_i} \ln \left\{ \sum_{j=1}^{J} LF_{it|j}(\theta_j) \cdot \Pi_{it|j}(\Delta) \right\}, \quad (4) $$

where $E_i$ and $T_i$ denotes the first and last periods, respectively, under which farm $i$ is observed. Note that, although our formulation in (4) allows for unbalanced panel data, we assume that observations are available continuously between $E_i$ and $T_i$. Maximizing the above likelihood function gives asymptotically efficient estimates of all parameters. The estimated parameters can be used to compute the posterior probabilities using the following expression:

$$ P(j|it) = \frac{LF_{it|j}(\hat{\Theta}_j)\Pi_{it|j}(\hat{\Delta})}{\sum_{j=1}^{J} LF_{it|j}(\hat{\Theta}_j)\Pi_{it|j}(\hat{\Delta})}. \quad (5) $$

These posterior probabilities are used in a conventional LCM to assign each observation to a particular class, i.e., each farm is allocated to the class with the highest posterior probability. Note that the posterior probabilities $P(j|it)$ depend not only on the relative goodness-of-fit of each class when explaining the production level of each farm but also on the estimated prior probabilities, which in turn rely on a set of farm-specific characteristics.

In a traditional LCM, like the one shown above, the probabilities of class membership are realizations of an i.i.d. process, and thus, successive probabilities are independent. In the real world, we expect that firms may switch from one class to another and are interested in modeling the class change process. However, we do not expect changes to occur instantaneously since adopting a different technology involves some adjustment costs. Therefore, we expect class membership to exhibit some degree of persistence. In the next section, we further develop the concept of persistence.

### 3. A DL-LCM with persistence in regime changes

The likelihood function of the previous LCM ignores the panel nature of the data because it treats the cross-sectional and temporal dimensions symmetrically. This model feature permits a particular cross-sectional observation to move freely from one class to another over time. Orea
and Kumbhakar (2004) and Greene (2005) used time-invariant class-membership probabilities to develop their latent class models.<fnref n="7" /> In their models, the firm resides permanently in a specific class unknown to the researcher. As we expect class membership to exhibit some degree of persistence in most applications, we propose a new LCM with persistence in regime changes that can be estimated using standard econometric techniques.

### 3.1. Static Relative Probabilities

In order to incorporate persistence in class membership, we propose using an autoregressive form to capture the evolution of the farm-specific prior probabilities. Achieving this objective is far from simple, as this extension of the model must comply with the restriction that all probabilities are bounded between zero and one (i.e., that $0 \le \Pi_{it|j} \le 1$). Tsionas (2006) and Emvalomatis (2011) faced a similar problem, as the traditional inefficiency measures in production economics are also bounded between zero and one. Inspired by these authors, we do not model class-membership probabilities but the (natural logarithm of a) ratio of two class-membership probabilities, $\Pi_{it|j}$ and $\Pi_{it|k}$, where $k \ne j$. That is:

$$RP_{it|jk} = \frac{\Pi_{it|j}}{\Pi_{it|k}}, \qquad (6)$$

where $RP_{it|jk}$ stands for Relative Probability. $RP_{it}$ allows imposing an autoregressive structure in class probabilities that does not violate the restriction $0 \le \Pi_{it|j} \le 1$. If we model the prior class membership probabilities using equation (2), the natural logarithm of Relative Probability can be written as follows:

$$\ln RP_{it|jk} = \ln \left( \frac{\Pi_{it|j}}{\Pi_{it|k}} \right) = (\delta_j - \delta_k)' q_{it}, \qquad (7)$$

where $\delta_j = (\delta_j^1, ..., \delta_j^H)$ stands now for the vector of parameters of the probability of belonging to class j. Note that this expression can be simplified if we take into account that $\delta_j = 0$ and define our relative productivity with respect to class J. In this case, we obtain:

<footnote n="7">⁷ Although the specifications of Orea and Kumbhakar (2004) and Greene (2005) differ in several respects, both papers specify the prior class membership probabilities in equation (2) as a logistic function of time-invariant covariates; consequently the unconditional likelihood functions are obtained by simply averaging the class-specific likelihoods $(\Pi_{i|j}(\delta_j) = \frac{\exp(\delta_j'q_i)}{\sum_{h=1}^{J} \exp(\delta_h'q_i)}).</footnote>
$$ \ln \mathrm{RP}_{it|j} = \delta_j' \mathbf{q}_{it}. \qquad (8) $$

If $\ln \mathrm{RP}_{it|j}$ is positive, Class $j$ is more probable than Class $J$. In contrast, if $\ln \mathrm{RP}_{it|j}$ is negative, Class $J$ is the most probable.<fnref n="8" /> Note that this ratio does not depend on lagged values of $\mathbf{q}_{it}$. Therefore, firms with a large probability of belonging to a particular class in period $t-1$ might have a high probability of belonging to another class in period $t$, and vice versa. That is, beyond the potential serial correlation of $q_{it}$, $\ln \mathrm{RP}_{it|j}$ in equation (8) has nothing to do with $\ln \mathrm{RP}_{it-1|j}$ if we use equation (2) to model the prior class membership probabilities. In this sense, the traditional latent class model is a static LCM.

## 3.2. *Dynamic Relative Probabilities*<fnref n="9" />

By applying ideas borrowed from the stochastic frontier models with dynamic inefficiency recently introduced by Emvalomatis (2011) and the well-known adaptive expectation model of firms' investment decisions introduced by Koyck (1954) in this particular context, we next develop a DL-LCM that allows observations to change from one class to another with some degree of persistence in class-membership.

Following Emvalomatis (2011), we impose an autoregressive structure on the (logged) ratio of class-membership probabilities instead of on the class-membership probabilities themselves, as this ensures that all probabilities are bounded between zero and one, even if there is some degree of persistence in class-membership. In particular, we model the natural logarithm of RP in period $t$ as a weighted average of current values of the determinants of the probabilities ($\mathbf{q}_{it}$) as well as the first lag of the logged RP ratio:

$$ \ln \mathrm{RP}_{it|j} = (1 - \lambda_j) \delta_j' \mathbf{q}_{it} + \lambda_j \ln \mathrm{RP}_{it-1|j}, \qquad (9) $$

where the weight $\lambda_j$ is between 0 and 1. Note that if $\lambda_j = 0 \forall j = 1, \dots, J-1$, our model collapses to a traditional LCM with farm-specific prior probabilities, which implies that it is costless to move from one class to another. Equation (9) shows that the RP ratio reacts in a distributed way to changes in class-membership determinants, not adjusting immediately as in the simple LCM. The parameter $\lambda_j$ can be interpreted as the degree of persistence in the class.

<footnote n="8">⁸ $\mathrm{RP}_{it|j}$ stands for the relative probability between classes $j$ and $J$. To avoid notational clutches we drop the subscript $J$.</footnote>

<footnote n="9">⁹ The discussion in next paragraphs is mostly inspired by Maddala and Lahiri (2014)'s textbook.</footnote>
This autoregressive structure recognizes that firms with a high probability of belonging to a particular class today have a high probability of remaining in the same class in the future. Solving recursively the above equation, we can rewrite it as an infinite lag distribution function (with geometrically declining weights) of past values of class-membership determinants. That is:

$$ \ln \mathrm{RP}_{it|j} = \delta_j' \cdot \left\{ (1 - \lambda_j) \sum_{k=0}^{\infty} \lambda_j^k \mathbf{q}_{it-k} \right\}. \quad (10) $$

This form of the RP ratio is an *infinite* lag distribution that indicates that the relative probabilities depend on *all* past values of the class-membership determinants. It is, therefore, a distributed lag model. This transformation, from an autoregressive model to a distributed lag model and vice versa, is called the Koyck transformation. It is worth highlighting that $\ln \mathrm{RP}_{it|j} = 0$ when $\lambda_j = 1$ in equation (10). In other words, when the autoregressive coefficient is equal to unity, our model collapses to a traditional LCM with prior probabilities that not only do not vary over time but also across farms. In this sense, our DL-LCM can be viewed as an in-between model because it is between a standard LCM with heterogeneous prior probabilities and another standard LCM with homogeneous prior probabilities. Moreover, as the prior probabilities are identical in the latter case, the allocation of observations relies entirely on the relative goodness-of-fit of each set of estimated parameters. This is an interesting result as it might indicate that the standard LCM with no determinants of class membership, often estimated using well-known commercial statistical software, can be viewed as an LCM with full persistence in regime changes (a priori).

In equation (10), note that the researcher only observes the most recent past values of the class-membership determinants, i.e., we only observe $\mathbf{q}_{it-k}$ for all $k \in [0, t - E_i]$. Therefore, equation (10) cannot be estimated as such. In a classical adaptive expectation model of firms' investment, Koyck (1954) faced the same problem. In his model, the time structure of the investment process is characterized by a geometric distributed lag function so that the first weight of this function is determined as a separate parameter, with successive weights declining geometrically. Following this author, we first decompose the *infinite* lag distribution in equation (10) into two terms:

$$ \sum_{k=0}^{\infty} \lambda_j^k \mathbf{q}_{it-k} = \sum_{k=0}^{K_{it}} \lambda_j^k \mathbf{q}_{it-k} + \sum_{k=K_{it}+1}^{\infty} \lambda_j^k \mathbf{q}_{it-k}, \quad (11) $$
where $K_{it} = t - E_i$ is a new temporal variable (hereafter relative time), which denotes the number of periods relative to the first available observation of firm i. While the first term on the right side of equation (11) is observed conditional on the degree of persistence, $\lambda_j$, the second term is unobserved. Koyck (1954) parameterized the unobserved component so that it can be estimated as an additional parameter. This can be done if we redefine conveniently the temporal subscripts of the second component of (11). Note that $\Sigma_{k=K_{it}+1}^{\infty} \lambda_j^k q_{it-k}$ above can be rewritten as $\lambda_j^{K_{it}+1} A_0$, where $A_0 = \Sigma_{l=0}^{\infty} \lambda_j^l q_{i,E_{i-1}-l}$ and $l = k - K_{it} - 1$.<fnref n="10" /> $A_0$ captures all unobserved values of $q_i$ before $E_i$. As $A_0$ is not observed, Koyck (1954) treated it as a common (vector of) parameter(s) that should be estimated together with the other parameters of the model. Taking into account Koyck's parameterization, we can rewrite (11) as follows:

$$ \sum_{k=0}^{\infty} \lambda_j^k q_{it-k} = \mathbf{m}_{it}(\lambda_j) + \lambda_j^{K_{it}+1} A_0, \quad (12) $$

where

$$ \mathbf{m}_{it}(\lambda_j) = \sum_{k=0}^{K_{it}} \lambda_j^k q_{it-k}. \quad (13) $$

As noted earlier, our model assumes that the data run continuously between $E_i$ and $T_i$, but it can still operate when the dataset contains scattered missing observations. However, we do not recommend applying our model in such cases for two main reasons. First, in general, one should be cautious when interpreting results based on panel data that include firms (or production units) with numerous missing observations dispersed across the study period. If data are unavailable for many years, how reliable can the data from the remaining years be? Second, and more importantly, the variable $\mathbf{m}$ in (13) would be measured with error, as the missing values of $\mathbf{q}$ would be excluded from the summation—effectively replacing their true values with zeros. For both reasons, we recommend estimating the DL-LCM model using a continuous (though possibly unbalanced) panel dataset.

Using (12) and (13), we can express the infinitive lag distribution function in equation (10) as:

<footnote n="10">¹⁰ In an infinite distributed lag model where the rate of decrease of the lagged coefficients is determined by $\lambda_j$, $(1 - \lambda_j)A_0$ can be interpreted as the expectation of $\mathbf{q}$ in period $E_i$ made at period $E_i - 1$. See Appendix 1 for more on adaptive expectations.</footnote>
$$ \ln \mathrm{RP}_{it|j} = \delta_j' \mathbf{c}_{1,it} (\lambda_j) + \delta_{0j} c_{2,it} (\lambda_j), \quad (14) $$

where $\mathbf{c}_{1,it} (\lambda_j) = (1 - \lambda_j) \mathbf{m}_{it} (\lambda_j)$ is again a finite lag distribution function of observed values of $\mathbf{q}_{it}$, $c_{2,it} (\lambda_j) = (1 - \lambda_j) \lambda_j^{K_{it}+1}$ can be viewed as a kind of time trend, which is farm-specific in an unbalanced panel dataset, and $\delta_{0j} = \delta_j' \mathbf{A}_0$ is a new parameter to be estimated that aggregates all unobserved terms. Note that equation (14) uses both current and past values of $\mathbf{q}_{it}$ to predict $\ln \mathrm{RP}_{it|j}$. It also depends on $\delta_j' \mathbf{A}_0 (1 - \lambda_j) \cdot \lambda_j^{K_{it}+1}$, which can be interpreted as the relative probability of the most recent period that firm $i$ is not observed ($\ln \mathrm{RP}_{i,E_i-1|j} = \delta_j' \mathbf{A}_0 (1 - \lambda_j)$) down-weighted by the time-trend variable ($\lambda_j^{K_{it}+1}$). As we do not observe $\ln \mathrm{RP}_{i,E_i-1|j}$, we replace this relative probability with $\delta_j' \mathbf{A}_0 (1 - \lambda_j)$ in equation (14) as a parameter that is common to all farms in our model. Recall as well that $\mathbf{A}_0$ aims to proxy all farm-specific previous values of $\mathbf{q}_{i,-l}$. As $\mathbf{A}_0$ is common to all farms, $\delta_j' \mathbf{A}_0 (1 - \lambda_j)$ is undoubtedly an imperfect proxy for the latest farm-specific relative probability that the econometrician does not observe, and hence $\ln \mathrm{RP}_{it|j}$ is measured with bias. It should be pointed out, however, that this bias decreases over time because $\lambda_j^{K_{it}+1}$ decreases over time as $\lambda_j < 1$.

To get an estimable specification, we must develop our model in terms of original probabilities, considering that the relative probability in (7) is just the ratio of two probabilities, that is:

$$ \ln \mathrm{RP}_{it|j} = \ln \left( \frac{\Pi_{it|j}}{\Pi_{it|J}} \right). \quad (15) $$

Replacing $\ln \mathrm{RP}_{it}$ in (15) with the right-hand side of (14), we obtain

$$ \Pi_{it|j} = \exp(\delta_j' \mathbf{c}_{1,it} (\lambda_j) + \delta_{0j} c_{2,it} (\lambda_j)) \cdot \Pi_{it|J}. \quad (16) $$

Recall that $\Pi_{it|J} = 1 - \sum_{h=1}^{J-1} \Pi_{it|h}$. Using equation (16) to express the probability of class $h$ for all $h < J$, we also get

$$ \Pi_{it|J} = \left[ 1 + \sum_{h=1}^{J-1} \exp(\delta_h' \mathbf{c}_{1,it} (\lambda_h) + \delta_{0h} c_{2,it} (\lambda_h)) \right]^{-1}. \quad (17) $$

Therefore, the probability of belonging to class $j$ in our distributed-lag LCM can finally be expressed as
$$ \Pi_{it|j}(\Delta, \Delta_0, \Lambda) = \frac{\exp(\delta_j' c_{1,it}(\lambda_j) + \delta_{0j} c_{2,it}(\lambda_j))}{1 + \sum_{h=1}^{J-1} \exp(\delta_h' c_{1,it}(\lambda_h) + \delta_{0h} c_{2,it}(\lambda_h))} \quad (18) $$

where $\Delta_0 = (\delta_{01}, ..., \delta_{0J-1})$ and $\Lambda = (\lambda_1, ..., \lambda_{J-1})$. The expression in (18) shows that, conditional on the degree of persistence, our model has the same structure as a standard LCM, but with a different set of explanatory variables ($c_{1,it}$ and $c_{2,it}$ instead of $q_{it}$) and two additional sets of parameters ($\Delta_0, \Lambda$). Moreover, the similarity between the probabilities in equations (2) and (18) suggests that our DL-LCM can also be estimated using maximum likelihood techniques. Indeed, the farm $i$ and period $t$ unconditional likelihood function can now be expressed as:

$$ LF_{it}(\Omega) = \sum_{j=1}^{J} LF_{it|j}(\theta_j) \cdot \Pi_{it|j}(\Delta, \Delta_0, \Lambda), \quad (19) $$

where $\Omega = (\Theta, \Delta, \Delta_0, \Lambda)$ is the new set of parameters to be estimated. The overall likelihood function of our distributed-lag LCM can then be written as:

$$ \ln LF(\Omega) = \sum_{i=1}^{N} \sum_{t=E_i}^{T_i} \ln LF_{it}(\Omega). \quad (20) $$

### 3.3. Estimation strategies

Maximization of (20) involves using conventional methods such as BFGS, DFP, or other gradient methods, as in Orea and Kumbhakar (2004).<fnref n="11" /> It is also worth mentioning that since $c_{1,it}$ and $c_{2,it}$ are nonlinear functions of $\lambda$, we cannot use standard routines in Stata or Limdep to estimate our DL-LCM. However, suppose we assume that the degree of persistence parameter is common to all observations. In that case, we can reduce the complexity of the model and estimate $\lambda$ using a grid search approach. In contrast, the other parameters are estimated by ML, conditional on the selected degree of persistence.

Indeed, if the degree of temporal dependence is common to all observations, an alternative empirical strategy arises. The method can be outlined as follows. First, a small value for $\lambda$ is

<footnote n="11">¹¹ Another approach is the EM algorithm (see Greene (2005)). The EM algorithm is employed simply by iterating back and forth between computation of individual (firm) specific posterior class-probabilities and two optimization problems. The first optimization is a weighted log likelihood function for the jth class. The second optimization problem is a weighted multinomial logit model.</footnote>
selected (e.g., $\lambda = 0.01$). Given the chosen value of $\lambda$, we compute $\mathbf{m}_{it}(\lambda)$ as in (13) and estimate a standard LCM using $\mathbf{c}_{1,it}$ and $\mathbf{c}_{2,it}$ as class membership determinants. We store the value of the likelihood function obtained in this step. Since the estimated parameters are functions of $\lambda$, the value of the likelihood function is also a function of $\lambda$, that is, $\ln LF = \ln LF(\lambda)$. Third, we repeat the same procedure several times using larger values for $\lambda$ until we are close to the unity value. Since $\lambda$ is unknown, it must be estimated from the dataset. The most likely degree of temporal dependence is the one that yields the highest value of the likelihood function. We choose the value of $\lambda$ for which $\ln LF(\lambda)$ is maximum, that is:

$$ \hat{\lambda} = \arg \max_{0 \le \lambda < 1} \ln LF(\lambda). \qquad (21) $$

The above procedure becomes more complicated if we allow each class to have its own degree of temporal dependence. In this case, the grid search should be carried out in two or more dimensions. Although we could still use standard software to estimate our DL-LCM with more than two classes, this method loses its appeal when thousands of alternative models must be estimated. For instance, with three classes, we have to estimate about 10,000 models if we increase $\lambda$ by 0.01 units each turn.

### 3.4 Heterogeneous-coefficient specification

The proposed DL-LCM cannot only be estimated by ML using conventional methods but also accommodate a variety of determinants of class-membership persistence. Suppose the model is estimated in a single stage. In that case, it can be easily extended to relax the common degree of temporal dependence assumption and allow for observation-specific degrees of persistence in class membership. In particular, for the most comprehensive specification of our distributed-lag LCM, we will assume that the degree of persistence is parameterized as follows:

$$ \lambda_{it,j} = \frac{\exp(\lambda_{0j} + \lambda'_{1j} z_{it})}{1 + \exp(\lambda_{0j} + \lambda'_{1j} z_{it})} \qquad (22) $$

where $0 \le \lambda_{it,j} \le 1$, $z_{it}$ is a vector of exogenous determinants of the degree of persistence, $\lambda_{1j}$ is the vector of unknown coefficients for exogenous influences and $\lambda_{0j}$ defines the globally persistent (common) degree of temporal dependence. In this case, the relative probability in (12) becomes:

$$ \ln RP_{it|j} = \delta_j' \mathbf{c}_{1,it}(\lambda_{it,j}) + \delta_{0j} \mathbf{c}_{2,it}(\lambda_{it,j}), \qquad (23) $$
where $\mathbf{c}_{1,it} (\lambda_{it,j}) = (1 - \lambda_{it,j}) \mathbf{m}_{it} (\lambda_{it,j})$, $c_{2,it} (\lambda_{it,j}) = (1 - \lambda_{it,j}) \lambda_{it,j}^{K_{it}+1}$, and the parameter $\delta_{0j}$ is defined in the same fashion as in our homogenous-coefficient model.

# 4. Empirical illustration

## 4.1 Data

We illustrate our DL-LCM with an application to the Spanish dairy sector, which has intensified over recent decades. We use an unbalanced panel of 351 Spanish dairy farms in Northern Spain from 2005 to 2014. The total number of observations is 2,430. We expect that the technologies of extensive and intensive farms may differ, but the researcher does not observe them directly in line with del Corral, et al. (2011) and Orea, et al. (2015). We use our model to identify extensive and intensive technologies in milk production.

The dependent variable (Y) is the production of milk (liters). We have considered only one output since these farms are highly specialized (more than 90% of farm income comes from dairy sales). Five inputs are included: Cows ($X_1$) is defined as the number of adult cows in the herd; Feed purchases ($X_2$) includes expenses on concentrates and forage purchases; Forage production expenses ($X_3$) are defined as the costs of seeds, fertilizers, machinery, fuel, and land; Animal expenses ($X_4$) are defined as livestock supplies, breeding and veterinary expenses, and Labor ($X_5$) includes family and hired labor and is measured using Social Security expenses.<fnref n="12" /> As determinants for farm-specific inefficiency, we include (i) the log of the hired-labor share ($d_1$), an inverse indicator of family orientation, and (ii) the log of a composite index of somatic-cell and germ counts in milk ($d_2$). On the one hand, the expected effect of hired labor on dairy farm inefficiency is unclear, as the benefits of hired labor are context-dependent (Garcia-Covarrubias, et al., 2024). On the other hand, a high somatic cell count (SCC) is a key indicator of mastitis, an infection or inflammation of the udder, which reduces milk collection. High germ levels lower milk safety and quality, pose health risks to consumers, and reduce product shelf

<footnote n="12">¹² Note that our production model does not assume that farmers maximize profit or minimize cost, and none of the inputs are modeled as endogenous (decision) variables. We thank an anonymous reviewer for raising this issue, which we are fully aware of. While the issue has been addressed in the stochastic frontier literature (e.g., Amsler, et al. (2016), Karakaplan and Kutlu (2017)), it has not yet been the case in the latent class efficiency literature. One of the authors of this paper is currently trying to avoid, at the very least, the effects of this problem by combining the so-called proxy-variable approach with a latent class structure in a parallel paper. As most of dairy farms' expenses are linked to cattle, land and labor, and these (quasi-fixed) inputs are dynamically determined under the standard structural assumptions, we think that our results are not seriously biased by this issue.</footnote>
life and cheese-making properties. These undesirable effects can also reduce milk sales and, therefore, milk production. In summary, we expect that $d_2$ has a negative impact on farm's technical efficiency (see e.g., Perez-Mendez, et al. (2020)). Regarding the explanatory variables that have to do with the latent class structure of our model, we include two alternative but related indicators of the farm's degree of intensification: concentrate per cow ($Q_1$) and cows per hectare ($Q_2$) in logs. Finally, we use farm size ($Z_1$) measured in hectares and in logs as the determinant of the autoregressive coefficient measuring the degree of a farm's persistency.

All monetary values are converted into 2014 Euros. Table 1 shows descriptive statistics of the variables used to estimate the farms' production function. The data reveals that most farms are small and are traditionally family-owned. However, our sample includes a handful of relatively large farms with a notable number of cows and hectares.

[Insert Table 1 here]

## 4.2 Results and Discussion

### 4.2.1. LCM frontier results

Next, we report the estimation results of several Translog models.<fnref n="13" /> Before estimation, each input was divided by its geometric mean. In this way, the first-order coefficients of the Translog production function can be interpreted as output elasticities evaluated at the geometric mean of the inputs. Table 2 shows the parameter estimates of a single-class stochastic frontier model and the two-class standard latent class model that permits a particular farm to move freely from one class to another over time.<fnref n="14" /> We assume that the variance of the inefficiency term varies across farms. About 50% of the observations are allocated to each group of farms. We make the prior probability of class membership a function of two (separating) variables that measure the degree of intensification of dairy farms: Cows per hectare of land and Concentrate per cow. These two variables are also used in other studies to characterize production technologies (Alvarez and Arias, 2015, Alvarez and del Corral, 2010, Dakpo, et al., 2021, Skevas, 2018). We have labeled the latent class *intensive*, which shows a positive and significant coefficient for Concentrate per cow in the prior probability equation. The estimates of the extensive and

<footnote n="13">¹³ All models have been estimated using GAUSS.</footnote>

<footnote n="14">¹⁴ Two latent classes were considered. We also tried to fit a model with three classes, but it did not converge. Following Orea and Kumbhakar (2004), we take this as evidence that a model with three classes is indeed overspecified.</footnote>
intensive technologies are quite different. Whilst for the pooled stochastic frontier, the number of cows is the input with the highest output elasticity (0.483), for the extensive technology, the elasticity of cows is much lower (0.350), taking on a very high value (0.727) in the case of the intensive group. This was expected since cows in intensive farms are more productive (Alvarez and del Corral, 2010). In the extensive system, purchased feed has the highest elasticity, and its value is larger than the corresponding elasticity in the intensive system. This unexpected result may reflect the fact that extensive farms use much less purchased feed than intensive farms under the law of decreasing returns of input factors. As expected, most estimated coefficients in the pooled stochastic frontier lie between the estimated values for the two technologies of the LCM. Regarding the scale elasticity, as also found in Alvarez and del Corral (2010), the intensive farms have a higher scale elasticity than the extensive farms, probably reflecting that the former have not exhausted their scale economies.

[Insert Table 2 here]

### 4.2.2. LCM efficiency drivers

Regarding the coefficients of farm efficiency drivers, we find that the proportion of hired labor ($d_1$) has a negative effect on the farm's inefficiency in the model with a single class, i.e., introducing hired labor leads to improved efficiency. The standard two-class LCM seems to indicate that this result is caused by the results found in the extensive class, as we find that the proportion of hired labor in the extensive (intensive) class tends to increase (reduce) farms' efficiency. That is, our results suggest, on the one hand, that the relationship between hired labor and dairy farm efficiency can vary depending on the production system and, on the other hand, that the use of hired labor in the dairy sector does not necessarily lead to improved technical efficiency in line with the previous literature. Introducing hired labor tends to lead to efficiency gains in extensive dairy farms. As most of the labor force relies heavily on family labor in these farms, the hired workers can bring specialized skills and allow for better labor allocation, reducing the burden on family members. For instance, Garcia-Covarrubias, et al. (2024) find for their study on Irish dairy farms that hired labor positively affected technical efficiency, especially in smaller farms. Regarding the intensive dairy farming systems, some studies (see e.g., Cabrera, et al. (2010)) indicate that these farms already operate at high-efficiency levels (as also occurs in our application) due to mechanization and optimized processes. Therefore, adding more hired labor does not necessarily lead to further efficiency gains and may even introduce complexities in management.
Furthermore, the coefficient of our measure of somatic cells and germs present in the milk produced by farmers ($d_2$) is always positive, indicating that farms produce less milk with the same amount of cattle inputs, as their animals are unhealthy. Using a similar dataset of dairy farms, Perez-Mendez, et al. (2020) also find that a higher somatic cell count decreases farms' technical efficiency and milk production, resulting in reductions that generate significant profit losses for farmers. As the coefficient found for $d_2$ is slightly larger than 0.7 in the intensive class and close to 0.5 in the extensive class, our application complements the previous findings by noting that the reductions in farms' efficiency are larger for intensive farms than for extensive farms.

### 4.2.3. DL-LCM degree of persistence results

Table 3 contains the estimation of the two versions of the DL-LCM. The first assumes that the degree of temporal dependence is common to all farms, i.e., $\lambda$ is estimated as an additional parameter in the likelihood function.<fnref n="15" /> For the second one, we make the autoregressive coefficient a logistic function of farm size ($z_{it}$).<fnref n="16" /> In general, there are no significant differences between the two DL-LCMs. Additionally, they are not that different from the standard LCM in Table 2. The key parameters in Table 3 are the intercept of the logistic function ($\lambda_0$) and the coefficient of farm size ($\lambda_1$), which measures the degree of persistence of farms. When the autoregressive coefficient is specified as a single parameter, the estimate of $\lambda_0$ is extremely close to zero. This implies that the degree of temporal dependence of class probabilities is about 52%, thus leading us to conclude that farms show some degree of dependence, which slows their transition to other classes. As underlined in the introduction, several economic forces likely generate this high—but not absolute—persistence in class membership. Among others, we could mention the existence of significant (sunk) investments in current technologies; the costs of training and experimentation with a new milk production system; risk aversion under price and policy uncertainty; long-term credit arrangements or input-supply contracts associated with the current technology; or the existence of system-level complementarities in terms of specialized genetics, feed blends, or data platforms.

<footnote n="15">¹⁵ Practically, what we estimate here is $e^{\lambda_0}/(1 + e^{\lambda_0})$.</footnote>

<footnote n="16">¹⁶ An appealing feature of this variable is that farm land (hectares) rarely changes over time, and hence it has nothing to do with class membership changes, the main issue examined in this paper.</footnote>
It is worth highlighting that the mean autoregressive coefficient (0.596) in the heterogeneous specification of our DL-LCM is similar but slightly larger than in the homogeneous specification (0.522), indicating that the average degree of dependence is robust to the heterogeneous or homogeneous nature of the autoregressive coefficient. Moreover, when we model $\lambda_{it}$ as a function of $z_{it}$, we obtain a significant negative coefficient for farm size. This indicates that large farms have lower temporal dependence on class membership than smaller farms in line with Läpple, et al. (2017) who find that farmers with larger (and more intensively farmed) holdings are more likely to adopt new technologies. This finding is also consistent with the observed pattern of intensification in the sector, where larger farms are the ones that show a tendency to become more intensive (i.e., to change class). In practice, to move from extensive to intensive, a change in the composition of the herd distribution is required (in terms of age). For instance, in the case of intensive farms, the replacement rate of heifers is high because highly productive cows have a shorter productive life. Overall, this gradualism was reflected in the reduction of the number of farms, resulting in land concentration (increasing farm size), followed by a modernization of production processes necessary with increased animal density.

In other settings, larger farms can switch technologies more readily because they dilute lumpy fixed costs (e.g., a robot barn or slurry system) over higher output volumes, enjoy better access to credit by offering more collateral, and typically employ a broader labor pool that can absorb training without disrupting routine work. Their scale also diversifies income streams, lowering any experimentation's downside risk and offers them tighter links to suppliers and extension agents who provide discounts and technical support. Finally, many environmental or quality regulations—and the subsidies tied to them—kick in at herd- or land-size thresholds, nudging the biggest farms to upgrade first. These factors weaken the sunk cost, learning curve, and financing frictions that keep smaller farms locked into their current regime, so persistence falls as farm size rises.

[Insert Table 3 here]

Figure 1 aims to illustrate the above findings. This figure shows the farm size distribution and the autoregressive coefficients of our heterogeneous-coefficient DL-LCM.<sup>17</sup> We find that both kernel densities are relatively symmetric. The right kernel density suggests a range for the autoregressive coefficient of 0.238 to 0.874. As we obtain a negative coefficient for farm size,

<footnote n="17"><sup>17</sup> Farm size in the first panel of the figure is measured in deviations with respect to the sample mean.</footnote>
the lower autoregressive coefficients correspond to the highest values of farm size. However, as the distribution is relatively symmetric, we conclude that many farms in our heterogeneous-coefficient DL-LCM exhibit moderate degrees of temporal dependence on their prior class membership probabilities. In contrast, a handful of farms located in the tails have difficulty changing class or lack a notable capability to do so.

[Insert Figure 1 here]

### 4.2.4. Efficiency scores and predicted output comparison

Table 4 shows the statistics of the efficiency scores of intensive and extensive farms. The farms were classified as *Intensive* using the highest (greater than 0.5) estimated posterior probabilities since these provide the best estimates of class-membership for an individual observation (Greene, 2005). Based on the estimated prior class probabilities, posterior probabilities of belonging to either the extensive or intensive groups were computed using equation (5). In our standard LCM, 1,187 observations were classified as intensive, whereas 1,243 observations were considered as extensive. A similar classification is obtained using the DL-LCM with homogeneous autoregressive coefficients (1,191 and 1,239, respectively). Finally, the DL-LCM with heterogeneous autoregressive coefficients allocates slightly fewer (more) farms to the intensive (extensive) class than the two previous models. However, the allocation is still highly correlated with the other two. We use the Jondrow, et al. (1982) method to calculate the technical efficiency for each observation. In general, we find high efficiency scores for our set of dairy farms. For instance, the average efficiency is nearly 90% using a single-class frontier model. Moreover, using a standard LCM we find that the average technical efficiency of intensive farms is slightly larger (93.6%) than that of extensive farms (90%), in line with Alvarez and del Corral (2010) and Orea, et al. (2015). Again, similar efficiency scores were obtained for both groups of farms using both homogeneous and heterogeneous-coefficient DL-LCMs (93.3% and 90%, respectively). This seems to suggest that our efficiency scores are robust to the persistence of regime change issues.

[Insert Table 4 here]

Rigorously speaking, we cannot directly compare the efficiency scores and conclude that one technology is more productive.<fnref n="18" /> Here our exercise is to compare the relative distance of each farm to its group frontier. A metafrontier can be the solution when comparing both intensive

<footnote n="18">¹⁸ We thank an anonymous reviewer for raising this critical point.</footnote>
and extensive technologies.<fnref n="19" /> As this analysis is beyond the scope of our paper, we follow Kumbhakar, et al. (2009) and Alvarez and del Corral (2010) to estimate the predicted output (in liters) for both technologies and also calculate the ratio of intensive predicted outputs over the extensive ones (see Table 5). Over the years, this ratio has consistently been higher than one, indicating that the frontier for intensive farms tends to be located above that of extensive farms, in line with Alvarez and del Corral (2010). It is also worth noting that the gap between the two frontiers has experienced a gradual increase over time.

[Insert Table 5 here]

Table 6 reports the distribution of the predicted output ratio between the intensive and extensive frontiers. For roughly 82 percent of the observations, the intensive frontier lies above the extensive one, and the mean technical efficiency calculated relative to each farm's frontier is likewise higher for intensive than for extensive producers. These findings indicate that, within our sample, farms operating the intensive technology achieve systematically greater productivity than those relying on the extensive regime. This, however, does not mean that the intensive technology is superior. It depends on the context. For example, the Ukraine-Russia war has caused a spike in prices like energy, fertilizers, and primarily feedstuff that intensive farms are more dependent upon. On the one hand, should the upward trend prove persistent in energy prices, it might be a good strategy for intensive farms to transition to extensive farming. On the other hand, in the case of climate-induced events (e.g., localized droughts) that prevent extensive farms from producing their feedstuff, they might have to import food and progressively move to intensive farming (unless switching to quality labeling and certification – e.g., PDOs). Farming trajectories are also shaped by fixed environmental variables (altitude, slope), where some farm types are more adaptable, and by structural characteristics like land fragmentation (see Orea, et al. (2015)).

[Insert Table 6 here]

### 4.2.5. Relative probability examination

<footnote n="19">¹⁹ Recent developments in estimating the stochastic metafrontier can be found in Amsler, et al. (2017), Huang, et al. (2014). Moreover, Latruffe, et al. (2023) have combined the metafrontier and the LCM approaches to compare extensive and intensive dairy farms across some European countries.</footnote>
To approximate some of the consequences of persistence for regime changes in our application, we now focus our analysis on the temporal evolution of the prior probabilities of class membership with and without persistence. A summary of this analysis can be found in Table 7. Panel a) of this table shows the descriptive statistics of the individual standard deviations of the so-called *Estimated and Simulated ln RP*.<fnref n="20" /> The so-called *Estimated ln RP* values have been computed using equation (14) under the assumption of some temporal dependence (i.e., using the estimated $\lambda$ values). The so-called *Simulated ln RP* values have been computed using the same set of parameters but using equation (8).<fnref n="21" /> The latter equation does not include any autoregressive coefficient, neglecting any temporal dependence of class probabilities. In the case of the standard LCM, both estimated and simulated values coincide because this specification assumes that $\lambda = 0$. According to the results presented in panel a), as expected, we observe that the standard deviations of the simulated RP ratios are indeed larger than the standard deviations of the estimated RP ratios, whose prior probabilities suffer from resistance to changing class, particularly in the case of the homogeneous-coefficient DL-LCM specification. Interestingly, the standard LCM does not generate larger year-to-year swings in the estimated prior probabilities than our DL-LCM, despite the standard one allowing class membership to switch freely. Likewise, the estimated autoregressive coefficient in our DL-LCM is appreciably different from zero. This is an expected result because the DL-LCM attributes the temporal pattern of estimated RP ratios to two economic forces—(i) deliberate changes in observable covariates that capture a farm's efforts to shift its production system, and (ii) unobserved frictions such as adjustment costs or knowledge gaps that slow the transition. In contrast, the standard LCM bundles these forces together, obscuring the mechanisms behind persistence. For the same reason, the standard LCM is not free from the effect that such frictions can have on the evolution of class membership.

[Insert Table 7 here]

Note also in Table 7 that some dairy farms' volatility (standard deviation), is much larger than the average volatility. The large volatility can be caused by the simple temporal variation of the determinants of farms' prior class membership probabilities. Panel b) of Table 7 shows the

<footnote n="20">²⁰ More concretely, $\ln RP_{it}$ is computed for each observation, so that for each farm i the standard deviation is computed. Table 7 presents the summary statistics of these new figures.</footnote>

<footnote n="21">²¹ In other words, we have used equation (15) but assume that $\lambda = 0$.</footnote>
descriptive statistics of the individual standard deviations of the two time-varying covariates determining farms' prior probabilities. These variables have changed over time varying substantially for some farms. To better observe this relationship, panel c) of Table 7 shows the correlation coefficients between the individual standard deviations of the two sets of standard deviations shown in panels a) and b). As expected, both sets of standard deviations are highly correlated. Note, however, that the standard deviation of (logged) concentrate per cow ($q_1$) tends to capture most of the standard deviations of both estimated and simulated RP ratios. In the case of the heterogeneous-coefficient DL-LCM, the standard deviations of the estimated RP ratio seem to be related with the dissimilar degree of persistence of class membership found for each farm. In order to examine this issue better, we plot the standard deviation of the logged RP ratio of each farm against their degree of persistence of class membership in Figure 2.<fnref n="22" /> This figure shows that, as expected, there is a weak negative relationship between lnRP volatility and class persistence because the larger the degree of persistence of class membership, the smaller the temporal variation of the ratio of the two prior probabilities.

[Insert Figure 2 here]

More details on the temporal evolution of estimated and simulated RP series can be found in Appendix 2. This appendix shows the farm-specific trends of estimated and simulated RP ratios using the heterogeneous-coefficient DL-LCM. While the solid line in the figures represents the estimated logged RP values, the dotted line represents the simulated values with no persistence. Due to space limitations, we only show the trends of 100 farms observed during the period examined in the paper. The farms differ widely in terms of average RP ratio as well as in terms of the evolution of RP over time. From the figures in Appendix 2, we see that most farms experienced changes in RP from 2005 to 2014. Moreover, the volatility of RP predicted by the heterogeneous-coefficient DL-LCM (shown by the solid lines) is lower than that predicted by simulated RP with no persistence in class membership (indicated by the dotted lines).<fnref n="23" /> Therefore, our DL-LCM specifications suggest that the Spanish dairy sector poses moderate resistance to changing from intensive to extensive milk production systems and vice versa. Recall that the standard deviations of the RP ratios of the standard LCM are similar but slightly smaller than those of the DL-LCMs. This can be seen in Appendix 3, which replicates the

<footnote n="22">²² We trim 2.5% of observations in each tail of the distribution of lnRP in order to improve the figure.</footnote>

<footnote n="23">²³ Similar comments can be made for the farm-specific trends of estimated and simulated RP ratios using the homogeneous -coefficient DL-LCM as the average degrees of persistence found in both DL-LCMs are similar. For this reason, they are not shown in our appendices.</footnote>
figures in Appendix 2 but uses the estimated RP ratios of our heterogeneous-coefficient DL-LCM and the standard LCM. The first feature that draws attention is that both trends exhibit similar changes over time.

In contrast to the simulated RP ratio shown in Appendix 2, we cannot state that one trend exhibits larger changes. The temporal changes of the estimated RP ratios of the heterogeneous-coefficient DL-LCM are in fact much larger than those found using a standard LCM *when* the evolution in recent years confirms past trends. This is an expected result. Conceptually, the DL-LCM uses past information to 'learn' the temporal structure of the RP ratios. As in a typical distributed-lag model, our DL-LCM can amplify or smooth the temporal changes of the estimated RP ratios depending on the estimated lag structure. When recent values of our *q* variables align with prior values, the model tends to accumulate their effects, potentially amplifying the change in the RP ratios. Conversely, the cumulative effect may be dampened if recent values contradict past values. From a practical point of view, this implies that our DL-LCM should not be used to soften the temporal evolution of the prior probabilities of class membership. It mainly serves to understand whether any underlying forces prevent firms from changing technology, information that can be appreciated simply by comparing the so-called estimated and simulated RP ratios of our DL-LCM.

Finally, we would like to conclude this section by noting that, although our theoretical model accommodates more than two classes, we have limited our empirical application to just two, as dairy farms typically operate under intensive or extensive milk production systems. To demonstrate that the proposed DL-LCM can also be applied to estimate other functions of interest, we provide in Appendix 4 the results of several non-frontier, multi-class hedonic milk price equations. Note that inefficiency is irrelevant in this context. This implies that, unlike our application to milk production functions, the error term in the milk price equations is symmetrically distributed. In this case, milk price depends on quality attributes and delivery volumes. The results are robust. More importantly, we encounter no convergence issues when estimating these non-frontier hedonic milk price equations. This is an expected outcome, as in practice, ignoring the asymmetric error term typically associated with inefficiency often helps avoid convergence problems when estimating a latent class model, which is inherently highly non-linear.

# 5. Conclusions
This paper proposes a latent class model (LCM) with a distributed lag structure (DL). This
structure allows testing the existence of underlying forces that prevent observations from
changing regimes. As pointed out by Tsionas and Kumbhakar (2004), this framework is well
suited for studies where the adoption of a different technology is believed to be costly and has
some adjustment costs, or when the researcher detects that some observations switch to a
different regime while others remain in the same regime over time. Our DL-LCM can
accommodate a variety of determinants of both class membership and persistence of current
class memberships, whilst also permitting the use of balanced or unbalanced panel datasets for
its estimation. Moreover, although our application only requires estimating a two-class DL-
LCM, we have developed our theoretical framework in a multiple-regime setting, i.e., with two
or more classes. Our model can thus be used as well in micro and aggregate/macro applications
where a latent class model with two classes or regimes is not good enough to capture most of
the underlying cross-sectional heterogeneity among production units. A hedonic milk price
equation is used to illustrate that our DL-LCM framework can also be applied in non-frontier
and multi-class contexts. Another appealing feature of our DL-LCM is that it can be estimated
by ML using conventional econometric software, especially its homoscedastic specification.

In our application for a panel data set of Spanish dairy farms, we find evidence of resistance to
replacing one milk production system with another in this sector. Despite this, the standard
latent class model performs reasonably well in terms of class-membership probabilities and
temporal patterns. We also find that the small farms have greater difficulty changing their milk
production systems. In this sense, the heterogeneous-coefficient specification of our model
proves to be a valuable device for identifying the formation of clubs in terms of their persistence
of class membership. The lack of available plots in rural Asturias might explain why small
farms, most of which are family-owned, resist changing their milk production systems.
Regional policymakers have implemented more than 250 public land consolidation processes
in this region since the 1960s in order to reduce land fragmentation in Asturias and improve
economic activity in rural areas. The resistance to replacing one milk production system with
another found in our paper might explain why Orea, et al. (2024) recently discovered, using
parish-level data, that these land consolidation processes had a moderate effect on farm size.

To conclude this section, it is worth highlighting that although the degree of temporal
dependence is farm-specific in our heterogeneous-coefficient DL-LCM, it takes the same value
regardless of the probability of a particular class decreasing or increasing over time. In other
words, our model implicitly assumes that firms (farms) find switching from technology j to
technology $h \neq j$ (from intensive to extensive systems of milk production) as difficult as
changing from technology $h$ to technology $j$ (from extensive to intensive regimes). That is, the
degree of persistence in our model is heterogeneous but symmetric. As it is unclear how to
address this limitation in our (frequentist) framework, we leave its examination for future
research. Moreover, we also believe that studies comparing Bayesian and frequentist
approaches in the SFA framework, in general, and specifically our DL-LCM model with the
Markov approach by Tsionas and Kumbhakar (2004), also constitute a promising avenue for
future research. Finally, another future avenue of research would be to investigate more fully
the performance of the model in the frontier framework with more than two classes, as the
model does not converge for three classes in this setting.

**Declaration of competing interest**

The authors reported no potential conflict of interest.

**Data and code availability**

The original data used in the empirical analysis is part of a voluntary record-keeping program
that the regional government conducted over 10 years from 2005 to 2014. The transformed
variables and indicators used in the paper and the GAUSS codes used to estimate our models
are available here: https://github.com/loreasan/DL-LCM.

**Acknowledgments**

We are indebted to Antonio Álvarez for encouraging us to think about factors that might prevent
changing the productive technology in dairy farms and how to capture these rigidities using a
latent class model.

**Author contributions**

All authors contributed to the study's conception and design. Luis Orea performed material
preparation and data collection. Both authors collaborated in the writing of different versions
of the manuscript. The empirical models were developed and estimated by Luis Orea. All
authors read and approved the final manuscript.

**Funding**

This paper is part of the Spanish research project "Estrategias para garantizar la sostenibilidad económica, medioambiental y social de productores y empresas agroalimentarias: eficiencia,
valor añadido y control de gestión” (Project MCIU-22-PID2021-128434NB-I00). Luis Orea gratefully acknowledge financial support from the Government of the Principality of Asturias and the European Regional Development Fund (IDE/2024/000712), the Government of the Community of Madrid / ESF (PHS-2024/PH-HUM-530), and the Paris-Saclay Applied Economics (PSAE) Unit and the Paris-Saclay Graduate School of Economics & Management.
<table><caption>**Table 1.** Summary statistics.</caption><thead><tr><th>Type</th><th>Variable</th><th>Description</th><th>Obs.</th><th>Mean</th><th>St. Dev.</th><th>Min</th><th>Max</th></tr></thead><tbody><tr><td rowspan="2">Output</td><td rowspan="2">Y</td><td>Milk (1,000 liters)</td><td>2,430</td><td>362.70</td><td>271.90</td><td>9.06</td><td>2,411</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td rowspan="5">Inputs</td><td>X<sub>1</sub></td><td>Cows</td><td>2,430</td><td>45.54</td><td>27.98</td><td>5</td><td>222.8</td></tr><tr><td>X<sub>2</sub></td><td>Purchased feed (1,000€)</td><td>2,430</td><td>56.52</td><td>47.25</td><td>0.02</td><td>467.9</td></tr><tr><td>X<sub>3</sub></td><td>Farm expenses (1,000€)</td><td>2,430</td><td>26.35</td><td>22.12</td><td>1.06</td><td>209.2</td></tr><tr><td>X<sub>4</sub></td><td>Animal expenses (1,000€)</td><td>2,430</td><td>15.96</td><td>12.97</td><td>0.57</td><td>153.0</td></tr><tr><td>X<sub>5</sub></td><td>Labor (1,000€)</td><td>2,430</td><td>4.89</td><td>2.96</td><td>0.09</td><td>54.4</td></tr><tr><td rowspan="2">Efficiency determinants</td><td>d<sub>1</sub></td><td>Hired labor (%)</td><td>2,430</td><td>10.56</td><td>22.58</td><td>0</td><td>100</td></tr><tr><td>d<sub>2</sub></td><td>Milk somatic cells and germs (index)</td><td>2,430</td><td>15.28</td><td>0.60</td><td>12.80</td><td>19.2</td></tr><tr><td rowspan="2">Prior probability determinants</td><td>Q<sub>1</sub></td><td>Concentrates per cow (Kg)</td><td>2,430</td><td>3.55</td><td>1.55</td><td>0.01</td><td>18.8</td></tr><tr><td>Q<sub>2</sub></td><td>Cows per hectare</td><td>2,430</td><td>2.32</td><td>1.31</td><td>0.22</td><td>16.9</td></tr><tr><td rowspan="2">Autoregressive coefficient determinant</td><td>Z<sub>1</sub></td><td>Farm land (hectares)</td><td>2,430</td><td>21.68</td><td>12.74</td><td>3</td><td>124.0</td></tr></tbody></table>
<table><caption>**Table 2.** Parameter estimates. Standard LCM and pooled SF model.</caption><thead><tr><th rowspan="2"></th><th colspan="3">Single-class model</th><th colspan="4">Standard latent class model</th></tr><tr><th>Coef.</th><th>s.e.</th><th></th><th>Coef.</th><th>s.e.</th><th>Coef.</th><th>s.e.</th></tr></thead><tbody><tr><td colspan="8"><em>Frontier</em></td></tr><tr><td>Intercept</td><td>12.717</td><td>***</td><td>0.012</td><td>12.725</td><td>***</td><td>0.015</td><td>12.684</td><td>***</td><td>0.019</td></tr><tr><td>x<sub>1</sub></td><td>0.483</td><td>***</td><td>0.013</td><td>0.727</td><td>***</td><td>0.029</td><td>0.350</td><td>***</td><td>0.027</td></tr><tr><td>x<sub>2</sub></td><td>0.352</td><td>***</td><td>0.008</td><td>0.188</td><td>***</td><td>0.017</td><td>0.405</td><td>***</td><td>0.017</td></tr><tr><td>x<sub>3</sub></td><td>0.103</td><td>***</td><td>0.007</td><td>0.043</td><td>***</td><td>0.013</td><td>0.131</td><td>***</td><td>0.013</td></tr><tr><td>x<sub>4</sub></td><td>0.086</td><td>***</td><td>0.008</td><td>0.093</td><td>***</td><td>0.013</td><td>0.092</td><td>***</td><td>0.015</td></tr><tr><td>x<sub>5</sub></td><td>0.042</td><td>***</td><td>0.007</td><td>0.033</td><td>***</td><td>0.012</td><td>0.043</td><td>***</td><td>0.013</td></tr><tr><td>1/2·x<sub>1</sub><sup>2</sup></td><td>0.329</td><td>***</td><td>0.045</td><td>0.296</td><td>**</td><td>0.123</td><td>0.412</td><td>***</td><td>0.104</td></tr><tr><td>1/2·x<sub>2</sub><sup>2</sup></td><td>0.088</td><td>***</td><td>0.008</td><td>0.128</td><td>***</td><td>0.028</td><td>0.121</td><td>***</td><td>0.015</td></tr><tr><td>1/2·x<sub>3</sub><sup>2</sup></td><td>0.075</td><td>***</td><td>0.020</td><td>0.041</td><td></td><td>0.029</td><td>0.125</td><td>***</td><td>0.031</td></tr><tr><td>1/2·x<sub>4</sub><sup>2</sup></td><td>0.008</td><td></td><td>0.017</td><td>0.081</td><td>*</td><td>0.043</td><td>-0.049</td><td></td><td>0.031</td></tr><tr><td>1/2·x<sub>5</sub><sup>2</sup></td><td>0.020</td><td></td><td>0.014</td><td>0.021</td><td>*</td><td>0.011</td><td>-0.027</td><td></td><td>0.026</td></tr><tr><td>x<sub>1</sub>·x<sub>2</sub></td><td>-0.215</td><td>***</td><td>0.020</td><td>-0.109</td><td>**</td><td>0.053</td><td>-0.420</td><td>***</td><td>0.048</td></tr><tr><td>x<sub>1</sub>·x<sub>3</sub></td><td>-0.088</td><td>***</td><td>0.027</td><td>-0.209</td><td>***</td><td>0.044</td><td>-0.033</td><td></td><td>0.047</td></tr><tr><td>x<sub>1</sub>·x<sub>4</sub></td><td>0.087</td><td>***</td><td>0.021</td><td>0.008</td><td></td><td>0.051</td><td>0.114</td><td>**</td><td>0.047</td></tr><tr><td>x<sub>1</sub>·x<sub>5</sub></td><td>0.108</td><td>***</td><td>0.030</td><td>-0.005</td><td></td><td>0.042</td><td>0.236</td><td>***</td><td>0.050</td></tr><tr><td>x<sub>2</sub>·x<sub>3</sub></td><td>0.015</td><td></td><td>0.012</td><td>0.118</td><td>***</td><td>0.025</td><td>0.010</td><td></td><td>0.025</td></tr><tr><td>x<sub>2</sub>·x<sub>4</sub></td><td>0.007</td><td></td><td>0.012</td><td>-0.085</td><td>**</td><td>0.034</td><td>0.100</td><td>***</td><td>0.030</td></tr><tr><td>x<sub>2</sub>·x<sub>5</sub></td><td>-0.060</td><td>***</td><td>0.020</td><td>0.002</td><td></td><td>0.030</td><td>-0.076</td><td>**</td><td>0.032</td></tr><tr><td>x<sub>3</sub>·x<sub>4</sub></td><td>-0.031</td><td>*</td><td>0.016</td><td>0.014</td><td></td><td>0.024</td><td>-0.078</td><td>***</td><td>0.027</td></tr><tr><td>x<sub>3</sub>·x<sub>5</sub></td><td>-0.004</td><td></td><td>0.014</td><td>-0.021</td><td></td><td>0.017</td><td>-0.012</td><td></td><td>0.023</td></tr><tr><td>x<sub>4</sub>·x<sub>5</sub></td><td>-0.016</td><td></td><td>0.016</td><td>-0.008</td><td></td><td>0.021</td><td>-0.040</td><td></td><td>0.027</td></tr><tr><td colspan="8"><em>Noise term (lnσ<sub>v</sub>)</em></td></tr><tr><td>Intercept</td><td>-2.231</td><td>***</td><td>0.028</td><td>-2.660</td><td>***</td><td>0.077</td><td>-2.163</td><td>***</td><td>0.058</td></tr><tr><td colspan="8"><em>Inefficiency term (lnσ<sub>u</sub>)</em></td></tr><tr><td>Intercept</td><td>-2.050</td><td>***</td><td>0.066</td><td>-2.402</td><td>***</td><td>0.173</td><td>-2.223</td><td>***</td><td>0.137</td></tr><tr><td>d<sub>1</sub></td><td>-0.275</td><td>**</td><td>0.116</td><td>0.442</td><td>**</td><td>0.215</td><td>-1.412</td><td>**</td><td>0.633</td></tr><tr><td>d<sub>2</sub></td><td>0.585</td><td>***</td><td>0.054</td><td>0.726</td><td>***</td><td>0.119</td><td>0.536</td><td>***</td><td>0.061</td></tr><tr><td colspan="8"><em>Prior probabilities</em></td></tr><tr><td>Intercept</td><td></td><td></td><td></td><td>-0.297</td><td></td><td>0.182</td><td></td><td></td><td></td></tr><tr><td>q<sub>1</sub></td><td></td><td></td><td></td><td>3.655</td><td>***</td><td>0.425</td><td></td><td></td><td></td></tr><tr><td>q<sub>2</sub></td><td></td><td></td><td></td><td>-0.081</td><td></td><td>0.243</td><td></td><td></td><td></td></tr><tr><td colspan="8"><em>Time effects</em></td></tr><tr><td></td><td>Yes</td><td></td><td></td><td>Yes</td><td></td><td></td><td>Yes</td><td></td><td></td></tr><tr><td>Obs.</td><td>2,430</td><td></td><td></td><td>1,187</td><td></td><td></td><td>1,243</td><td></td><td></td></tr><tr><td>lnLF</td><td>1,413.50</td><td></td><td></td><td>1,561.22</td><td></td><td></td><td></td><td></td><td></td></tr></tbody></table>

Note: *, **, and *** indicate significance at the 10%, 5%, and 1% levels, respectively.
<table><caption>**Table 3.** Parameter estimates. DL-LCM.</caption><thead><tr><th rowspan="3"></th><th colspan="4">Homogeneous coefficient</th><th colspan="4">Heterogeneous coefficient</th></tr><tr><th colspan="2">Intensive</th><th colspan="2">Extensive</th><th colspan="2">Intensive</th><th colspan="2">Extensive</th></tr><tr><th>Coef.</th><th>s.e.</th><th>Coef.</th><th>s.e.</th><th>Coef.</th><th>s.e.</th><th>Coef.</th><th>s.e.</th></tr></thead><tbody><tr><td><strong>Frontier</strong></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Intercept</td><td>12.738</td><td>***</td><td>0.009</td><td>12.688</td><td>***</td><td>0.009</td><td>12.743</td><td>***</td><td>0.017</td><td>12.691</td><td>***</td><td>0.017</td></tr><tr><td>x<sub>1</sub></td><td>0.751</td><td>***</td><td>0.021</td><td>0.365</td><td>***</td><td>0.021</td><td>0.780</td><td>***</td><td>0.042</td><td>0.362</td><td>***</td><td>0.023</td></tr><tr><td>x<sub>2</sub></td><td>0.143</td><td>***</td><td>0.018</td><td>0.394</td><td>***</td><td>0.017</td><td>0.124</td><td>***</td><td>0.025</td><td>0.395</td><td>***</td><td>0.016</td></tr><tr><td>x<sub>3</sub></td><td>0.088</td><td>***</td><td>0.012</td><td>0.104</td><td>***</td><td>0.014</td><td>0.095</td><td>***</td><td>0.014</td><td>0.102</td><td>***</td><td>0.012</td></tr><tr><td>x<sub>4</sub></td><td>0.060</td><td>***</td><td>0.015</td><td>0.119</td><td>***</td><td>0.016</td><td>0.050</td><td>***</td><td>0.016</td><td>0.122</td><td>***</td><td>0.017</td></tr><tr><td>x<sub>5</sub></td><td>0.044</td><td>***</td><td>0.015</td><td>0.042</td><td>**</td><td>0.018</td><td>0.045</td><td>***</td><td>0.013</td><td>0.043</td><td>***</td><td>0.012</td></tr><tr><td>1/2·x<sub>1</sub><sup>2</sup></td><td>0.367</td><td>***</td><td>0.020</td><td>0.448</td><td>***</td><td>0.060</td><td>0.457</td><td>***</td><td>0.158</td><td>0.432</td><td>***</td><td>0.098</td></tr><tr><td>1/2·x<sub>2</sub><sup>2</sup></td><td>0.302</td><td>***</td><td>0.028</td><td>0.117</td><td>***</td><td>0.013</td><td>0.320</td><td>***</td><td>0.047</td><td>0.119</td><td>***</td><td>0.013</td></tr><tr><td>1/2·x<sub>3</sub><sup>2</sup></td><td>0.023</td><td></td><td>0.023</td><td>0.131</td><td>***</td><td>0.019</td><td>0.023</td><td></td><td>0.031</td><td>0.132</td><td>***</td><td>0.028</td></tr><tr><td>1/2·x<sub>4</sub><sup>2</sup></td><td>0.004</td><td></td><td>0.017</td><td>-0.012</td><td></td><td>0.021</td><td>-0.001</td><td></td><td>0.031</td><td>-0.005</td><td></td><td>0.031</td></tr><tr><td>1/2·x<sub>5</sub><sup>2</sup></td><td>0.024</td><td></td><td>0.015</td><td>-0.021</td><td></td><td>0.021</td><td>0.024</td><td>**</td><td>0.010</td><td>-0.017</td><td></td><td>0.024</td></tr><tr><td>x<sub>1</sub>·x<sub>2</sub></td><td>-0.233</td><td>***</td><td>0.022</td><td>-0.435</td><td>***</td><td>0.027</td><td>-0.280</td><td>***</td><td>0.072</td><td>-0.426</td><td>***</td><td>0.047</td></tr><tr><td>x<sub>1</sub>·x<sub>3</sub></td><td>-0.107</td><td>***</td><td>0.036</td><td>-0.005</td><td></td><td>0.029</td><td>-0.092</td><td>*</td><td>0.055</td><td>-0.003</td><td></td><td>0.043</td></tr><tr><td>x<sub>1</sub>·x<sub>4</sub></td><td>-0.078</td><td>**</td><td>0.033</td><td>0.097</td><td>***</td><td>0.021</td><td>-0.117</td><td>*</td><td>0.064</td><td>0.093</td><td>**</td><td>0.043</td></tr><tr><td>x<sub>1</sub>·x<sub>5</sub></td><td>0.044</td><td>**</td><td>0.019</td><td>0.205</td><td>***</td><td>0.028</td><td>0.046</td><td></td><td>0.038</td><td>0.202</td><td>***</td><td>0.050</td></tr><tr><td>x<sub>2</sub>·x<sub>3</sub></td><td>0.010</td><td></td><td>0.024</td><td>-0.003</td><td></td><td>0.022</td><td>-0.013</td><td></td><td>0.036</td><td>-0.007</td><td></td><td>0.024</td></tr><tr><td>x<sub>2</sub>·x<sub>4</sub></td><td>-0.001</td><td></td><td>0.022</td><td>0.130</td><td>***</td><td>0.019</td><td>0.033</td><td></td><td>0.048</td><td>0.126</td><td>***</td><td>0.029</td></tr><tr><td>x<sub>2</sub>·x<sub>5</sub></td><td>-0.027</td><td></td><td>0.018</td><td>-0.071</td><td>***</td><td>0.020</td><td>-0.024</td><td></td><td>0.028</td><td>-0.075</td><td>**</td><td>0.030</td></tr><tr><td>x<sub>3</sub>·x<sub>4</sub></td><td>0.068</td><td>***</td><td>0.016</td><td>-0.116</td><td>***</td><td>0.018</td><td>0.074</td><td>***</td><td>0.023</td><td>-0.116</td><td>***</td><td>0.026</td></tr><tr><td>x<sub>3</sub>·x<sub>5</sub></td><td>-0.036</td><td>**</td><td>0.017</td><td>0.000</td><td></td><td>0.018</td><td>-0.037</td><td>**</td><td>0.017</td><td>0.000</td><td></td><td>0.020</td></tr><tr><td>x<sub>4</sub>·x<sub>5</sub></td><td>-0.009</td><td></td><td>0.018</td><td>-0.042</td><td>**</td><td>0.021</td><td>-0.014</td><td></td><td>0.019</td><td>-0.037</td><td></td><td>0.025</td></tr><tr><td><strong>Noise term (lnσ<sub>v</sub>)</strong></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Intercept</td><td>-2.708</td><td>***</td><td>0.026</td><td>-2.136</td><td>***</td><td>0.023</td><td>-2.724</td><td>***</td><td>0.099</td><td>-2.158</td><td>***</td><td>0.053</td></tr><tr><td><strong>Inefficiency term (lnσ<sub>u</sub>)</strong></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Intercept</td><td>-2.312</td><td>***</td><td>0.021</td><td>-2.227</td><td>***</td><td>0.029</td><td>-2.300</td><td>***</td><td>0.145</td><td>-2.186</td><td>***</td><td>0.130</td></tr><tr><td>d<sub>1</sub></td><td>0.367</td><td>***</td><td>0.021</td><td>-1.154</td><td>**</td><td>0.020</td><td>0.355</td><td>**</td><td>0.157</td><td>-0.967</td><td>*</td><td>0.525</td></tr><tr><td>d<sub>2</sub></td><td>0.687</td><td>***</td><td>0.022</td><td>0.556</td><td>***</td><td>0.023</td><td>0.706</td><td>***</td><td>0.120</td><td>0.543</td><td>***</td><td>0.060</td></tr><tr><td><strong>Prior probabilities</strong></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Intercept</td><td>-0.133</td><td>**</td><td>0.053</td><td></td><td></td><td></td><td>-0.245</td><td>*</td><td>0.240</td><td></td><td></td><td></td></tr><tr><td>m<sub>1</sub></td><td>6.453</td><td>***</td><td>0.031</td><td></td><td></td><td></td><td>7.379</td><td>***</td><td>0.952</td><td></td><td></td><td></td></tr><tr><td>m<sub>2</sub></td><td>-0.235</td><td>***</td><td>0.022</td><td></td><td></td><td></td><td>-0.126</td><td>***</td><td>0.304</td><td></td><td></td><td></td></tr><tr><td>δ<sub>0</sub></td><td>-3.127</td><td>***</td><td>0.021</td><td></td><td></td><td></td><td>-3.632</td><td>***</td><td>1.461</td><td></td><td></td><td></td></tr><tr><td><strong>Autoregressive coefficient</strong></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Intercept</td><td>0.089</td><td></td><td>0.062</td><td></td><td></td><td></td><td>0.405</td><td></td><td>0.294</td><td></td><td></td><td></td></tr><tr><td>z</td><td></td><td></td><td></td><td></td><td></td><td></td><td>-0.834</td><td>**</td><td>0.390</td><td></td><td></td><td></td></tr><tr><td><strong>Time effects</strong></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Obs.</td><td>1,191</td><td></td><td></td><td>1,239</td><td></td><td></td><td>1,111</td><td></td><td></td><td>1,319</td><td></td><td></td></tr><tr><td>lnLF</td><td>1,575.26</td><td></td><td></td><td></td><td></td><td></td><td>1,576.99</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Mean λ</td><td>0.522</td><td></td><td></td><td></td><td></td><td></td><td>0.596</td><td></td><td></td><td></td><td></td><td></td></tr></tbody></table>

Notes: *, **, and *** indicate significance at the 10%, 5%, and 1% levels, respectively.
<table><caption>**Table 4.** Efficiency scores.</caption><thead><tr><th></th><th>Obs.</th><th>Mean</th><th>St.Dev.</th><th>Min</th><th>Max</th></tr></thead><tbody><tr><td><em>Single-class model</em></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>All farms</td><td>2,430</td><td>0.898</td><td>0.064</td><td>0.454</td><td>0.982</td></tr><tr><td><em>Standard LCM</em></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Intensive</td><td>1,187</td><td>0.936</td><td>0.040</td><td>0.609</td><td>0.982</td></tr><tr><td>Extensive</td><td>1,243</td><td>0.900</td><td>0.065</td><td>0.500</td><td>0.992</td></tr><tr><td><em>DL-LCM model (homogeneous-coefficient)</em></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Intensive</td><td>1,191</td><td>0.933</td><td>0.043</td><td>0.609</td><td>0.978</td></tr><tr><td>Extensive</td><td>1,239</td><td>0.900</td><td>0.065</td><td>0.502</td><td>0.992</td></tr><tr><td><em>DL-LCM model (heterogeneous-coefficient)</em></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Intensive</td><td>1,111</td><td>0.933</td><td>0.043</td><td>0.609</td><td>0.983</td></tr><tr><td>Extensive</td><td>1,319</td><td>0.901</td><td>0.064</td><td>0.502</td><td>0.992</td></tr></tbody></table>
<table><caption>**Table 5:** Farm predicted output (in litres) under different technologies.</caption><thead><tr><th>Year</th><th>Obs.</th><th>Intensive Farms</th><th>Extensive Farms</th><th>Intensive/extensive</th></tr></thead><tbody><tr><td>2005</td><td>244</td><td>379,680<br>(235,208)</td><td>354,971<br>(226,885)</td><td>1.07</td></tr><tr><td>2006</td><td>259</td><td>389,883<br>(245,817)</td><td>362,571<br>(235,512)</td><td>1.08</td></tr><tr><td>2007</td><td>267</td><td>392,672<br>(260,078)</td><td>362,796<br>(248,307)</td><td>1.08</td></tr><tr><td>2008</td><td>263</td><td>400,100<br>(277,377)</td><td>379,926<br>(261,880)</td><td>1.05</td></tr><tr><td>2009</td><td>235</td><td>397,045<br>(264,443)</td><td>375,648<br>(253,517)</td><td>1.06</td></tr><tr><td>2010</td><td>241</td><td>409,703<br>(277,938)</td><td>370,584<br>(262,397)</td><td>1.11</td></tr><tr><td>2011</td><td>248</td><td>425,980<br>(306,306)</td><td>381,214<br>(262,387)</td><td>1.12</td></tr><tr><td>2012</td><td>248</td><td>442,312<br>(318,852)</td><td>393,387<br>(279,168)</td><td>1.12</td></tr><tr><td>2013</td><td>239</td><td>528,824<br>(1,295,702)</td><td>392,837<br>(281,996)</td><td>1.35</td></tr><tr><td>2014</td><td>186</td><td>536,124<br>(787,878)</td><td>427,291<br>(326,302)</td><td>1.25</td></tr></tbody></table>

Note: Mean values. Standard deviations in parentheses.
<table><caption>**Table 6:** Distribution of the predicted output ratios (intensive versus extensive technologies).</caption><thead><tr><th>Interval</th><th>Obs.</th><th>%</th></tr></thead><tbody><tr><td>Ratio ≤ 0.8</td><td>11</td><td>0.5</td></tr><tr><td>0.8 &lt; Ratio ≤ 0.9</td><td>53</td><td>2.2</td></tr><tr><td>0.9 &lt; Ratio ≤ 1</td><td>374</td><td>15.4</td></tr><tr><td>1 &lt; Ratio ≤ 1.1</td><td>901</td><td>37.1</td></tr><tr><td>1.1 &lt; Ratio ≤ 1.2</td><td>576</td><td>23.7</td></tr><tr><td>1.2 &lt; Ratio ≤ 1.3</td><td>254</td><td>10.5</td></tr><tr><td>1.3 &lt; Ratio ≤ 1.4</td><td>100</td><td>4.1</td></tr><tr><td>1.4 &lt; Ratio ≤ 1.5</td><td>62</td><td>2.6</td></tr><tr><td>1.5 &lt; Ratio ≤ 1.6</td><td>31</td><td>1.3</td></tr><tr><td>1.6 &lt; Ratio ≤ 1.7</td><td>23</td><td>0.9</td></tr><tr><td>1.7 &lt; Ratio</td><td>45</td><td>1.9</td></tr></tbody><tfoot><tr><td></td><td>2,430</td><td>100</td></tr></tfoot></table>

Note: Ratio=intensive output/extensive output.
<table><caption>**Table 7.** Temporal variation of prior probabilities of class membership. (i)</caption><thead><tr><th></th><th colspan="5">Panel a)</th></tr><tr><th></th><th>Obs.</th><th>Mean</th><th>St.Dev.</th><th>Min</th><th>Max</th></tr></thead><tbody><tr><td>Standard LCM</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Estimated lnRP</td><td>351</td><td>0.666</td><td>0.706</td><td>0.075</td><td>8.194</td></tr><tr><td>DL-LCM model (homogeneous-coefficient) <sup>(ii)</sup></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Estimated lnRP</td><td>351</td><td>0.797</td><td>0.775</td><td>0.085</td><td>7.637</td></tr><tr><td>Simulated lnRP</td><td>351</td><td>1.343</td><td>1.425</td><td>0.152</td><td>16.544</td></tr><tr><td>DL-LCM model (heterogeneous-coefficient) <sup>(ii)</sup></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Estimated lnRP</td><td>351</td><td>0.781</td><td>0.873</td><td>0.083</td><td>11.419</td></tr><tr><td>Simulated lnRP</td><td>351</td><td>1.180</td><td>1.247</td><td>0.132</td><td>14.451</td></tr><tr><td></td><th colspan="5">Panel b)</th></tr><tr><td></td><th>Obs.</th><th>Mean</th><th>St.Dev.</th><th>Min</th><th>Max</th></tr><tr><td>q<sub>1</sub></td><td>351</td><td>0.181</td><td>0.193</td><td>0.021</td><td>2.244</td></tr><tr><td>q<sub>2</sub></td><td>351</td><td>0.131</td><td>0.117</td><td>0.008</td><td>1.133</td></tr><tr><td></td><th colspan="5">Panel c)</th></tr><tr><td></td><th>LCM</th><th colspan="2">Homogeneous. DL-LCM</th><th colspan="2">Heterogeneous- DL-LCM</th></tr><tr><td></td><td></td><th>Estimated lnRP</th><th>Simulated lnRP</th><th>Estimated lnRP</th><th>Simulated lnRP</th></tr><tr><td>q<sub>1</sub></td><td>100.0%</td><td>92.0%</td><td>100.0%</td><td>87.7%</td><td>100.0%</td></tr><tr><td>q<sub>2</sub></td><td>21.6%</td><td>14.2%</td><td>21.7%</td><td>15.2%</td><td>21.5%</td></tr></tbody></table>

Notes: (i) Descriptive statistics of farm-specific individual standard deviations from 2005 to 2014. (ii) Simulated and Estimated lnRP values are computed using equations (8) and (14), respectively. In both cases, we have used the parameter estimates of a DL-LCM. Panel (c) shows the coefficient of correlation of individual standard deviations of two variables.
<figure><img src="image_3.png" /><figcaption>**Figure 2.** Volatility of the RP ratios and degree of persistence.</figcaption></figure>

<figure><img src="image_4.png" /></figure>
References

Agrell, P.J., and H. Brea-Solís. 2017. "Capturing heterogeneity in electricity distribution operations: A critical review of latent class modelling." *Energy Policy* 104, 361-372.

Álvarez, A., C. Arias, and D. Roibás, D. 2005. "Analyzing milk quality using a microeconomic multi-output model: the role of genetics." *Agricultural and Resource Economics* 5(10), 3-17. (in Spanish).

Alvarez, A., and C. Arias. 2015. "Effects of switching between production systems in dairy farming." *Bio-based and Applied Economics* 4:1-16.

Alvarez, A., and J. del Corral. 2010. "Identifying different technologies using a latent class model: extensive versus intensive dairy farms." *European Review of Agricultural Economics* 37:231-250.

Alvarez, A., J. del Corral, D. Solis, and J.A. Perez. 2008. "Does intensification improve the economic efficiency of dairy farms?" *J Dairy Sci* 91:3693-3698.

Alvarez, A.I., J. Barbero, L. Orea, and A. Rodríguez-Pose. 2024. "How institutions shape the economic returns of public investment in European regions." *Economic Modelling* forthcoming.

Amsler, C., C.J. O'Donnell, and P. Schmidt. 2017. "Stochastic metafrontiers." *Econometric Reviews* 36:1007-1020.

Amsler, C., A. Prokhorov, and P. Schmidt. 2016. "Endogeneity in stochastic frontier models." *Journal of econometrics* 190:280-288.

Battisti, M., and C.F. Parmeter. 2013. "Clustering and polarization in the distribution of output: A multivariate perspective." *Journal of Macroeconomics* 35:144-162.

Beaudry, P., and G. Koop. 1993. "Do recessions permanently change output?" *Journal of Monetary Economics* 31:149-163.

Cabrera, V.E., D. Solis, and J. del Corral. 2010. "Determinants of technical efficiency among dairy farms in Wisconsin." *J Dairy Sci* 93:387-393.

Cagan, P. (1956) "The Monetary Dynamics of Hyperinflation." In *Studies in the Quantity Theory of Money*. Chicago, University of Chicago Press, pp. 25-117.

Cullmann, A. 2010. "Benchmarking and firm heterogeneity: a latent class analysis for German electricity distribution companies." *Empirical Economics* 42:147-169.

Dakpo, K.H., L. Latruffe, Y. Desjeux, and P. Jeanneaux. 2021. "Latent Class Modelling for a Robust Assessment of Productivity: Application to French Grazing Livestock Farms." *Journal of Agricultural Economics* 72:760-781.

---. 2024 "Measuring productivity when technology is heterogeneous using a latent class stochastic frontier model." *Empirical Economics* 67:2175-2205.

---. 2021. "Modeling heterogeneous technologies in the presence of sample selection: The case of dairy farms and the adoption of agri-environmental schemes in France." *Agricultural Economics* 53:422-438.

del Corral, J., J.A. Perez, and D. Roibas. 2011. "The impact of land fragmentation on milk production." *J Dairy Sci* 94:517-525.

Diemer, A., S. Iammarino, A. Rodríguez-Pose, and M. Storper. 2022. "The Regional Development Trap in Europe." *Economic Geography* 98:487-509.

Dixit, A.K., and R.S. Pindyck. 1994. *Investment Under Uncertainty*: Princeton University Press.
Emvalomatis, G. 2011. "Adjustment and unobserved heterogeneity in dynamic stochastic frontier models." *Journal of Productivity Analysis* 37:7-16.

Garcia-Covarrubias, L., D. Läßle, E. Dillon, and F. Thorne. 2024. "The role of hired labour on technical efficiency in an expanding dairy sector: The case of Ireland." *Australian Journal of Agricultural and Resource Economics* 68:437-459.

Ghobakhloo, M., M. Iranmanesh, M. Vilkas, A. Grybauskas, and A. Amran. 2022. "Drivers and barriers of Industry 4.0 technology adoption among manufacturing SMEs: a systematic review and transformation roadmap." *Journal of Manufacturing Technology Management* 33:1029-1058.

Greene, W. 2005. "Reconsidering heterogeneity in panel data estimators of the stochastic frontier model." *Journal of econometrics* 126:269-303.

Gude, A., I. Álvarez, and L. Orea. 2018. "Heterogeneous spillovers among Spanish provinces: a generalized spatial stochastic frontier model." *Journal of Productivity Analysis* 50:155-173.

Huang, C.J., T.-H. Huang, and N.-H. Liu. 2014. "A new approach to estimating the metafrontier production function based on a stochastic frontier framework." *Journal of Productivity Analysis* 42:241-254.

Humlum, A. 2019. "Robot adoption and labor market dynamics." *Princeton University*.

Jondrow, J., C.A. Knox Lovell, I.S. Materov, and P. Schmidt. 1982. "On the estimation of technical inefficiency in the stochastic frontier production function model." *Journal of econometrics* 19:233-238.

Karakaplan, M.U., and L. Kutlu. 2017. "Handling Endogeneity in Stochastic Frontier Analysis." *Economics bulletin* 37:889-901.

Kellermann, M., and K. Salhofer. 2014. "Dairy farming on permanent grassland: can it keep up?" *J Dairy Sci* 97:6196-6210.

Koch, M., I. Manuylov, and M. Smolka. 2021. "Robots and Firms." *The economic journal* 131:2553-2584.

Koyck, L.M. 1954. *Distributed lags and investment analysis*: North-Holland Publishing Company.

Kumbhakar, S.C., and C.A.K. Lovell. 2000. *Stochastic Frontier Analysis*: Cambridge University Press.

Kumbhakar, S.C., E.G. Tsionas, and T. Sipilainen. 2009. "Joint estimation of technology choice and technical efficiency: an application to organic and conventional dairy farming." *Journal of Productivity Analysis* 31:151-161.

Läßle, D., G. Holloway, D.J. Lacombe, and C. O'Donoghue. 2017. "Sustainable technology adoption: a spatial analysis of the Irish Dairy Sector." *European Review of Agricultural Economics* 44:810-835.

Latruffe, L., A. Niedermayr, Y. Desjeux, K.H. Dakpo, K. Ayouba, L. Schaller, J. Kantelhardt, Y. Jin, K. Kilcline, M. Ryan, and C. O'Donoghue. 2023. "Identifying and assessing intensive and extensive technologies in European dairy farming." *European Review of Agricultural Economics* 50:1482-1519.

Li, Q., and J.S. Racine. 2007. *Nonparametric Econometrics: Theory and Practice*: Princeton University Press.

Lundström, C., and J. Lindblom. 2021. "Care in dairy farming with automatic milking systems, identified using an Activity Theory lens." *Journal of Rural Studies* 87:386-403.

Maddala, G.S., and K. Lahiri. 2014. *Introduction to Econometrics*: Wiley.

Malikov, E., and Y. Sun. 2017. "Semiparametric estimation and testing of smooth coefficient spatial autoregressive models." *Journal of econometrics* 199:12-34.
Nerlove, M. "The dynamics of supply; estimation of farmer's response to price." MD: The Johns Hopkins University Press.

Orea, L., and S.C. Kumbhakar. 2004. "Efficiency measurement using a latent class stochastic frontier model." *Empirical Economics* 29:169–183.

Orea, L., J.A. Perez, and D. Roibas. 2015. "Evaluating the double effect of land fragmentation on technology choice and dairy farm productivity: A latent class model approach." *Land Use Policy* 45:189–198.

Orea, L., J.A. Pérez-Méndez, and I. Álvarez. 2024. "Does land consolidation promote livestock production and combat rural depopulation in northern Spain?" *Journal of Agricultural Economics* 75:847–868.

Parmeter, C.F., and S. Kumbhakar. 2014. "Efficiency Analysis: A Primer on Recent Advances." *Foundations and Trends® in Econometrics* 7:191–385.

Perez-Mendez, J.A., D. Roibas, and A. Wall. 2020. "Somatic cell counts, reproduction indicators, and technical efficiency in milk production: A stochastic frontier analysis for Spanish dairy farms." *J Dairy Sci* 103:7141–7154.

Pestana Barros, C. 2009. "The Measurement of Efficiency of UK Airports, Using a Stochastic Latent Class Frontier Model." *Transport Reviews* 29:479–498.

Salfer, J.A., K. Minegishi, W. Lazarus, E. Berning, and M.I. Endres. 2017. "Finances and returns for robotic dairies." *J Dairy Sci* 100:7739–7749.

Sauer, J., and C.J.M. Paul. 2013. "The empirical identification of heterogeneous technologies and technical change." *Applied Economics* 45:1461–1479.

Sickles, R.C., and V. Zelenyuk. 2019. *Measurement of Productivity and Efficiency*. Cambridge: Cambridge University Press.

Skevas, I. 2018. "A Hierarchical Stochastic Frontier Model for Efficiency Measurement Under Technology Heterogeneity." *Journal of Quantitative Economics* 17:513–524.

Tangorra, F.M., A. Calcante, G. Vigone, A. Assirelli, and C. Bisaglia. 2022. "Assessment of technical-productive aspects in Italian dairy farms equipped with automatic milking systems: A multivariate statistical analysis approach." *J Dairy Sci* 105:7539–7549.

Tsionas, E.G. 2006. "Inference in dynamic stochastic frontier models." *Journal of Applied Econometrics* 21:669–676.

Tsionas, E.G., and S.C. Kumbhakar. 2004. "Markov switching stochastic frontier model." *The Econometrics Journal* 7:398–425.
# Appendix 1: Adaptive expectations

Assume that one wishes to predict an investment level $y_t$ based on the prediction of the expected profit $x_{t+1}^*$ such that

$$y_t = a + bx_{t+1}^* + u_t$$

In the adaptive expectations framework, $x_{t+1}^*$ is obtained using a distributed lag model as follows:

$$x_{t+1}^* = \beta_0 x_t + \beta_1 x_{t-1} + \dots + \beta_k x_{t-k}$$

While the previous equation is the finite distributed lag model, Cagan (1956), Koyck (1954), Nerlove (1958) proposed an infinite distributed lag model with geometrically decreasing weights. Specifically, we have:

$$x_{t+1}^* = \sum_{j=0}^{\infty} \beta_j x_{t-j}$$

The geometric weights are of the form $\beta_0 \lambda^j$. The infinite sum of geometric weights is $\frac{\beta_0}{1-\lambda}$, and if this infinite sum equals unity, then $\beta_0 = 1 - \lambda$. We then have

$$x_{t+1}^* = \sum_{j=0}^{\infty} (1-\lambda)^j x_{t-j}$$

If $t=0$ we have

$$x_1^* = \sum_{j=0}^{\infty} (1-\lambda)^j x_{-j}$$
<figure><img src="image_5.png" /><figcaption>## Appendix 2. Temporal evolution of estimated (Est.) and simulated (Sim.) RP ratios</figcaption></figure>
<figure><img src="image_6.png" /><figcaption>Farm 42</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>Farm 43</figcaption></figure>

<figure><img src="image_8.png" /><figcaption>Farm 44</figcaption></figure>

<figure><img src="image_9.png" /><figcaption>Farm 45</figcaption></figure>

<figure><img src="image_10.png" /><figcaption>Farm 46</figcaption></figure>

<figure><img src="image_11.png" /><figcaption>Farm 47</figcaption></figure>

<figure><img src="image_12.png" /><figcaption>Farm 48</figcaption></figure>

<figure><img src="image_13.png" /><figcaption>Farm 49</figcaption></figure>

<figure><img src="image_14.png" /><figcaption>Farm 50</figcaption></figure>

<figure><img src="image_15.png" /><figcaption>Farm 51</figcaption></figure>

<figure><img src="image_16.png" /><figcaption>Farm 52</figcaption></figure>

<figure><img src="image_17.png" /><figcaption>Farm 53</figcaption></figure>

<figure><img src="image_18.png" /><figcaption>Farm 54</figcaption></figure>

<figure><img src="image_19.png" /><figcaption>Farm 55</figcaption></figure>

<figure><img src="image_20.png" /><figcaption>Farm 56</figcaption></figure>

<figure><img src="image_21.png" /><figcaption>Farm 57</figcaption></figure>

<figure><img src="image_22.png" /><figcaption>Farm 58</figcaption></figure>

<figure><img src="image_23.png" /><figcaption>Farm 59</figcaption></figure>

<figure><img src="image_24.png" /><figcaption>Farm 60</figcaption></figure>

<figure><img src="image_25.png" /><figcaption>Farm 61</figcaption></figure>

<figure><img src="image_26.png" /><figcaption>Farm 62</figcaption></figure>

<figure><img src="image_27.png" /><figcaption>Farm 63</figcaption></figure>

<figure><img src="image_28.png" /><figcaption>Farm 64</figcaption></figure>

<figure><img src="image_29.png" /><figcaption>Farm 65</figcaption></figure>

<figure><img src="image_30.png" /><figcaption>Farm 66</figcaption></figure>

<figure><img src="image_31.png" /><figcaption>Farm 67</figcaption></figure>

<figure><img src="image_32.png" /><figcaption>Farm 68</figcaption></figure>

<figure><img src="image_33.png" /><figcaption>Farm 69</figcaption></figure>

<figure><img src="image_34.png" /><figcaption>Farm 70</figcaption></figure>

<figure><img src="image_35.png" /><figcaption>Farm 71</figcaption></figure>

<figure><img src="image_36.png" /><figcaption>Farm 72</figcaption></figure>

<figure><img src="image_37.png" /><figcaption>Farm 73</figcaption></figure>

<figure><img src="image_38.png" /><figcaption>Farm 74</figcaption></figure>

<figure><img src="image_39.png" /><figcaption>Farm 75</figcaption></figure>

<figure><img src="image_40.png" /><figcaption>Farm 76</figcaption></figure>

<figure><img src="image_41.png" /><figcaption>Farm 77</figcaption></figure>

<figure><img src="image_42.png" /><figcaption>Farm 78</figcaption></figure>

<figure><img src="image_43.png" /><figcaption>Farm 79</figcaption></figure>

<figure><img src="image_44.png" /><figcaption>Farm 80</figcaption></figure>

<figure><img src="image_45.png" /></figure>
<figure><img src="image_46.png" /><figcaption>Farm 82</figcaption></figure>

<figure><img src="image_47.png" /><figcaption>Farm 83</figcaption></figure>

<figure><img src="image_48.png" /><figcaption>Farm 84</figcaption></figure>

<figure><img src="image_49.png" /><figcaption>Farm 85</figcaption></figure>

<figure><img src="image_50.png" /><figcaption>Farm 86</figcaption></figure>

<figure><img src="image_51.png" /><figcaption>Farm 87</figcaption></figure>

<figure><img src="image_52.png" /><figcaption>Farm 88</figcaption></figure>

<figure><img src="image_53.png" /><figcaption>Farm 89</figcaption></figure>

<figure><img src="image_54.png" /><figcaption>Farm 90</figcaption></figure>

<figure><img src="image_55.png" /><figcaption>Farm 91</figcaption></figure>

<figure><img src="image_56.png" /><figcaption>Farm 92</figcaption></figure>

<figure><img src="image_57.png" /><figcaption>Farm 93</figcaption></figure>

<figure><img src="image_58.png" /><figcaption>Farm 94</figcaption></figure>

<figure><img src="image_59.png" /><figcaption>Farm 95</figcaption></figure>

<figure><img src="image_60.png" /><figcaption>Farm 96</figcaption></figure>

<figure><img src="image_61.png" /><figcaption>Farm 97</figcaption></figure>

<figure><img src="image_62.png" /><figcaption>Farm 98</figcaption></figure>

<figure><img src="image_63.png" /><figcaption>Farm 99</figcaption></figure>

<figure><img src="image_64.png" /><figcaption>Farm 100</figcaption></figure>

<figure><img src="image_65.png" /></figure>
<figure><img src="image_66.png" /><figcaption>Appendix 3. Temporal evolution of estimated RP ratios using standard and DL specifications of our LCM</figcaption></figure>
<figure><img src="image_67.png" /></figure>

<figure><img src="image_68.png" /></figure>

<figure><img src="image_69.png" /></figure>

<figure><img src="image_70.png" /></figure>

<figure><img src="image_71.png" /></figure>

<figure><img src="image_72.png" /></figure>

<figure><img src="image_73.png" /></figure>

<figure><img src="image_74.png" /></figure>

<figure><img src="image_75.png" /></figure>

<figure><img src="image_76.png" /></figure>

<figure><img src="image_77.png" /></figure>

<figure><img src="image_78.png" /></figure>

<figure><img src="image_79.png" /></figure>

<figure><img src="image_80.png" /></figure>

<figure><img src="image_81.png" /></figure>

<figure><img src="image_82.png" /></figure>

<figure><img src="image_83.png" /></figure>

<figure><img src="image_84.png" /></figure>

<figure><img src="image_85.png" /></figure>

<figure><img src="image_86.png" /></figure>

<figure><img src="image_87.png" /></figure>

<figure><img src="image_88.png" /></figure>

<figure><img src="image_89.png" /></figure>

<figure><img src="image_90.png" /></figure>

<figure><img src="image_91.png" /></figure>

<figure><img src="image_92.png" /></figure>

<figure><img src="image_93.png" /></figure>

<figure><img src="image_94.png" /></figure>

<figure><img src="image_95.png" /></figure>

<figure><img src="image_96.png" /></figure>

<figure><img src="image_97.png" /></figure>

<figure><img src="image_98.png" /></figure>

<figure><img src="image_99.png" /></figure>

<figure><img src="image_100.png" /></figure>

<figure><img src="image_101.png" /></figure>

<figure><img src="image_102.png" /></figure>

<figure><img src="image_103.png" /></figure>

<figure><img src="image_104.png" /></figure>

<figure><img src="image_105.png" /></figure>

<figure><img src="image_106.png" /></figure>
<figure><img src="image_107.png" /></figure>

<figure><img src="image_108.png" /></figure>

<figure><img src="image_109.png" /></figure>

<figure><img src="image_110.png" /></figure>

<figure><img src="image_111.png" /></figure>

<figure><img src="image_112.png" /></figure>

<figure><img src="image_113.png" /></figure>

<figure><img src="image_114.png" /></figure>

<figure><img src="image_115.png" /></figure>

<figure><img src="image_116.png" /></figure>

<figure><img src="image_117.png" /></figure>

<figure><img src="image_118.png" /></figure>

<figure><img src="image_119.png" /></figure>

<figure><img src="image_120.png" /></figure>

<figure><img src="image_121.png" /></figure>

<figure><img src="image_122.png" /></figure>

<figure><img src="image_123.png" /></figure>

<figure><img src="image_124.png" /></figure>

<figure><img src="image_125.png" /></figure>

<figure><img src="image_126.png" /></figure>
**Appendix 4. Hedonic Milk Price Equations**

This appendix illustrates that the proposed DL-LCM can be used to estimate functions of interest beyond production frontiers, particularly in non-frontier and multi-class settings. Specifically, we estimate several hedonic milk price equations to assess the elasticity of milk prices with respect to SCC (somatic cell count), a key indicator of milk quality related to somatic cells and germ content. In this context, inefficiency is irrelevant, so we assume that the error term follows a normal distribution.

The dairy industry holds significant bargaining power over farmers. Price premiums are often awarded for meeting quality standards and delivery volumes, due to savings in collection costs and in order to deter supplier switching (Álvarez-Pinilla et al. 2005, p. 6). For this reason, milk prices depend on quality attributes and delivery volumes in our model. In a parallel, ongoing study, we find that the effects of these variables vary across observations. With a view to capturing this heterogeneity, we allow milk prices to depend directly on SCC and indirectly on milk production, through the influence of milk production on the prior class membership probabilities. While the class-specific effect of SCC on milk prices is captured via its coefficient, the effect of milk production can be inferred from differences in the estimated class-specific intercepts of the price equations, assuming that each class corresponds to different production levels. For simplicity, the autoregressive coefficient is assumed to be homogeneous across all DL-LCMs.

We begin by presenting in Table A.4.1 the parameter estimates from two standard models: a single-class hedonic price model and a two-class LCM. The negative coefficient on SCC in both models confirms that dairy farms are penalized when their milk contains high levels of somatic cells and germs. The positive coefficient for milk production in the LCM indicates that larger farms are more likely to belong to the first class. The higher intercept for the first-class price equation further supports the idea that price premiums are awarded for larger delivery volumes.

Table A.4.2 presents the results from three DL-LCMs. The first column extends the two-class LCM from Table A.4.1 by allowing for persistence in class membership. As expected, the parameter estimates from the standard LCM and the DL-LCM are fairly similar. The autoregressive coefficient derived from the DL-LCM's estimated logit function is 0.351 — substantially lower than in our main application for milk production. The remaining two columns of Table A.4.2 present results for three-class and four-class DL-LCMs. The results
remain robust, with one exception: the first-class SCC coefficient in the four-class DL-LCM is unexpectedly positive, suggesting that farms in this class are rewarded for poor-quality milk. However, this class contains only 28 observations, which may be treated as outliers in line with Agrell and Brea-Solís (2017). According to the estimated coefficients for milk production, large farms fall into classes 1 and 3, small farms into class 2, and medium-sized farms form the residual class when more than two classes are used. In the two-class case, medium-sized farms are split across the two classes. Once again, we find only a small degree of persistence in class membership when modeling milk prices. The only group showing moderate persistence is that of the large farms in class 3.

<table><caption>**Table A.4.1.** Parameter estimates. Hedonic milk price equation. Standard models.</caption><thead><tr><th rowspan="2"></th><th colspan="2">Single equation<br>(1 class)</th><th colspan="2">Standard LCM<br>(2 classes)</th></tr><tr><th>Coef.</th><th>s.e.</th><th>Coef.</th><th>s.e.</th></tr></thead><tbody><tr><td colspan="5"><strong>Price equation</strong></td></tr><tr><td>Intercept</td><td></td><td></td><td></td><td></td></tr><tr><td>Class 1</td><td>0.000</td><td>0.002</td><td>0.026 ***</td><td>0.003</td></tr><tr><td>Class 2</td><td></td><td></td><td>-0.077 ***</td><td>0.009</td></tr><tr><td>SCC</td><td></td><td></td><td></td><td></td></tr><tr><td>Class 1</td><td>-0.075 ***</td><td>0.004</td><td>-0.039 ***</td><td>0.004</td></tr><tr><td>Class 2</td><td></td><td></td><td>-0.064 ***</td><td>0.010</td></tr><tr><td>lnσ<sub>v</sub></td><td></td><td></td><td></td><td></td></tr><tr><td>Class 1</td><td>-2.272 ***</td><td>0.014</td><td>-2.831 ***</td><td>0.025</td></tr><tr><td>Class 2</td><td></td><td></td><td>-1.811 ***</td><td>0.050</td></tr><tr><td colspan="5"><strong>Prior probabilities</strong></td></tr><tr><td>Intercept</td><td></td><td></td><td></td><td></td></tr><tr><td>Class 1</td><td></td><td></td><td>2.481 ***</td><td>0.248</td></tr><tr><td>Milk</td><td></td><td></td><td></td><td></td></tr><tr><td>Class 1</td><td></td><td></td><td>4.200 ***</td><td>0.440</td></tr><tr><td colspan="5"><strong>Class allocation</strong></td></tr><tr><td>Class 1</td><td></td><td></td><td>1931</td><td></td></tr><tr><td>Class 2</td><td></td><td></td><td>499</td><td></td></tr><tr><td>Mean lnLF</td><td>0.853</td><td></td><td>1.108</td><td></td></tr><tr><td>Obs.</td><td>2,430</td><td></td><td>2,430</td><td></td></tr><tr><td>lnLF</td><td>2,071.80</td><td></td><td>2,691.44</td><td></td></tr></tbody></table>
<table><caption>**Table A.4.2.** Parameter estimates. Hedonic milk price equation. DL-LCMs.</caption><thead><tr><th rowspan="3"></th><th colspan="6">DL-LCM</th></tr><tr><th colspan="2">(2 classes)</th><th colspan="2">(3 classes)</th><th colspan="2">(4 classes)</th></tr><tr><th>Coef.</th><th>s.e.</th><th>Coef.</th><th>s.e.</th><th>Coef.</th><th>s.e.</th></tr></thead><tbody><tr><td colspan="7"><strong>Price equation</strong></td></tr><tr><td>Intercept</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Class 1</td><td>0.028 ***</td><td>0.002</td><td>0.051 ***</td><td>0.002</td><td>0.094 ***</td><td>0.098</td></tr><tr><td>Class 2</td><td>-0.074 ***</td><td>0.010</td><td>-0.095 ***</td><td>0.042</td><td>-0.143 ***</td><td>0.020</td></tr><tr><td>Class 3</td><td></td><td></td><td>-0.048 ***</td><td>0.003</td><td>0.054 ***</td><td>0.002</td></tr><tr><td>Class 4</td><td></td><td></td><td></td><td></td><td>-0.038 ***</td><td>0.003</td></tr><tr><td>SCC</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Class 1</td><td>-0.038 ***</td><td>0.003</td><td>-0.026 ***</td><td>0.003</td><td>0.440 ***</td><td>0.155</td></tr><tr><td>Class 2</td><td>-0.064 ***</td><td>0.010</td><td>-0.081 *</td><td>0.047</td><td>-0.080 ***</td><td>0.009</td></tr><tr><td>Class 3</td><td></td><td></td><td>-0.047 ***</td><td>0.003</td><td>-0.025 ***</td><td>0.003</td></tr><tr><td>Class 4</td><td></td><td></td><td></td><td></td><td>-0.037 ***</td><td>0.004</td></tr><tr><td>lnσ<sub>v</sub></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Class 1</td><td>-2.843 ***</td><td>0.020</td><td>-3.026 ***</td><td>0.023</td><td>-1.002 ***</td><td>0.152</td></tr><tr><td>Class 2</td><td>-1.843 ***</td><td>0.007</td><td>-1.213 ***</td><td>0.032</td><td>-2.180 ***</td><td>0.056</td></tr><tr><td>Class 3</td><td></td><td></td><td>-2.901 ***</td><td>0.045</td><td>-3.070 ***</td><td>0.027</td></tr><tr><td>Class 4</td><td></td><td></td><td></td><td></td><td>-2.989 ***</td><td>0.044</td></tr><tr><td colspan="7"><strong>Prior probabilities</strong></td></tr><tr><td>Intercept</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Class 1</td><td>2.403 ***</td><td>0.242</td><td>0.305 *</td><td>0.162</td><td>-2.857 ***</td><td>0.257</td></tr><tr><td>Class 2</td><td></td><td></td><td>-3.462 ***</td><td>0.296</td><td>-4.711 ***</td><td>0.611</td></tr><tr><td>Class 3</td><td></td><td></td><td></td><td></td><td>0.052</td><td>0.159</td></tr><tr><td>Milk</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Class 1</td><td>5.165 ***</td><td>0.684</td><td>4.644 ***</td><td>0.478</td><td>1.937 ***</td><td>0.575</td></tr><tr><td>Class 2</td><td></td><td></td><td>-1.961 ***</td><td>0.285</td><td>-3.876 ***</td><td>0.614</td></tr><tr><td>Class 3</td><td></td><td></td><td></td><td></td><td>4.493 ***</td><td>0.456</td></tr><tr><td>δ<sub>0</sub></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Class 1</td><td>3.933 ***</td><td>1.606</td><td>0.480</td><td>1.241</td><td>-0.475</td><td>18.099</td></tr><tr><td>Class 2</td><td></td><td></td><td>1.490</td><td>7.247</td><td>-0.651</td><td>18.132</td></tr><tr><td>Class 3</td><td></td><td></td><td></td><td></td><td>-0.102</td><td>1.574</td></tr></tbody></table>
<table><caption>**Table A.4.2. (continuation)**</caption><thead><tr><th></th><th colspan="6">DL-LCM</th></tr><tr><th></th><th colspan="2">(2 classes)</th><th colspan="2">(3 classes)</th><th colspan="2">(4 classes)</th></tr><tr><th></th><th>Coef.</th><th>s.e.</th><th>Coef.</th><th>s.e.</th><th>Coef.</th><th>s.e.</th></tr></thead><tbody><tr><td><u>Logit function (intercept)</u></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Class 1</td><td>-0.614</td><td>0.564</td><td>-0.778</td><td>0.625</td><td>-2.494</td><td>6.330</td></tr><tr><td>Class 2</td><td></td><td></td><td>-1.789</td><td>2.015</td><td>-3.465</td><td>8.797</td></tr><tr><td>Class 3</td><td></td><td></td><td></td><td></td><td>-1.227</td><td>0.870</td></tr><tr><td><u>Autoregressive coefficient</u></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Class 1</td><td>0.351</td><td></td><td>0.315</td><td></td><td>0.076</td><td></td></tr><tr><td>Class 2</td><td></td><td></td><td>0.143</td><td></td><td>0.030</td><td></td></tr><tr><td>Class 3</td><td></td><td></td><td></td><td></td><td>0.227</td><td></td></tr><tr><td><u>Class allocation</u></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Class 1</td><td>1868</td><td></td><td>1377</td><td></td><td>28</td><td></td></tr><tr><td>Class 2</td><td>562</td><td></td><td>109</td><td></td><td>178</td><td></td></tr><tr><td>Class 3</td><td></td><td></td><td>944</td><td></td><td>1280</td><td></td></tr><tr><td>Class 4</td><td></td><td></td><td></td><td></td><td>944</td><td></td></tr><tr><td>Obs.</td><td>2,430</td><td></td><td>2,430</td><td></td><td>2,430</td><td></td></tr><tr><td>Mean lnLF</td><td>1.109</td><td></td><td>1.246</td><td></td><td>1.289</td><td></td></tr><tr><td>lnLF</td><td>2,694.02</td><td></td><td>3,027.93</td><td></td><td>3,131.40</td><td></td></tr></tbody></table>