25  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 choices or endogenous states but are 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. We will see that, with discrete types, they rest on a single argument. 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.

25.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 25.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 25.1 that three periods are enough to identify \((\pi,a,b)\) in this example.

25.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, based on the insights of Hall and Zhou (2003). We will then see how Bonhomme, Jochmans, and Robin (2016) and Kasahara and Shimotsu (2009) apply the same argument to different sources of data.

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 25.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 25.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.

25.2.1 The Structure of the Argument

Let’s be clear about what this argument used, since the same three ingredients show up in every approach in the rest of this chapter.

  1. Two signals of the type, \(S_{1}\) and \(S_{2}\), that are independent given the type. Their joint distribution, summarized in a \(K\times K\) matrix, has the form \(\mathbf{A}=\mathbf{L}_{1}\mathbf{\Pi}\mathbf{L}_{2}'\), where column \(k\) of \(\mathbf{L}_{t}\) collects \(K\) features of the distribution of \(S_{t}\) for type \(k\).
  2. A third signal \(S_{3}\), independent of the other two given the type. Weighting the joint distribution by a function of \(S_{3}\) puts a diagonal matrix in the middle: \(\mathbf{B}=\mathbf{L}_{1}\mathbf{\Pi}\mathbf{D}_{3}\mathbf{L}_{2}'\). Then \(\mathbf{B}\mathbf{A}^{-1}=\mathbf{L}_{1}\mathbf{D}_{3}\mathbf{L}_{1}^{-1}\) is an eigendecomposition.
  3. A rank condition: \(\mathbf{L}_{1}\) and \(\mathbf{L}_{2}\) are invertible, which means that the \(K\) types differ along \(K\) distinct features of \(S_{1}\) and \(S_{2}\).

In the argument above, the three signals were the outcomes in three periods, and the rows of \(\mathbf{L}_{t}\) were indexed by the values of the outcome. Next we’ll look at two variations, which differ only in where the signals come from and what indexes the rows of \(\mathbf{L}_{1}\) and \(\mathbf{L}_{2}\).

25.2.2 Multiple Measurements

Bonhomme, Jochmans, and Robin (2016) show that this argument applies to any set of multiple measurements of the type, including continuous ones such as several test scores or repeated observations of earnings, and they turn it into an estimator with standard asymptotic properties. There are two features of their approach that we’ll look at here.

First, the rows of \(\mathbf{L}_{t}\) do not need to be values of the outcome. Take any \(K\) functions \(\varphi_{1},\ldots,\varphi_{K}\) and let \(\mathbf{L}_{t}[i,k]=\mathbb{E}[\varphi_{i}(y_{t})|k]\). They use an orthonormal basis such as Legendre or Hermite polynomials, in which case the columns of \(\mathbf{L}_{t}\) are the leading (generalized) Fourier coefficients of the type-specific densities. Then: \[ \mathbf{A} = \mathbb{E}[\varphi(y_{1})\varphi(y_{2})'] = \mathbf{L}_{1}\mathbf{\Pi}\mathbf{L}_{2}',\qquad \mathbf{B}(g) = \mathbb{E}[\varphi(y_{1})\varphi(y_{2})'g(y_{3})] = \mathbf{L}_{1}\mathbf{\Pi}\mathbf{D}(g)\mathbf{L}_{2}' \] where \(\varphi(y)=(\varphi_{1}(y),\ldots,\varphi_{K}(y))'\) and \(\mathbf{D}(g)=\text{diag}(\mathbb{E}[g(y_{3})|k])\). They call \(\mathbf{A}\) a lower-dimensional submodel: the same object with the third measurement left out. Since \(\mathbf{B}(g)\mathbf{A}^{-1}=\mathbf{L}_{1}\mathbf{D}(g)\mathbf{L}_{1}^{-1}\), the eigenvalues give \(\mathbb{E}[g(y_{3})|k]\) for any function \(g\). Taking \(g(y)=\mathbf{1}\{y\leq c\}\) for each \(c\) recovers the whole distribution of \(y_{3}\) for each type. Taking \(g=\varphi_{i}\) for \(i=1,\ldots,K\) recovers the matrix \(\mathbf{L}_{3}\), and the type probabilities then solve the linear system \(\mathbb{E}[\varphi(y_{3})]=\mathbf{L}_{3}\pi\).

Second, rather than inverting \(\mathbf{A}\), they transform the problem using its singular value decomposition, \(\mathbf{A}=\mathbf{U}\mathbf{S}\mathbf{V}'\). Let \(\mathbf{W}_{1}=\mathbf{S}^{-1/2}\mathbf{U}'\) and \(\mathbf{W}_{2}=\mathbf{S}^{-1/2}\mathbf{V}'\), so that \(\mathbf{W}_{1}\mathbf{A}\mathbf{W}_{2}'=\mathbf{I}\). Then for every \(g\): \[ \mathbf{C}(g) \equiv \mathbf{W}_{1}\mathbf{B}(g)\mathbf{W}_{2}' = \mathbf{Q}\mathbf{D}(g)\mathbf{Q}^{-1},\qquad \mathbf{Q}=\mathbf{W}_{1}\mathbf{L}_{1}\mathbf{\Pi}^{1/2}. \] So every matrix \(\mathbf{C}(g)\) is diagonalized by the same matrix \(\mathbf{Q}\). With sampling noise, no single \(\mathbf{Q}\) will exactly diagonalize all of the estimated matrices, so their estimator chooses \(\mathbf{Q}\) to make them all as close to diagonal as possible, by minimizing the sum over \(g\) of the squared off-diagonal elements of \(\mathbf{Q}^{-1}\hat{\mathbf{C}}(g)\mathbf{Q}\). This is called a joint approximate diagonalization, and it uses all of the information in the third measurement at once instead of a single linear combination as in Example 25.2. The eigenvalues are then estimated by the diagonal of \(\hat{\mathbf{Q}}^{-1}\hat{\mathbf{C}}(g)\hat{\mathbf{Q}}\).

They also point out that the rank condition can be tested, since if \(\mathbf{L}_{1}\) and \(\mathbf{L}_{2}\) have rank \(K\) then so does the observable matrix \(\mathbf{A}\). This is true of every version of the argument in this chapter.

Example 25.3 Suppose we observe three continuous measurements for each unit, and there are three types. To make the point that nothing here is parametric, we’ll draw the type-specific distributions from different families.

using Plots
include("../scripts/plot_theme.jl")
Random.seed!(11)

π_c = [0.3, 0.45, 0.25]
dists = [Normal(-1.5, 0.7), Gamma(2, 0.5), Normal(2.5, 0.6)]
N = 50_000
type_c = rand(Categorical(π_c), N)
Yc = [rand(dists[type_c[n]]) for n in 1:N, t in 1:3];

For simplicity we use the functions \(\varphi(y)=(1,y,y^{2})'\), so the rows of \(\mathbf{L}_{t}\) are the type-specific moments \(1\), \(\mathbb{E}[y|k]\), and \(\mathbb{E}[y^{2}|k]\). We build \(\hat{\mathbf{A}}\) and \(\hat{\mathbf{B}}(g)\) from sample averages and transform them using the singular value decomposition of \(\hat{\mathbf{A}}\).

φ(y) = [1.0, y, y^2]
Φ = [reduce(hcat, φ.(Yc[:, t]))' for t in 1:3]
A = Φ[1]' * Φ[2] / N
Bg(g) = Φ[1]' * (g.(Yc[:, 3]) .* Φ[2]) / N

F = svd(A)
W1 = Diagonal(1 ./ sqrt.(F.S)) * F.U'
W2 = Diagonal(1 ./ sqrt.(F.S)) * F.V'
C(g) = W1 * Bg(g) * W2';

To keep the code short, we take \(\hat{\mathbf{Q}}\) to be the eigenvectors of a single matrix, \(\hat{\mathbf{C}}(g)\) with \(g(y)=y\), and then use it to diagonalize every other matrix. You will implement the joint approximate diagonalization in Exercise 25.2.

Q̂ = real.(eigen(C(y -> y)).vectors)
eigvals_at(g) = real.(diag(Q̂ \ C(g) * Q̂))   #<- estimates of E[g(y₃) | k]

L̂3 = reduce(vcat, [eigvals_at(y -> y^p)' for p in 0:2])
order = sortperm(L̂3[2, :])                    #<- label types by their mean
L̂3 = L̂3[:, order]
π̂ = L̂3 \ vec(mean(Φ[3], dims = 1))
[π̂ π_c]
3×2 Matrix{Float64}:
 0.296261  0.3
 0.456017  0.45
 0.247722  0.25

The first row of \(\hat{\mathbf{L}}_{3}\) should be all ones, and the second contains the type-specific means:

[L̂3[1:2, :]' mean.(dists)]
3×3 Matrix{Float64}:
 1.0  -1.49778   -1.5
 1.0   0.994665   1.0
 1.0   2.49791    2.5

Finally, we recover the type-specific CDFs of the third measurement using \(g(y)=\mathbf{1}\{y\leq c\}\).

cgrid = -3.5:0.1:4.5
F̂ = reduce(hcat, [eigvals_at(y -> y <= c)[order] for c in cgrid])'
pl = plot(xlabel = "\$y\$", ylabel = "\$P(y_3 \\leq c \\mid k)\$", legend = :topleft,
          title = "Type-specific distributions recovered by diagonalization")
cols = [MCM.teal, MCM.orange, MCM.mustard]
for k in 1:3
    plot!(pl, cgrid, cdf.(dists[k], cgrid), color = cols[k], label = "Type $k (true)")
    scatter!(pl, cgrid[1:4:end], F̂[1:4:end, k], color = cols[k], label = "")
end
pl

The lines are the true CDFs and the dots are the estimates.

25.3 Variation in Observable States

Many of the outcomes we study are binary, like whether a woman works or whether a firm enters a market. With a binary outcome in each of three periods, the measurement argument can identify at most two types, since each outcome only has two points of support. Kasahara and Shimotsu (2009) show that variation in observable states can take the place of variation in outcomes.

Suppose a binary choice \(d_{t}\) depends on the type and on a state variable \(x_{t}\), through the type-specific choice probabilities \(p_{k}(x)=\mathbb{P}(d_{t}=1|x_{t}=x,k)\). To keep things simple, suppose that \(x_{t}\) is exogenous and independent of the type, and that choices are independent across periods given the type and the states: \[ \mathbb{P}(d_{1},d_{2},d_{3}|x_{1},x_{2},x_{3}) = \sum_{k=1}^{K}\pi_{k}\prod_{t=1}^{3}p_{k}(x_{t})^{d_{t}}(1-p_{k}(x_{t}))^{1-d_{t}}. \] Choose \(K-1\) values of the state, \(\xi_{1},\ldots,\xi_{K-1}\), and define the \(K\times K\) matrix \(\mathbf{L}\) with rows indexed by \(i=0,1,\ldots,K-1\): \[ \mathbf{L}[0,k] = 1,\qquad \mathbf{L}[i,k] = p_{k}(\xi_{i}),\quad i\geq 1. \] Row \(0\) corresponds to “ignoring” a period. Now define the matrices: \[ \mathbf{A}[i,j] = \mathbb{P}(d_{1}=1,d_{2}=1|x_{1}=\xi_{i},x_{2}=\xi_{j}),\qquad \mathbf{B}(c)[i,j] = \mathbb{P}(d_{1}=1,d_{2}=1,d_{3}=1|x_{1}=\xi_{i},x_{2}=\xi_{j},x_{3}=c) \] with the convention that index \(0\) drops the corresponding period. For example, \(\mathbf{A}[0,j]=\mathbb{P}(d_{2}=1|x_{2}=\xi_{j})\) and \(\mathbf{A}[0,0]=1\). All of these are observable, and you can check that: \[ \mathbf{A} = \mathbf{L}\mathbf{\Pi}\mathbf{L}',\qquad \mathbf{B}(c) = \mathbf{L}\mathbf{\Pi}\mathbf{D}(c)\mathbf{L}',\qquad \mathbf{D}(c)=\text{diag}(p_{1}(c),\ldots,p_{K}(c)). \] This is the same structure as before. The eigenvectors of \(\mathbf{B}(c)\mathbf{A}^{-1}\) are the columns of \(\mathbf{L}\), normalized so that their first element is one, and the eigenvalues are the type-specific choice probabilities at \(x_{3}=c\). Like Bonhomme, Jochmans, and Robin (2016), Kasahara and Shimotsu (2009) rely on “lower-dimensional submodels” (here, the probabilities that ignore a period) to pin down the scale of \(\mathbf{L}\).

Kasahara and Shimotsu (2009) don’t need the states to be exogenous. In their baseline model the states follow a Markov process that can depend on past choices, \(f(x_{t}|x_{t-1},d_{t-1})\), which is the same for all types and so can be estimated directly from the data. Dividing the joint distribution of choices and states by these transition probabilities leaves a mixture with exactly the structure above. They also allow the joint distribution of the initial state and choice, \((x_{1},d_{1})\), to differ by type, and they use the first period (instead of the third) to get the diagonal matrix. The algebra is the same.

The difference is in what the rank condition means. The rows of \(\mathbf{L}\) are now indexed by values of the state, so \(\mathbf{L}\) only has full rank if the types respond differently to the state. If choice probabilities didn’t depend on \(x\), every row of \(\mathbf{L}\) after the first would be the same, and we would be back to identifying at most two types. So variation in the state only helps to identify heterogeneity if different types react to it differently. In the words of Kasahara and Shimotsu (2009), “the covariate must be relevant, and different types must respond to its changes differently.” Since we need \(K-1\) distinct values of the state, a state with \(|\mathcal{X}|\) points of support can identify at most \(|\mathcal{X}|+1\) types with three periods.

Example 25.4 Consider a simplified version of the labor force participation problem. Each period, a woman decides whether to work (\(d_{t}=1\)), and her husband’s income is either low (\(x_{t}=1\)) or high (\(x_{t}=2\)). There are three types: one that rarely works, one that works mostly when her husband’s income is low, and one that almost always works. Husband’s income is drawn independently of the type.

Random.seed!(3)
π_s = [0.3, 0.45, 0.25]
p_true = [0.10 0.75 0.90;
          0.10 0.15 0.90]  #<- p_true[x,k] = P(d = 1 | x, k)
N = 500_000
type_s = rand(Categorical(π_s), N)
X = rand(1:2, N, 3)
D = [rand() < p_true[X[n,t], type_s[n]] for n in 1:N, t in 1:3];

Notice that with \(K=3\) we need \(K-1=2\) values of the state, which is all we have. The function below computes the entries of \(\mathbf{A}\) and \(\mathbf{B}(c)\) from sample frequencies, using index \(0\) to ignore a period.

function moment_ks(i, j, c)
    keep = trues(N)
    val = ones(N)
    i > 0 && (keep .&= X[:,1] .== i; val .*= D[:,1])
    j > 0 && (keep .&= X[:,2] .== j; val .*= D[:,2])
    c > 0 && (keep .&= X[:,3] .== c; val .*= D[:,3])
    return mean(val[keep])
end
A = [moment_ks(i, j, 0) for i in 0:2, j in 0:2]
B = [[moment_ks(i, j, c) for i in 0:2, j in 0:2] for c in 1:2];

We take the eigendecomposition of \((\mathbf{B}(1)+\mathbf{B}(2))\mathbf{A}^{-1}\), which has distinct eigenvalues \(p_{k}(1)+p_{k}(2)\), and normalize the eigenvectors so their first element is one.

E = eigen((B[1] + B[2]) / A)
L̂ = real.(E.vectors)
L̂ ./= L̂[1:1, :]
L̂ = L̂[:, sortperm(L̂[2, :] + L̂[3, :])]
[L̂[2:3, :] ; p_true]
4×3 Matrix{Float64}:
 0.0813138  0.722212  0.909541
 0.0976444  0.147678  0.889256
 0.1        0.75      0.9
 0.1        0.15      0.9

The top two rows are the estimated choice probabilities, and the bottom two rows are the truth. The type probabilities follow as before:

Π̂ = L̂ \ A / L̂'
[diag(Π̂) π_s]
3×2 Matrix{Float64}:
 0.278847  0.3
 0.478251  0.45
 0.25433   0.25

We used a large sample here. Estimates based on this argument are noisy, because the matrices are built from cells that condition on the state in each of three periods, and because the identifying variation (how differently types respond to the state) comes from third-order interactions in the data. You can see this for yourself by reducing \(N\).

25.3.1 The State as an Instrument

Notice that the state \(x\) in this argument acts like an instrument, since it shifts choice probabilities and is independent of the type. So what could we do with it in a single cross-section? There we would observe \[ \mathbb{P}(d=1|x) = \sum_{k=1}^{K}\pi_{k}p_{k}(x). \] This is enough to answer some counterfactual questions directly. For example, the effect on the participation rate of moving every woman’s husband’s income from \(x\) to \(x'\) is \(\mathbb{P}(d=1|x')-\mathbb{P}(d=1|x)\), for any \(x\) and \(x'\) in the support of the data. But it isn’t enough to recover the distribution of types. Each value of \(x\) provides one number and introduces \(K\) new unknowns, \(p_{1}(x),\ldots,p_{K}(x)\). Without restrictions on how \(p_{k}\) varies with \(x\), the cross-section can’t tell apart a population in which every woman responds a little to her husband’s income from one in which some women respond a lot and others not at all. The two can have the same average response but give different answers to questions about who responds, such as how many women would never work at any level of husband’s income, or how much of a policy’s effect is concentrated among a few women. To separate them, we need to see the same woman at different values of \(x\), which is what the panel gives us.

The same distinction comes up with instruments in the treatment effects literature, where an instrument identifies the average effect of the particular change in incentives that it induces, but not the full distribution of heterogeneous effects.

25.3.2 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 the argument above to sequences of choices conditional on particular sequences of observed states. When lagged choices enter the state directly (state dependence), more periods are needed: for example, Kasahara and Shimotsu (2009) show that six periods suffice for a stationary first-order Markov model.

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.

25.4 Instruments

Can an instrument play the same role as the signals above? That depends on what the instrument does. A variable that is correlated with the type but has no effect on choices given the type is just another measurement of the type, and fits directly into the argument above (Hu 2008 develops this idea for discrete variables measured with error). A variable that shifts choices but is independent of the type is different. We’ve already seen one of these, the state \(x\) in Example 25.4, and we saw that it can help identify the distribution of types, but only together with a panel.

25.4.1 Instruments for Endogenous States

Berry and Compiani (2023) study a different kind of instrument. In dynamic models where persistent unobservables make some state variables endogenous, they 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 for instrumental variables in nonseparable models. Berry and Compiani (2023) use the generalized instrumental variables framework of Chesher and Rosen (2017; see also Chesher 2010). The only restriction on the unobservables is that they are independent of the instruments: they may be serially correlated rather than permanent, and need not be discrete. The cost of this generality is that the policy function and payoff parameters are typically set identified: the data and the independence restriction deliver a set of parameters consistent with the model, which collapses to a point only when the instruments are strong enough. Their approach can be applied with as few as two periods of data, and does not require assumptions about the initial conditions.

These instruments are independent of the unobserved heterogeneity. But things change once we condition on the current state. Among women with the same experience \(h_{nt}\), those whose husbands had high income in the past must have worked despite weak financial incentives, and so are likely to have a strong taste for work. So conditional on the current state, lagged husband’s income is correlated with \(\alpha_{n}\). And conditional on the current state and \(\alpha_{n}\), it has no effect on current or future choices. With discrete types, lagged husband’s income is then a signal of the type that is excluded from choices, within each value of the current state. If we are also willing to assume that choices are independent over time given the type and the path of states, as in Kasahara and Shimotsu (2009), the diagonalization argument can in principle be applied cell by cell. This isn’t how Berry and Compiani (2023) proceed, and it’s useful to compare the two. The diagonalization argument gets point identification by adding the assumptions of discrete types and conditional independence, while Berry and Compiani (2023) only assume that the instrument is independent of the unobservables and get a set of parameters in return. (They show that the discrete-type models of Kasahara and Shimotsu (2009) are a special case of their framework.) One caveat is that, conditional on the current state, lagged income is only relevant through selection on past choices, so it may be a weak instrument.

25.5 Summary

Each approach in this chapter identifies the distribution of heterogeneity from three signals of the type that are independent conditional on the type (and observed states). They differ in where these signals come from:

Approach Rows of \(\mathbf{L}_{1}\) Columns of \(\mathbf{L}_{2}'\) Diagonal Rank condition requires Conditional independence requires
Multiple measurements functions of \(y_{1}\) functions of \(y_{2}\) \(g(y_{3})\) types have different outcome distributions measurements unrelated given type
Observable states choice at \(x_{1}=\xi_{i}\) choice at \(x_{2}=\xi_{j}\) choice at \(x_{3}=c\) types respond differently to the state choices unrelated given type and states

In each case, the rank condition tells us what variation identifies the heterogeneity, and the conditional independence assumption is what we must defend to argue that the identification is credible.

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 23.6?)
  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?

25.6 Exercises

Exercise

Exercise 25.1 Return to the setting of Example 25.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 25.1?
Exercise

Exercise 25.2 Using the setting of Example 25.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?
  5. Return to Example 25.3 and implement the joint approximate diagonalization of Bonhomme, Jochmans, and Robin (2016): choose an invertible \(\mathbf{Q}\) (with columns normalized to unit length) to minimize \(\sum_{g}\|\text{off}(\mathbf{Q}^{-1}\hat{\mathbf{C}}(g)\mathbf{Q})\|^{2}\) over a collection of functions \(g\), where \(\text{off}(\cdot)\) sets the diagonal of a matrix to zero. You can use a generic optimizer, starting from the eigenvectors used in the example. Compare the estimates of \(\pi\) in a small Monte Carlo with \(N=2,000\).
Exercise

Exercise 25.3 Consider the female labor force participation model with two types from Example 24.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.
Exercise

Exercise 25.4 This exercise explores the rank condition in Example 25.4 and the role of the panel.

  1. In Example 25.4, change p_true so that choice probabilities do not depend on husband’s income (make the two rows equal). What happens to \(\hat{\mathbf{A}}\)? Explain using the rank condition, and say which features of the model can still be identified.
  2. Now let the second type’s choice probabilities move only slightly with husband’s income (for example, 0.75 and 0.65). Run a small Monte Carlo with \(N=100,000\) and compare the dispersion of the estimates to the original design. What does this tell you about where identification comes from?
  3. Using only the first period of data in Example 25.4, find two different sets of parameters \((\pi,p)\) with \(K=2\) that generate the same \(\mathbb{P}(d=1|x)\) for \(x\in\{1,2\}\). Do they agree on the effect on participation of moving from \(x=1\) to \(x=2\)? Do they agree on the share of women who work in all three periods when \(x=2\)? Relate your answer to the discussion of the state as an instrument.