A Note on Applying the BCH Method Under Linear Equality and Inequality Constraints

Researchers often wish to relate estimated scores on latent variables to exogenous covariates not previously used in analyses. The BCH method corrects for asymptotic bias in estimates due to these scores’ uncertainty and has been shown to be relatively robust. When applying the BCH approach however, two problems arise. First, negative cell proportions can be obtained. Second, the approach cannot deal with situations where marginals need to be fixed to specific values, such as edit restrictions. The BCH approach can handle these problems when placed in a framework of quadratic loss functions and linear equality and inequality constraints. This research note gives the explicit form for equality constraints and demonstrates how solutions for inequality constraints may be obtained using numerical methods.


Introduction
Researchers in many different disciplines apply latent structure models in which observed variables are treated as indicators of an underlying latent variable that cannot be measured directly. An often used strategy in this context consists of three steps (Vermunt 2010). First, the parameters of the measurement model are estimated, describing the relationship between the latent variable and its indicators. Second, each respondent is assigned a latent score based on his/her scores on the indicators. Finally, the relationships between the latent scores and scores on exogenous variables are assessed. Croon (2002) showed that for general latent structure models, such a strategy leads to inconsistent estimates of the parameters of the joint distribution of the latent variable and the L. Boeschoten l.boeschoten@tilburguniversity.edu exogenous variables. Bolck et al. (2004) discussed this problem in the context of latent class analysis where observed variables are categorical. They also derived a correction procedure that produces consistent estimates, known as the BCH correction method. Subsequent simulation studies by Vermunt (2010), Bakk et al. (2013), Bakk and Vermunt (2016), and Nylund- Gibson and Masyn (2016) have demonstrated that this procedure produces unbiased parameter estimates and correct inference for a large range of simulation conditions. When applying the BCH correction method in cases of categorical exogenous variables, two problems can arise. First, negative cell proportion estimates can be obtained (Asparouhov and Muthén 2015). Second, the approach cannot deal with situations where marginals need to be constrained. An example is edit restrictions in official statistics, leading to certain marginals being fixed to zero (De Waal et al. 2012), which is also used in combination with latent class modelling (Boeschoten et al. 2017).
In this research, note the BCH method is extended to solve these two problems. We allow for linear equality and inequality constraints by noting the correction method minimizes a quadratic loss function and give a closed form solution for linear equality restrictions. Next, we demonstrate how solutions for inequality constraints may be obtained using numerical methods. We first discuss the three-step approach to the latent class model and the BCH correction method. We then show how to impose linear restrictions and how to extend this to including non-negativity constraints. At last, the extended BCH method is applied on a dataset from the Political Action Survey. In the Appendix, R code is given to apply the procedure.

The Three-Step Approach to the Latent Class Model and the BCH Correction Method
Let us denote a set of observed exogenous variables Q and an unobserved latent variable X. All variables involved are assumed to be categorical. Let Q = (Q 1 , Q 2 , ..., Q J ) be the Cartesian product of J different discrete random variables Q j . If the variable Q j is defined for n j categories, the distribution of Q can be specified as a multinomial distribution with n = J j =1 n j categories. In the basic latent class model considered by Bolck et al. (2004), a single categorical latent variable X with m categories is introduced. The variable X itself is not directly observed but only indirectly via a set of indicator variables Y = (Y 1 , Y 2 , ..., Y K ). Let the joint distribution of the categorical variables Q, X, and Y be denoted by Then, a possible factorization is p(q, x, y) = p(q)p(x|q)p(y|x, q).
Since in the basic latent class model Q is assumed to have no direct effect on Y, the latter result simplifies to p(q, x, y) = p(q)p(x|q)p(y|x).
The three-step approach to the estimation of the parameters of the latent class model starts with the estimation of the parameters of the measurement model represented by the conditional probability distribution p(y|x). Once this estimation procedure is completed, individual research units may be assigned to one of the latent classes solely on the basis of their observed scores on Y. This defines the second step of the estimation procedure and results in an assignment of each individual to a latent class. If the random variable W represents the latent classes individuals are assigned to, and assignment is done using a modal rule where each individual is assigned to the class for which its posterior membership probability is the largest, this can be expressed as Different assignment rules than the modal rule will yield a different form for Eq. 2. All subsequent results also apply to other assignment rules, such as proportional or random assignment (Bakk 2015).
Since Y and Q are conditionally independent given X, so are W and Q and the conditional distributions are related by In terms of the joint distribution, this becomes The latter result can be recast as a matrix equation with the elements of the three matrices defined as e qw = p(q, w), a qx = p(q, x), and d xw = p(w|x). After completing the first and the second estimation steps, the elements of the matrices E and D are known. The joint distribution of Q and the latent variable X is then given by A = ED −1 . Here, it is assumed that matrix D is not singular so that its inverse exists (see Bolck et al. (2004, pp. 13-14) for a discussion on when this assumption may be violated). A consistent The previously obtained algebraic solution for matrix A can also be derived via a rather trivial minimization of a least squares function. Let E and D be matrices with known elements. Matrix E is of order n × m and D is an invertible matrix of order m × m. Let A be an n × m matrix of unknown elements and consider the following least squares function: Minimizing ϕ with respect to the unknown matrix A yields A = ED −1 , for which ϕ attains the truly minimal value of zero. Note that the factor 1/2 is introduced to obtain simpler expressions for the first derivatives. Its introduction does not change the solution of the minimization problem.

The Correction Procedure Under Linear Equality Constraints
In some applications, simple linear restrictions may be imposed on the elements of matrix A. For instance, some of the probabilities in the joint distribution of Q and X may be set equal to zero, for example for combinations of Q and X that cannot occur in practice. After imposing such zero constraints, all the non-zero cell probabilities should still add to one. The quadratic loss function ϕ can be minimized under equality constraints on the unknown elements of matrix A by applying the method of Lagrangian multipliers. We first rewrite the quadratic loss function ϕ in the following way using vectorization operations on matrices (see Schott 1997, pp. 261-266). For the vector of residuals r, we obtain where I n×n is an n × n identity matrix. Applying Theorem 7.15 from Schott (1997, p. 263) yields in which ⊗ is the Kronecker product of two matrices (Graham 1982). Defining P = D ⊗ I n×n , a = vec(A) and e = vec(E), we are able to write so that the least squares function becomes The completely unconstrained solution to the minimization problem is given by Now suppose that the S linear equality constraints can be represented by a matrix equation The matrix H is of order S × N , N being the number of cells in matrices A and E. We may assume that H is of rank S; otherwise, the linear equality constraints would not be linearly independent. To minimize the least square function ϕ under a set of S linear constraints on the elements of A, the Lagrangian is defined as Setting the first derivatives of L with respect to a equal to the zero vector, and solving for a yields: a = (P P) −1 (P e + H λ), which can be rewritten as: a = a 0 + (P P) −1 H λ.
Solving for the unknown Lagrangian multipliers by taking the derivative of the Lagrangian (Eq. 2), and setting it to zero, or equivalently by imposing linear constraints Ha − c = 0 yields: So that the final solution for a is: Note that the vector c − Ha 0 represents the deviations of the unconstrained solution from the linear equality constraints. Again a consistent estimate of a can be obtained by replacing P and a 0 with their sample estimates.

The Correction Procedure Under Linear Equality and Inequality Constraints
A second issue with the BCH procedure is that in finite samples the consistent estimateÂ hat may contain negative values. This issue is similar to the occurrence of Heywood cases in factor analysis (Heywood 1931). Such negative values in the probability table estimatê A may prevent subsequent analyses. We suggest preventing such inadmissible solutions by imposing inequality constraints. The resulting minimization problem is a quadratic program that can be solved by an iterative method. Such a numerical iterative method for an equality and inequality constrained minimization of a quadratic function has been described by Goldfarb and Idnani (1983). Their numerical algorithm solves the quadratic programming problem of the form with respect to the n unknown parameters in vector b. The matrix D mat is a given n × n symmetric positive definite matrix whereas d vec is a given n × 1 vector.
To apply the Goldfarb-Idnani optimization procedure in the present context, the following definitions have to be implemented. First, to include non-negativity constraints, we make use of Theorem 7.6 from Schott (1997, p. 254) to obtain D mat = P P = (DD ) ⊗ I n×n . and d vec = P e Since it is assumed that matrix D is of full rank, the matrix P P is positive-definite. This ensures that the quadratic loss function ϕ is strictly convex. Moreover, the type of equality and inequality constraints considered here (the sum of the elements in matrix A is equal to 1, where all elements ≥ 0 and some are fixed to 0), define a convex region in the parameter space.
To represent the constraints on the cell probabilities we now define matrix H in such a way that the first row of H has all its elements equal to 1. This row represents a constraint on the sum of all cell probabilities. We represent this row vector as matrix H 0 . Let J = {1, 2, 3, ..., N} be an index set corresponding to the column numbers of matrix H. This index set can be partitioned in two non-overlapping subsets J 1 and J 2 : • Subset J 1 contains the indices of the elements of vector a which are set exactly equal to zero: for those indices j we require a j = 0; • Subset J 2 contains the indices of the elements of vector a which are required to be non-negative: for those indices j we require a j ≥ 0. Now let I n be an N × N identity matrix and permute the rows of this matrix so that the upper part contains the rows corresponding with the index numbers in J 1 , and the lower part of the permuted identity matrix contains the rows corresponding with the index numbers in J 2 . Referring to the two parts of the permuted identity matrix as H 1 and H 2 , respectively, the matrix H is obtained by where H is used to obtain the final solution for a. Note that in cases where we are not interested in applying equality constraints, but we are interested in applying the inequality constraints we simply omit H 1 . Vector b 0 is of length N + 1, with its first element equal to 1 and all the remaining elements equal to 0. With this procedure, we are able to find a solution for A (the joint distribution of latent variable X and exogenous covariates Q) where the sum of the elements is equal to 1, where no negative elements are created, and where impossible combinations of scores can be set to have a probability of zero. Having defined b, D mat and H, the solution can be obtained using standard software for quadratic programming, such as the R package quadprog (Turlach and Weingessel 2013).

Application
As an illustration, the extended BCH method is applied on a dataset from the Political Action Survey (Barnes et al. 1979;Jennings and Van Deth 1990). The dataset consists of five dichotomous indicators on political involvement and tolerance ("System Responsiveness"; "Ideological Level"; "Repression Potential"; "Protest Approval"; "Conventional Participation") and three nominal covariates ("Sex"; "Level Of Education"; "Age"). This dataset has previously been used in Hagenaars (1993) and Vermunt and Magidson (2000) and in the Latent GOLD user's manual (Vermunt and Magidson 2005). The dataset as well as the syntax used in this illustration can be found in Latent GOLD version 5.1 under "syntax examples" → LCA → restrictions → equalities → Model C.
In the first step, a four class restricted model is applied to distinguish between four latent classes on involvement and tolerance. In this model, response probabilities are restricted to be equal for the items "System Responsiveness" and "Conventional Participation," and the response probability for the variable "Ideological Level" is fixed to 0 by specifying a logit of 100.
In the second step, cases are assigned to a latent class by using modal assignment, resulting in the imputed latent variable W . In the third step, the relationship between the imputed latent variable "Involvement And Tolerance" (W ) and exogenous covariate "Age" (Q) is investigated. The E-matrix containing the joint probabilities of these variables is: The D-matrix describing the relationship between the imputed latent variable "involvement and tolerance" (W ) and the latent variable "involvement and tolerance" (X) is also obtained: The BCH method can now be applied by estimating ED −1 , resulting in the A matrix: As can be seen, this result is inadmissable since the cell Q 58-91 × X 4 contains a negative value. Therefore, it will not be possible to estimate posterior membership probabilities and to do subsequent analyses here. When the extended BCH method is applied, the following constrained A matrix is obtained: The cell Q 58-91 × X 4 does not contain a negative value anymore, so this matrix can now be used to estimate posterior membership probabilities and to do subsequent analyses.
Since there are no combinations of scores between "Involvement And Tolerance" and "Age" that are not possible in practice, it is not needed to fix any marginals to zero.

Conclusion
We have modified the BCH method to include linear equality and inequality constraints solving the problem of negative solutions and allowing for restrictions on arbitrary cell margins. With these adjustments, analysts interested in relating covariates to assignments on latent class variables will now be able to, for example, impose edit restrictions, further analyse solutions that were previously inadmissible, and analyse datasets involving more complex marginal restrictions. The application demonstrates that when a negative value is obtained using the regular BCH method, this can be solved by using the extended BCH method. In the Appendix, R code is given to apply the extended BCH method, and an addition to the example is given that demonstates how margins can be fixed to zero using the extended BCH method.
Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.