23  Identification with Unobserved Heterogeneity

In the previous two chapters we estimated models with unobserved types and found that our estimators recovered the true parameters in simulated data. But when does the data actually contain enough information to distinguish heterogeneity from other features of a model? This chapter takes up that question.

The starting point is an uncomfortable fact: without restrictions, mixture models are not identified. Any distribution can be written as a mixture of other distributions in infinitely many ways. So we need to know what restrictions do the work. There are three broad sources of identification:

  1. Parametric restrictions on the type-specific distributions. For example, Heckman and Singer (1984) study duration models where the hazard has a known parametric form given type. We used an argument of this kind for the search model.
  2. Panel data: repeated observations of the same unit, where outcomes are conditionally independent across time given the type (Hall and Zhou 2003; Kasahara and Shimotsu 2009; Bonhomme, Jochmans, and Robin 2016).
  3. Instruments: variables that shift endogenous states but are excluded from payoffs and independent of the unobserved heterogeneity (Berry and Compiani 2023).

In this chapter we will focus on the second and third sources, which have the advantage of not relying on functional forms. As with our discussion of identification more broadly, the point is not only to establish whether a model is identified but also to understand what features of the data identify the distribution of heterogeneity.

23.1 Why One Observation Is Not Enough

Suppose we observe a single discrete outcome \(y\in\{1,\ldots,J\}\) for each unit, and that there are \(K\) types with type-specific distributions \(f_{k}(y)\). The distribution of the data is:

\[ \mathbb{P}(y) = \sum_{k=1}^{K}\pi_{k}f_{k}(y). \]

The data provide \(J-1\) free probabilities, but the model has \((K-1) + K(J-1)\) parameters. With \(K\geq2\), there are always more parameters than data points. Intuitively, a single observation per unit cannot distinguish between heterogeneity across units and randomness within units: a population where half of people work with probability 0.2 and half work with probability 0.8 looks the same as a population where everyone works with probability 0.5.

Repeated observations help because heterogeneity generates correlation in outcomes within units. In the population with heterogeneity, someone who works today is more likely to work tomorrow. But how many observations do we need?

Example 23.1 Consider a binary outcome \(y_{t}\in\{0,1\}\) observed in each period, two types, and type-specific probabilities \(a=\mathbb{P}(y_{t}=1|k=1)\) and \(b=\mathbb{P}(y_{t}=1|k=2)\) that do not change over time. Let \(\pi\) be the probability of type 1. Since outcomes are independent across periods given the type, the distribution of a sequence of outcomes depends only on the moments:

\[ m_{r} = \mathbb{P}(y_{1}=1,\ldots,y_{r}=1) = \pi a^{r} + (1-\pi)b^{r}. \]

With \(T=2\), the distribution of \((y_{1},y_{2})\) is determined entirely by \(m_{1}\) and \(m_{2}\). That’s two equations in three unknowns \((\pi,a,b)\). Let’s find two different parameter vectors that generate the same data.

m(r,π,a,b) = π*a^r + (1-π)*b^r

θA = (π = 0.5, a = 0.2, b = 0.8)
# solve for (a,b) with π = 0.3 that match m1 and m2 for θA:
a = (1 - sqrt(0.84))/2
θB = (π = 0.3, a = a, b = (0.5 - 0.3a)/0.7)

for r in 1:3
    println("m$r: θA gives $(round(m(r,θA...),digits=4)), θB gives $(round(m(r,θB...),digits=4))")
end
m1: θA gives 0.5, θB gives 0.5
m2: θA gives 0.34, θB gives 0.34
m3: θA gives 0.26, θB gives 0.2364

The two parameterizations agree on \(m_{1}\) and \(m_{2}\), so they cannot be distinguished with two periods of data. But they disagree on \(m_{3}\). With a third period, the extra moment is enough to tell them apart. You will show in Exercise 23.1 that three periods are enough to identify \((\pi,a,b)\) in this example.

23.2 Panel Data and Conditional Independence

The example above suggests a general principle: with enough repeated observations that are conditionally independent given the type, the mixture is identified. Let’s develop a constructive argument for the case of three periods, which is based on the insights of Hall and Zhou (2003) and Kasahara and Shimotsu (2009), and is closely related to the approach of Bonhomme, Jochmans, and Robin (2016).

Suppose we observe outcomes \((y_{1},y_{2},y_{3})\) for each unit, where each outcome takes values in a set with (at least) \(K\) points, and outcomes are independent across periods conditional on the type:

\[ \mathbb{P}(y_{1},y_{2},y_{3}) = \sum_{k=1}^{K}\pi_{k}f_{1k}(y_{1})f_{2k}(y_{2})f_{3k}(y_{3}). \]

If outcomes have more than \(K\) points of support, we can always aggregate them into \(K\) cells. Now define the \(K\times K\) matrices:

\[ \mathbf{L}_{t} = \left[f_{tk}(y)\right]_{y,k},\qquad \mathbf{D}_{3}(c) = \text{diag}\left(f_{31}(c),\ldots,f_{3K}(c)\right),\qquad \mathbf{\Pi} = \text{diag}(\pi_{1},\ldots,\pi_{K}) \]

where each column of \(\mathbf{L}_{t}\) is the distribution of outcomes in period \(t\) for one type. Using these matrices, we can write two objects that are directly observable in the data. The first is the joint distribution of \((y_{1},y_{2})\):

\[ \mathbf{A} = \left[\mathbb{P}(y_{1}=i,y_{2}=j)\right]_{i,j} = \mathbf{L}_{1}\mathbf{\Pi}\mathbf{L}_{2}'. \]

The second is the joint distribution of \((y_{1},y_{2})\) and \(y_{3}=c\):

\[ \mathbf{B}(c) = \left[\mathbb{P}(y_{1}=i,y_{2}=j,y_{3}=c)\right]_{i,j} = \mathbf{L}_{1}\mathbf{\Pi}\mathbf{D}_{3}(c)\mathbf{L}_{2}'. \]

Now suppose that \(\mathbf{L}_{1}\) and \(\mathbf{L}_{2}\) have full rank and that each \(\pi_{k}>0\). Then \(\mathbf{A}\) is invertible and:

\[ \mathbf{B}(c)\mathbf{A}^{-1} = \mathbf{L}_{1}\mathbf{\Pi}\mathbf{D}_{3}(c)\mathbf{L}_{2}'(\mathbf{L}_{2}')^{-1}\mathbf{\Pi}^{-1}\mathbf{L}_{1}^{-1} = \mathbf{L}_{1}\mathbf{D}_{3}(c)\mathbf{L}_{1}^{-1}.\]

This is an eigendecomposition! The matrix on the left is observed. Its eigenvalues are the type-specific probabilities \(f_{3k}(c)\), and its eigenvectors are the columns of \(\mathbf{L}_{1}\). Since eigenvectors are only determined up to scale, we normalize each to sum to one (each column of \(\mathbf{L}_{1}\) is a probability distribution). The eigendecomposition is unique as long as the eigenvalues are distinct. In practice, we can guarantee this by taking a linear combination \(\sum_{c}w_{c}\mathbf{B}(c)\) with generic weights \(w_{c}\). With \(\mathbf{L}_{1}\) in hand, the remaining objects follow: \(\mathbf{L}_{2}\) can be recovered symmetrically (or is equal to \(\mathbf{L}_{1}\) if outcome distributions are stationary), and \(\mathbf{\Pi} = \mathbf{L}_{1}^{-1}\mathbf{A}(\mathbf{L}_{2}')^{-1}\).

Theorem 23.1 (Identification of Finite Mixtures with Panel Data) Suppose outcomes \((y_{1},y_{2},y_{3})\) are independent conditional on type, \(\pi_{k}>0\) for all \(k\), the matrices \(\mathbf{L}_{1}\) and \(\mathbf{L}_{2}\) have rank \(K\), and the type-specific distributions in period 3 are distinct. Then \((\pi_{k},f_{1k},f_{2k},f_{3k})_{k=1}^{K}\) are identified up to a relabeling of the types.

The rank condition says that the types must generate sufficiently different distributions of outcomes. This is where the number of support points of the outcome matters: with a binary outcome in each period, we can only identify \(K=2\) types this way, but we can increase the effective support by grouping periods together (for example, treating \((y_{1},y_{2})\) as a single outcome with four points of support).

Example 23.2 The identification argument is constructive, so it suggests an estimator: replace \(\mathbf{A}\) and \(\mathbf{B}(c)\) with sample frequencies and perform the eigendecomposition. Let’s simulate a three-period panel with three types and an outcome that takes three values.

using Random, Distributions, LinearAlgebra
Random.seed!(7)

K = 3
π_true = [0.3,0.5,0.2]
f_true = [0.7 0.2 0.1;
          0.2 0.6 0.3;
          0.1 0.2 0.6] #<- f_true[y,k] = P(y|k), same in every period

N = 50_000
types = rand(Categorical(π_true),N)
Y = [rand(Categorical(f_true[:,types[n]])) for n in 1:N, t in 1:3];

Now we construct the matrices \(\mathbf{A}\) and \(\mathbf{B}(c)\) using sample frequencies.

A = zeros(K,K)
B = zeros(K,K,K)
for n in 1:N
    A[Y[n,1],Y[n,2]] += 1/N
    B[Y[n,1],Y[n,2],Y[n,3]] += 1/N
end

Next, we take a random linear combination of the \(\mathbf{B}(c)\) matrices, compute the eigenvectors of \(\mathbf{B}\mathbf{A}^{-1}\), and normalize them to sum to one.

w = rand(K)
Bw = sum(w[c] * B[:,:,c] for c in 1:K)
E = eigen(Bw / A) #<- Bw / A computes Bw * inv(A)
L̂ = real.(E.vectors)
L̂ ./= sum(L̂,dims=1)
3×3 Matrix{Float64}:
 0.70708    0.19618   0.0996956
 0.195787   0.596682  0.285425
 0.0971322  0.207138  0.614879

Since the types are only identified up to relabeling, let’s order the estimated types to match the true ones, by sorting on the probability of \(y=1\).

order = sortperm(L̂[1,:],rev=true)
L̂ = L̂[:,order]
[L̂ f_true]
3×6 Matrix{Float64}:
 0.70708    0.19618   0.0996956  0.7  0.2  0.1
 0.195787   0.596682  0.285425   0.2  0.6  0.3
 0.0971322  0.207138  0.614879   0.1  0.2  0.6

Finally, we recover the type probabilities using \(\mathbf{\Pi} = \mathbf{L}^{-1}\mathbf{A}(\mathbf{L}')^{-1}\), using the fact that the outcome distribution is the same in each period.

Π̂ = L̂ \ A / L̂'
[diag(Π̂) π_true]
3×2 Matrix{Float64}:
 0.290788  0.3
 0.510991  0.5
 0.176628  0.2

The estimates are close to the truth. While this estimator is consistent, it is not efficient, and it can be sensitive to sampling error when the rank condition is close to failing. In practice, a good use of this kind of estimator is to provide starting values for the EM algorithm.

23.2.1 Dynamic Discrete Choice Models

In dynamic discrete choice models, choices are generally not independent over time conditional on type, because past choices affect current states (like incumbency status, or experience). However, the Markov structure of the model means that choices are independent over time conditional on the type and the path of observed states. Kasahara and Shimotsu (2009) exploit this to show that the type-specific CCPs and type probabilities are nonparametrically identified, by applying arguments like the one above to sequences of choices conditional on particular sequences of observed states. More periods are needed when lagged choices enter the state, and the rank conditions must hold for the relevant subsequences.

Notice what this gives us. Once the type-specific CCPs \(p_{j}(x,k)\) are identified, we can apply the arguments from the chapter on dynamic discrete choice type-by-type to identify flow payoffs (subject to the same normalizations as before). This separation of the problem into (1) identifying a mixture of CCPs and (2) identifying payoffs from CCPs is exactly the structure that the two-stage estimator of Arcidiacono and Miller (2011) exploits.

Initial Conditions, Again

The argument above requires that we can condition on the observed states. If the type distribution varies with the initial state (as it will when we observe agents mid-way through their decision process), then the identification argument should be applied separately for each initial state, so that type probabilities are identified as \(\pi_{k}(x_{1})\). This is the identification counterpart of the initial conditions problem.

23.3 Instruments

Panel data arguments require that the same units are observed repeatedly and that the unobserved type is the only source of dependence across periods (beyond the observed states). An alternative source of identification is an instrument. Berry and Compiani (2023) study dynamic models where persistent unobservables make some state variables endogenous, and show how exogenous variables that shift these states can be used to identify the model.

To see the idea, recall the female labor force participation model and suppose that women differ in their taste for work, \(\alpha_{n}\):

\[ u_{0}(h,y,k,\alpha_{n}) = \log(y) + \alpha_{n} + \alpha_{1}k,\qquad u_{1}(h,y,k) = \log(y + w(h)). \]

The problem is that experience \(h_{nt}\) is correlated with \(\alpha_{n}\): women with a weak taste for home time have worked more in the past. Suppose that husband’s income \(y\) evolves independently of \(\alpha_{n}\). Then lagged husband’s income \(y_{n,t-1}\) is a candidate instrument for experience:

  1. Relevance: low husband’s income last period makes it more likely that the woman worked last period, and so raises her experience today.
  2. Exclusion: conditional on current husband’s income \(y_{nt}\), children, and experience, lagged husband’s income has no effect on payoffs today (or on expected future payoffs, since \(y\) is Markov).
  3. Independence: lagged husband’s income is independent of \(\alpha_{n}\).

The same logic applies to the timing of past births: holding the current state fixed, a woman who had a young child at home two years ago is likely to have accumulated less experience, for reasons unrelated to her taste for work.

Unlike the linear models we studied earlier, the unobservable \(\alpha_{n}\) enters the model nonlinearly (through the choice probabilities), so identification relies on tools from nonparametric instrumental variables in nonseparable models (Chernozhukov and Hansen 2005; Chesher 2010). Berry and Compiani (2023) develop these arguments for dynamic models and show that they can deliver identification even with short panels.

Discussion

Compare the sources of identification for the distribution of unobserved heterogeneity discussed in this chapter.

  1. The panel data argument relies on conditional independence of outcomes over time given the type. Can you think of reasons why this might fail? (Hint: what if the unobservable is persistent but not permanent, as in Example 21.5?)
  2. The instrumental variables argument relies on the independence of the instrument from the unobserved heterogeneity. In the labor force participation model, how credible is it that husband’s income is independent of a woman’s taste for work? (Hint: think about assortative matching in the marriage market, and about household specialization.) What about the timing of births?
  3. In many applied papers, identification of the type distribution is not discussed explicitly, and the model is estimated by EM with a parametric specification. In light of the arguments here, what would you want to see in such a paper to be convinced that the estimated heterogeneity is driven by the data rather than functional form?

23.4 Exercises

Exercise

Exercise 23.1 Return to the setting of Example 23.1 with \(T=3\).

  1. Show that \((\pi,a,b)\) are identified from \((m_{1},m_{2},m_{3})\), up to the relabeling of types. Hint: show that \(a\) and \(b\) are the roots of the quadratic \(z^{2} - s_{1}z + s_{2} = 0\), where \(s_{1}=a+b\) and \(s_{2}=ab\) solve a linear system in terms of \((m_{1},m_{2},m_{3})\).
  2. Use your argument to construct a method of moments estimator, and implement it on simulated data with \(N=1,000\).
  3. Implement the EM algorithm for the same model, and compare the two estimators in a Monte Carlo simulation.
  4. What happens to your method of moments estimator when \(a=b\)? How does this relate to the rank condition in Theorem 23.1?
Exercise

Exercise 23.2 Using the setting of Example 23.2:

  1. Write a function that implements the eigendecomposition estimator for a given sample, and a function that implements the EM algorithm for the same model.
  2. Run a Monte Carlo simulation with \(N=2,000\) and compare the root mean squared error of each estimator for \(\pi\) and \(f\).
  3. Now change \(f\) so that the second and third types become more similar. How does the performance of each estimator change?
  4. Use the eigendecomposition estimates as starting values for EM. Does this help?
Exercise

Exercise 23.3 Consider the female labor force participation model with two types from Example 22.2, but suppose that types differ only in their taste for work (\(\alpha_{0}\)), and not in their wage intercept.

  1. Simulate data from the model, and check the relevance of the proposed instrument by computing the share of women working conditional on current husband’s income \(y_{nt}\) and on lagged husband’s income \(y_{n,t-1}\).
  2. Show (using the simulated data) that, holding fixed the current state \((h_{nt},y_{nt},k_{nt},t)\), the share of women working depends on \(y_{n,t-1}\), even though \(y_{n,t-1}\) is not a state variable in the model. Hint: with a large state space you will need to pool across cells, for example with a flexible logit that includes \(y_{n,t-1}\) as an additional regressor. Why does this dependence arise?
  3. Explain why the dependence you found in part 2 can be used as a test for the presence of persistent unobserved heterogeneity. Repeat part 2 with data simulated from the model without types to confirm that the test has the right behavior.
  4. Would the instrument remain valid if the taste for work were correlated with the level of husband’s income (for example, because of assortative matching)? Would lagged changes in husband’s income be a better instrument? Explain.