# A General Solution for the Errors in Variables (EIV) Model with Equality and Inequality Constraints
## 3 A General Solution for EIC-EIV Model  
There are many research studies about the solution of the EIV model. For example, the Lagrange method, Newton method or Gauss-Newton method can be adopted to solve the problem [3]. Although the solution of EIV model requires iterative processing, the solution should be numerically efficient as well as identical to the classical least square adjustment. According to previous literature research [3,5], the formula of the parameter estimation for the EIV model similar to classical least square adjustment can be derived from Equation (4):  
\[X=(\hat{A}^{T}\hat{Q}^{-1}\hat{A})^{-1}\cdot\hat{A}^{T}\hat{Q}^{-1}\hat{L} \tag{8}\]  
It is worth noting that Equation (4) needs to be iterated successively. The coefficient matrix \(\hat{A}\), observation vector \(\hat{L}\) and cofactor matrix \(\hat{Q}\) need to be updated after each iteration, and the iteration is stopped when the difference between the two results is less than the given threshold. Similarly, the approximate accuracy evaluation formula of the parameter estimates can be obtained directly (see [PERSON], [PERSON] and [PERSON] [5]).  
Targeting at the situation that most algorithms based on inequality-constrained least squares adjustment are complex, a simple iterative algorithm is proposed based on penalty functions and zero or infinite weight. It is similar to the classical least square adjustment and easy to implement. In this paper, the method is applied to the EIC-EIV model and extended to equality constraints. First, we take equality constraints as inequality constraints that do not satisfy the constraint conditions, and the penalty function of equality and inequality constraints are constructed respectively. Thus, the corresponding objective function of Equation (7) can be expressed as follows:  
\[\hat{V}^{T}\hat{Q}^{-1}\hat{V}+P_{1}(X)+P_{2}(X)=\min \tag{9}\]  
where \(P_{1}(X)\) and \(P_{2}(X)\) are the penalty functions of equality constrained and inequality constrained, respectively. \(P_{1}(X)\) is a positive large value, meaning that equality constraints need to be punished. \(P_{2}(X)\) takes 0 or a large value according to the inequality constraint. To construct a penalty function, Equation (6) can be expressed as follows:  
\[\left.\begin{array}{l}\vspace{0.2 cm}\hat{V}=\hat{A}X-\hat{L}\\ V_{1}=G_{1}X-W_{1}\\ V_{2}=G_{2}X-W_{2}\end{array}\right\} \tag{10}\]  
Then we can obtain a biased variance component estimator of the unit weight [19]  
\[\sigma_{0}^{2}=\frac{\hat{\mathbf{V}}^{T}\hat{\mathbf{Q}}^{-1}\hat{\mathbf{V}}}{\mathbf{m}-\mathbf{n} +\mathbf{s}} \tag{15}\]  
where \(\mathbf{s}\) denotes the number of constraint equations, according to Formula (14). The approximate accuracy evaluation formula of parameter estimation can be derived:  
\[\mathbf{D}(\mathbf{X})=\sigma_{0}^{2}\cdot((\hat{\mathbf{A}}^{i+1})^{T}\hat{\mathbf{Q}}^{-1} \hat{\mathbf{A}}^{i+1}+\mathbf{G}_{1}^{T}\mathbf{P}_{1}{}^{i+1}\mathbf{G}_{1}+\mathbf{G}_{2}^{T}\bm {P}_{2}{}^{i+1}\mathbf{G}_{2})^{-1} \tag{16}\]  
In fact, there are two main approaches for accuracy evaluation of IC-EIV estimates, including active constraint method and aggregate constraint method [20]. The first approach is adopted in our proposed Formula (16), while the other method is adopted in [PERSON] and [PERSON] [19]. The results of the accuracy evaluation obtained by using the two methods are different.  
Note that the general solution can not only solve the EIV model with equality and inequality constraints respectively, but also solve the EIV model with equality and inequality constraints. Moreover, it can also solve the Gauss-Markov (G-M) model with equality and inequality constraints. It was not discussed by [PERSON] and [PERSON] [19].