3.1 Linear EIV Models


gest = 5150 eivknownatt (w, y, kww)
estimates the parameters with known reliability ratio
gest = 5153 eivknownratue (w, y, delta)
estimates the parameters with known ratio of the two variances of the two measurement errors
gest = 5156 eivknownvaru (w, y, sigmau)
estimates the parameters with known variance of the measurement error
gest = 5159 eivknownvarumod (omega, w, y, sigmau)
calculates modified estimators of the parameters with known variance of the measurement error
gest = 5162 eivlinearinstr (w, z, y)
estimates the parameters with the instrumental variable z
gest = 5165 eivvec1 (w, y, sigue, siguu)
estimates the parameters with multi-dimensional variables x with known variance and covariance of $ \varepsilon $ and $ U$, see (3.1)
gest = 5168 eivvec2 (w, y, gamma)
estimates the parameters for multi-dimensional variables x with known covariance of the measurement error
gest = 5171 eivlinearinstrvec (w, z, y)
estimates the parameters for multi-dimensional variables with the instrumental variable z
A linear errors-in-variables model is defined as:
$\displaystyle Y$ $\displaystyle =$ $\displaystyle \alpha+\beta^TX+\varepsilon$  
$\displaystyle W$ $\displaystyle =$ $\displaystyle X+U,$ (3.1)

where $ Y$ is the dependent variable, $ X$ is the matrix of regressors, and U is a random term. In this model, the regressors $ X$ are observed with error, i.e., only the variable $ W = X+U$, called the manifest variable, is directly observed. The unobserved variable $ X$ is called a latent variable in some areas of application, while $ U$ is called the measurement error. Models with fixed $ X$ are called functional models, while models with random $ X$ are called structural models.

We assume that the random variables $ (X, \varepsilon , U)$ are independent with mean $ (\mu_x, 0, 0)$ and covariance matrix diag $ (\Sigma_{xx}, \sigma_{ee}, \sigma_{uu}I_p)$. In the eiv quantlib the method of moments is used to estimate the parameters. In the literature, it's generally assumed that $ (X, \varepsilon , U)$ are jointly normally distributed, and that $ (W, Y)$ follows a bivariate normal distribution (Fuller; 1987). Even without the normality assumption, various moment methods may be used to estimate all parameters. Furthermore, we assume that $ \sigma_{ee}=\delta\sigma_{uu}$. Thus, the mean and the variance of the joint distribution of $ (Y, W)$ are

\begin{displaymath}\mu=\left(
\begin{array}{c}
\alpha+\beta^T\mu_x\\
\mu_x
\end...
...Sigma_{xx}\beta &\Sigma_{xx}+\sigma_{uu}I_p
\end{array}\right).\end{displaymath}     (3.2)

We write $ m_{yy}=\sum_{t=1}^n(Y_t-\overline Y)^2/{(n-1)}$, $ m_{wy}=\sum_{t=1}^n(W_t-\overline W)(Y_t-\overline Y)/{(n-1)}$ and $ m_{ww}=\sum_{t=1}^n(W_t-\overline W)(W_t-\overline W)^T/{(n-1)}$. Using the method of moments, we define the solutions of the following equations as the estimators of $ \beta, \Sigma_{xx}, \sigma_{uu}.$


$\displaystyle \left\{\begin{array}{ll}
m_{yy}&=\delta\sigma_{uu}+\beta^T\Sigma_...
...}&=\Sigma_{xx}\beta\\
m_{ww}&=\Sigma_{xx}+\sigma_{uu}I_p\\
\end{array}\right.$     (3.3)


3.1.1 A Single Explanatory Variable

Let's first investigate the case of single explanatory variable, i.e., $ p = 1$. The least squares estimator based on the observed variables is biased towards zero because of the disturbance of the measurement error. In fact, let

$\displaystyle \widehat \gamma_1=\Bigl\{\sum_{t=1}^n(W_t-\overline W)^2\Bigr\}^{-1}
\sum_{t=1}^n(W_t-\overline W)(Y_t-\overline Y)$     (3.4)

be the regression coefficient computed from the observed variables. $ \widehat \gamma_1$ would be an unbiased estimator of $ \beta$ if there were no measurement error $ U$. By the properties of the bivariate normal,
$\displaystyle E\widehat \gamma_1=\sigma_{ww}^{-1}\sigma_{xx}=\beta_1(\sigma_{xx}+\sigma_{uu})^{-1} \sigma_{xx}.$     (3.5)

The least squares regression coefficient is biased towards zero because of the disturbance of the measurement error $ U$; the measurement error attenuates the regression coefficient. The ratio $ k_{ww} ={\sigma_{xx}}/{(\sigma_{xx}+\sigma_{uu})}$, which defines the degree of attenuation, is called the reliability of $ W$, or the reliability ratio. As pointed out above, ignoring measurement error leads to the least squares slope as an estimator of $ \beta k_{ww}$, not of $ \beta$.

In this section, we consider several estimators for the linear eiv models. These estimators have different forms based on the corresponding assumption on the variances. A complete account is given in Fuller (1987).

Assume that the degree of attenuation $ k_{ww}$ is known. In this case, the estimators of $ \beta$ and $ \alpha$ are defined as $ \widehat \beta=k_{ww}^{-1}
\widehat \gamma_1$ and $ \widehat \alpha=\overline Y-\widehat \beta\overline W$. Moreover, their variances are estimated by


$\displaystyle \widehat {\textrm{var}}(\widehat \beta)=n^{-1}S_{vv}\left\{\sum_{i=1}^n(W_i-\overline W)^2\right\}^{-1}S_l^2$      

and


$\displaystyle \widehat {\textrm{var}}(\widehat \alpha)=n^{-1}S_{vv}+\overline W^2\widehat {\textrm{var}}(\widehat \beta),$      

where $ S_l^2=(n-2)^{-1}\sum_{i=1}^n\{Y_i-\overline Y-\widehat \gamma_1(W_i-\overline W)\}^2$ and $ S_{vv}=(n-2)^{-1}\sum_{i=1}^n(Y_i-\widehat \alpha-\widehat \beta W_i)^2.$ Incidentally, the estimators of $ \alpha$ and $ \textrm{var}(\widehat \alpha)$ always have the same forms, whatever the estimators of $ \beta$ and $ \textrm{var}(\widehat \beta)$.

The quantlet 5620 eivknownatt evaluates the moment estimates of the parameters $ \mu_x, \beta, \alpha, \sigma_{xx}$, $ \sigma_{uu}$, $ \textrm{var}(\widehat \alpha)$ and $ \textrm{var}(\widehat \beta)$. Its syntax is the following:

  gest = eivknownatt(w,y,kww)

where

w
the observed regressors,
y
the response,
kww
the degree of attenuation.

This quantlet returns a list gest, which contains the followings estimates:

gest.mux
estimate of the mean of $ X$,
gest.beta1
$ \widehat \beta$,
gest.beta0
$ \widehat \alpha$,
gest.sigmax
estimate of the variance of $ X$,
gest.sigmau
estimate of the variance of $ U$,
gest.sigmae
estimate of the variance of $ \varepsilon $,
gest.varbeta1
the estimate of the variance of $ \widehat \beta$,
gest.varbeta0
the estimate of the variance of $ \widehat \alpha$.

We consider the following example, based on simulated data, in which the distribution of the measurement error $ U$ is normal with mean 0 and standard deviation $ 0.9$, the latent variable $ X$ having the same distribution, so that the reliability ratio equals $ k_{ww}= 0.5.$

  library("eiv")

  n = 100
  randomize(n)
  x=0.9*normal(n)           ; latent variables
  w=x+0.9*normal(n)         ; manifest variables
  y=0.9+0.8*x+0.01*normal(n)
  kww =0.5                  ; reliability ratio

  gest=eivknownatt(w,y,kww)

  gest.mux        ; the estimate of the mean of x  
  gest.beta1      ; the estimate of b (true value is 0.8)      
  gest.beta0      ; the estimate of a (true value is 0.9)                      
  gest.sigmax     ; the estimate of the variance of x   
  gest.sigmau     ; the estimate of the variance of u
  gest.sigmae     ; the estimate of the variance of e
  gest.varbeta1   ; the estimate of the variance of 
                  ;                       the estimate of beta1
  gest.verbeta0   ; the estimate of the variance of 
                  ;                       the estimate of beta0
5626 XAGeiv01.xpl

The parameter estimates are the following:

  gest.mux=-0.093396
  gest.beta1=0.79286
  gest.beta0=0.8425
  gest.sigmax=0.72585
  gest.sigmau=0.72585
  gest.sigmae=0.074451
  gest.varbeta1=0.0085078
  gest.varbeta0=0.0054358

The true values are $ \mu_{x0}=0$, $ \beta_{0}=0.8$, $ \alpha_{0}=0.9$, $ \sigma_{u0}=0.81$ and $ \sigma_{e0}=0.81$.

Assume that the ratio of two variances of the two measurement errors, $ k_{ww}=\sigma_{uu}^{-1}\sigma_{ee}$, is known. Then the estimators of the parameters of the most interest are defined as


$\displaystyle \widehat \beta=\frac{m_{yy}-\delta m_{ww}+\{(m_{yy}-\delta m_{ww})^2+4\delta m_{wy}^2\}^{1/2}}
{2m_{wy}}$      

and


$\displaystyle \widehat {\textrm{var}}(\widehat \beta)=(n-1)^{-1}\widehat \sigma...
...\widehat \sigma_{ww}S_{vv}+
\widehat \sigma_{uu}S_{vv}-\widehat \sigma_{uv}^2),$      

where $ \widehat \sigma_{ww}=m_{wy}\widehat \beta$, $ \widehat \sigma_{uu}=m_{ww}-\widehat \sigma_{ww}$, $ \widehat \sigma_{uv}=-\widehat \beta\widehat \sigma_{uu}$, $ S_{vv}=(n-2)^{-1}\sum_{i=1}^n\{Y_i-\overline Y-\widehat \beta (W_i-\overline W)\}^2.$

The quantlet 5636 eivknownratue estimates the parameters in this situation. Its syntax is similar to that of the quantlet 5639 eivknownatt :

 gest = eivknownratue(w,y,delta)

where delta is the ratio of the two variances.

For the purpose of illustration, we use the data which Fuller (1987) originally analyzed. The variables $ Y$ and $ W$ are the numbers of hen pheasants in Iowa at August and spring in the period from 1962 to 1976. Both measurement are subjected to the measurement errors. The ratio of $ \sigma_{ee}$ to $ \sigma_{uu}$ is supposed to be $ 1/6$. We use the following XploRe code:

  v=read("pheasants.dat")
  n=rows(v)
  y=v[,2]
  x=v[,3]
  delta=1/6

The data set is available in XploRe . Running

  library("eiv")
  gest=eivknownratue(x,y,delta)
5651 XAGeiv02.xpl

we obtain the estimates of slope and intercept as $ 0.75158$ (s.e. $ 0.0962$) and $ 1.1158$ (s.e. $ 0.9794$).

Figure 3.1: Pheasant data and estimated structural lines
\includegraphics[scale=0.6]{eivknownratuetu}

In Figure 3.1, the empty circles represents the observation data, the solid line is based on the ordinary least squares estimator, and the dashed line is the fit based on the moment estimator. Even in this small-sample data set, different conclusions are obvious if we are ignoring the measurement errors.

When the variance of measurement error $ \sigma_{uu}$ is known, we define the estimators of $ \beta$ and the variance of this estimator as


$\displaystyle \widehat \beta=(m_{ww}-\sigma_{uu})^{-1}m_{wy}$     (3.6)

and


$\displaystyle \widehat {\textrm{var}}(\widehat \beta)=(n-1)^{-1}\widehat \sigma_{ww}^{-2}(m_{ww}S_{vv}+
\widehat \beta^2\sigma_{uu}^2),$      

where $ \widehat \sigma_{ww}=m_{ww}-\sigma_{uu}$ and $ S_{vv}=(n-2)^{-1}\sum_{i=1}^n\{Y_i-\overline Y-\widehat \beta (W_i-\overline W)\}^2.$

The quantlet 5662 eivknownvaru evaluates the moment estimates stated above. Its syntax is similar to that of the two previous quantlets:

  gest = eivknownvaru(w,y,sigmau)

where sigmau is the variance of the error $ U$.

We now use the quantlet 5665 eivknownvaru to analyze a real example from Fuller (1987). In this example, we study the relationship between the yield of corn ($ Y$) and soil nitrogen ($ X$), the latter of which cannot be measured exactly. The variance arising from these two variables has been estimated to be $ \sigma_{uu}=57$. We assume that $ \sigma_{uu}$ is known and compute the related estimates using the quantlet 5668 eivknownvaru . The ordinary least squares estimates are $ \widehat \beta_{LS}=0.34404$ and $ \widehat \alpha_{LS}=73.152$, ignoring the measurement errors. We use the XploRe code:

  z=read("corn.dat")
  n=rows(z)
  y=z[,1]
  x=z[,2:3]
  w=x[,2]
  sigmau=57
  gest=eivknownvaru(w,y,sigmau)
5676 XAGeiv03.xpl

The moment estimates from this example are $ \widehat \beta_{MM}=0.42316$ (s.e. 0.1745) and $ \widehat \alpha_{MM}=73.152$ (s.e. 12.542), $ \widehat \sigma_{xx}=247.85$ and $ \widehat \sigma_{ee}=43.29$. So, the reliability ratio is $ 247.85/{304.85}=0.81$. In Figure 3.2, the circles represent the observation data, the solid line is based on the ordinary least squares estimator, and the dashed line is the fit based on the moment estimator.

Figure 3.2: Output display for yields of corn
\includegraphics[scale=0.6]{eivknownvarutu}

Theoretical study and empirical evidence have shown that the method of moments estimator given in (3.6) performs poorly in small samples, since such ratios are typically biased estimators of the ratio of the expectations. For this reason, we consider the modification proposed by Fuller (1987) of this estimator. Define an estimator of $ \beta$ by

$\displaystyle \widetilde \beta=\{\widetilde H_{ww}+\omega(n-1)^{-1}\sigma_{uu}\}^{-1}m_{wy},$      

where $ \omega>0$ is a constant to be determined later, and
$\displaystyle \widetilde H_{ww}=\left\{\begin{array}{ll}
m_{ww}-\sigma_{uu} & \...
...sigma_{uu} & \textrm{ if } \widehat \lambda< 1+(n-1)^{-1}\\
\end{array}\right.$      

with $ \widehat \lambda$ being the root of
$\displaystyle \textrm{det}\{m_{(y,w)(y,w)}-\lambda\, \textrm{diag}(0,\sigma_{uu})\}=0.$      

This estimator has been shown to be almost unbiased for $ \beta$. Its variance is estimated by


$\displaystyle \widehat {\textrm{var}}(\widehat \beta)=(n-1)^{-1}\{\widetilde H_...
..._{ww}^{-2}
(\sigma_{uu}\widetilde \sigma_{vv}+\widetilde \beta^2\sigma_{uu}^2\}$      

where $ \widetilde \sigma_{vv}=(n-2)^{-1}(n-1)(m_{yy}-2\widetilde \beta m_{wy}+\widetilde \beta^2 m_{ww}).$ For detailed theoretical discussions see Section 2.5 of Fuller (1987).

The quantlet 5691 eivknownvarumod implements the calculating procedure.

  gest = eivknownvarumod(omega, w, y, sigmau)

Input parameters:

omega
scalar,
w
$ n \times 1 $ matrix, the design variables,
y
$ n \times 1 $ matrix, the response,
sigmau
the variance of measurement error.
Output of 5694 eivknownvarumod :
gest.mux
the mean value of $ X$,
gest.beta1
$ \widehat \beta$,
gest.beta0
$ \widehat \alpha$,
gest.sigmax
the estimate of the variance of $ X$,
gest.sigmae
the estimate of the variance of error $ \varepsilon $,
gest.varbeta1
the estimate of the variance of $ \widehat \beta$,
gest.varbeta0
the estimate of the variance of $ \widehat \alpha$.

We return to consider the data set ``corn'' and we use the following XploRe code.

  library("eiv")
  z=read("corn.dat")
  z=sort(z,3)
  n=rows(z)
  y=z[,1]
  x=z[,2:3]
  vv=inv(x'*x)*(x'*y)  
  w=x[,2]    
  sigmau=57  
  omega=2+2*inv(var(w))*sigmau     

  gest=eivknownvarumod(omega,w,y,sigmau)
5702 XAGeiv04.xpl

Calculating the different choices of omega, we obtain the following results. A comparison with the results shown by the quantlet 5707 eivknownvaru indicates that $ \widetilde \beta$ is the same as $ \widehat \beta_{MM}$ when omega takes 0.

omega $ \widehat \beta_{LS}$ $ \widetilde \beta$ $ \widehat {\textrm{var}}(\widetilde \beta)$
0 0.34404 0.42316 0.030445
1 0.34404 0.41365 0.030165
2 0.34404 0.40455 0.029927
$ 2+2m_{ww}^{-1}\sigma_{uu}$ 0.34404 0.40125 0.029847
5 0.34404 0.37952 0.029419
10 0.34404 0.34404 0.029072

The estimates $ \widetilde \beta$ and $ \widehat {\textrm{var}}(\widetilde \beta)$ decrease with omega, and $ \widetilde \beta$ is equivalent to $ \widehat \beta_{LS}$ when omega$ =10$. The linear fitting for omega $ =2+2m_{ww}^{-1}\sigma_{uu}$ is shown in Figure 3.3.

Figure 3.3: Output display for yields of corn
\includegraphics[scale=0.6]{eivknownvarumodtu}

In this paragraph, we assume that we can observe a third variable $ Z$ which is correlated with $ X$. The variable $ Z$ is called as an instrumental variable for $ X$ if

    $\displaystyle E\left\{n^{-1}\sum_{i=1}^n(Z_i-\overline Z)(\varepsilon _i, U_i)\right\}=(0, 0),$  
    $\displaystyle E\left\{n^{-1}\sum_{i=1}^n(Z_i-\overline Z)X_i\right\}\neq 0.$  

Although we do not assume that $ k_{ww}$ and $ \sigma_{eu}$ are known or that $ \sigma_{xu}$ is zero, we can still estimate $ \alpha$ and $ \beta$ by the method of moments as follows: Let $ \widehat \beta=m_{wz}^{-1}m_{yz}$ and $ \widehat \alpha=\overline Y-\widehat \beta\overline W$, where $ m_{yz}=(n-1)^{-1}\sum_{i=1}^n(Y_i-\overline Y)(Z_i-\overline Z)$ and $ m_{wz}=(n-1)^{-1}\sum_{i=1}^n(W_i-\overline W)(Z_i-\overline Z)$. Furthermore, we estimate the variances of the approximate distributions of $ \widehat \beta$ and $ \widehat \alpha$ by

$\displaystyle \widehat {\textrm{var}}(\widehat \beta)=(n-1)^{-1}m_{wz}^{-2}m_{z...
...dehat \alpha)=n^{-1}S_{vv}+\overline W^2\widehat {\textrm{var}}(\widehat \beta)$      

with $ S_{vv}=(n-2)^{-1}\sum_{i=1}^n\{Y_i-\overline Y-\widehat \beta (W_i-\overline W)\}^2.$

The quantlet 5720 eivlinearinstr accomplishes the implementation. Its syntax is the following:

  gest = eivlinearinstr(w,z,y)

The estimates of $ \alpha$ and $ \beta$ are returned in the list gest

gest.beta1
the estimate of $ \beta$,
gest.beta0
the estimate of $ \alpha$.

Before ending this section, we use the quantlet 5723 eivlinearinstr to study a practical data-set, in which we study Alaskan earthquakes for the period from 1969-1978. The data are from Fuller (1987). In the data structure, we have the logarithm of the seismogram amplitude of 20 second surface waves, denoted by y, the logarithm of the seismogram amplitude of longitudinal body waves, denoted by w and the logarithm of maximum seismogram trace amplitude at short distance, denoted by z.

  library("eiv")        
  v=read("alaskan.dat") 
  y=v[,2]               
  w=v[,3]               
  z=v[,4]       

  gest=eivlinearinstr(w,z,y)

5727 XAGeiv05.xpl

The estimates are

  gest.beta0=-4.2829 (s.e.1.1137)
  gest.beta1=1.796   (s.e.0.2131)

Figure 3.4: Output display for Alaskan earthquakes
\includegraphics[scale=0.6]{eivlinearinstrtu}

Figure 3.4 shows the fitted results, in which the circles represent the data y, the solid line is based on the above estimates, and the dashed line contains the estimated values based on the regression of y on w. This means that if we ignore the measurement errors, then it shows an obvious difference.


3.1.2 Vector of Explanatory Variables

Suppose that $ X$ is a $ p$-dimensional row vector with $ p > 1$, $ \beta$ is a $ p$-dimensional column vector, and the $ (1+p)$-dimensional vectors $ e=(\varepsilon , U)^T$ are independently normal $ N(0, \Sigma_{ee})$ random vectors.

Assume that the covariance between $ \varepsilon $ and $ U$, $ \Sigma_{\varepsilon u}$ and the covariance matrix of $ U$, $ \Sigma_{uu}$ are known. Then the other parameters, such as $ \beta$, $ \alpha$ and others, are estimated by

$\displaystyle \widehat \beta$ $\displaystyle =$ $\displaystyle (m_{ww}-\Sigma_{uu})^{-1}(m_{wy}-\Sigma_{\varepsilon u}),$  
$\displaystyle \widehat \alpha$ $\displaystyle =$ $\displaystyle \overline Y-\overline W\widehat \beta,$  
$\displaystyle \widehat \sigma_\varepsilon$ $\displaystyle =$ $\displaystyle m_{yy}-2m_{wy}\widehat \beta+\widehat \beta^Tm_{ww}\widehat \beta+2\Sigma_{\varepsilon u}\widehat \beta
-\widehat \beta^T\Sigma_{uu}\widehat \beta$  

and $ \widehat \Sigma_{xx}=m_{ww}-\Sigma_{uu}$, provided $ \widehat \Sigma_{xx}$ is positive definite and $ \widehat \sigma_\varepsilon \ge\Sigma_{\varepsilon u}\Sigma_{uu}^+\Sigma_{u\varepsilon },$ where $ \Sigma_{uu}^+$ denotes the generalized inverse of $ \Sigma_{uu}$. If either of these conditions is violated, the estimators fall on the boundary of the parameter space, and the above forms must be modified. For a detailed discussion, see Section 2.2 of Fuller (1987).

The quantlet 6331 eivvec1 evaluates these estimates. Its syntax is the following:

  gest = eivvec1(w, y, sigue, siguu)

The estimates are listed in the variable gest as follows:

gest.mux
scalar, the estimate of the mean of $ X$,
gest.hatbeta0
scalar, the estimate of $ \alpha$,
gest.hatbeta1
vector, the estimate of $ \beta$,
gest.hatsigmax
$ p \times p$ matrix, the estimate of the covariance of $ X$,
gest.hatsigae
scalar, the estimate of the variance of $ \varepsilon $.
We calculate a simulated data set with the quantlet 6334 eivvec1 as follows:

  library("xplore")
  library("eiv")

  n = 100
  randomize(n)
  nu =#(2,3,4)
  sig=0*matrix(3,3)
  sig[,1]=#(0.25, 0.9, 0.1)
  sig[,2]=#(0.9, 1, 0.2)
  sig[,3]=#(0.1, 0.2, 4)
  x=normal(n,3)*sig+nu'
  w=x+0.01*normal(n,3)
  a1=#(1.2, 1.3, 1.4)
  y=0.75+x*a1+0.09*normal(n)
  sigue=#(0.11, 0.09, 045)
  siguu=0*matrix(3,3)
  siguu[,1]=#(1.25, 0.009, 0.01)
  siguu[,2]=#(0.009,0.081, 0.02)
  siguu[,3]=#(0.01, 0.02, 1.96)

  gest=eivvec1(w,y,sigue,siguu)
6338 XAGeiv06.xpl

The estimates are: $ \mu_x=(2.024, 2.9106, 3.9382)^T$, $ \widehat \beta=(0.011384, 0.013461, 0.013913)^T$, $ \widehat \beta_0=12.362$, $ \widehat \sigma_{ee}=1034.9$, $ \widehat \Sigma_{xx}=\left(\begin{array}{lll}
0.84466, &1.0319, &0.43677\\
1.0319, &1.664, &1.0941\\
0.43677, &1.0941, &19.781\\
\end{array}\right)$.

In this paragraph, our aim is to estimate the parameters in $ p$-dimensional measurement error models when the entire error covariance structure is either known, or known up to a multiple scalar. Assume that the errors $ (U,\varepsilon )$ obey normal distribution with mean zero vector and covariance $ cov(U,\varepsilon )$, which can be represented as $ \Gamma_{(u,\varepsilon )(u,\varepsilon )}\sigma^2$, where $ \Gamma_{(u,\varepsilon )(u,\varepsilon )}$ is known. Then the maximum likelihood estimators of $ \beta$ and $ \sigma^2$ are

$\displaystyle \widehat \beta$ $\displaystyle =$ $\displaystyle (m_{ww}-\widehat \lambda\Gamma_{uu})^{-1}(m_{wy}-\widehat \lambda\
\Gamma_{\varepsilon u}),$  
$\displaystyle \widehat \sigma_m^2$ $\displaystyle =$ $\displaystyle (p+1)^{-1}\widehat \lambda,$  

where $ \Gamma_{uu}$ and $ \Gamma_{\varepsilon u}$ are the submatrices of $ \Gamma_{(u,\varepsilon )(u,\varepsilon )}$, and $ \widehat \lambda$ is the smallest root of
$\displaystyle \vert m_{(y,w)(y,w)}-\lambda\Gamma_{(u,\varepsilon )(u,\varepsilon )}\vert=0.$      

The quantlet 6347 eivvec2 evaluates these likelihood estimators. This case is an extension of the case discussed in the context for the quantlet 6350 eivknownvaru . The theoretical details are given in Fuller (1987). The syntax of this quantlet is the following:

  gest = eivvec2(w, y, gamma)

where gamma is a known matrix. The following simulated example shows us how to run the quantlet 6353 eivvec2 .

  library("xplore")
  library("eiv")
  n=100
  randomize(n)
  sig=0*matrix(3,3)
  sig[,1]=#(0.25, 0.09, 0.1)
  sig[,2]=#(0.09, 1, 0.2)
  sig[,3]=#(0.1, 0.2, 0.4)
  x=sort(uniform(n,3)*sig)
  w=x+0.03*normal(n,3)
  beta0=#(0.5, 0.6, 0.7)
  y=x*beta0+0.05*normal(n)
  gamma=(#(0.03,0,0,0))'|(#(0,0,0)~0.05*unit(3))
  gest=eivvec2(w,y,gamma)
6357 XAGeiv07.xpl

The estimates are the following:

  gest.hatbeta=(0.18541, 0.0051575,-0.088003)
  gest.sigmam=0.015424

Consider the method of instrumental variables for the $ p$-dimensional case. Assume that the $ q-$dimensional vector of instrumental variables $ Z$ is available and that $ n>q\ge p$. In addition, assume that $ \sum_{i=1}^nZ_i^TZ_i$ is nonsingular with probability one, $ E\{Z_i^T(\varepsilon _i, U_i)\}=(0,0),$ and the rank of $ \left(\sum_{i=1}^nZ_i^TZ_i\right)^{-1}\sum_{i=1}^nZ_i^TW_i$ is $ q$ with probability one. When $ q=p$, we define the estimator of $ \beta$ as

$\displaystyle \widehat \beta=({Z}^T{W})^{-1}({Z}^T{Y}).$      

Otherwise, write
$\displaystyle S_{aa}=(n-q)^{-1}\{({Y}, {W})^T({Y},{W})-
({Y}, {W})^T{Z}({Z}^T{Z})^{-1}{Z}^T
({Y},{W})\}$      

and define the estimator as
$\displaystyle \widehat \beta=({ W}^T{W}-\widetilde \gamma S_{aa22})^{-1}
({W}^T{Y}-\widetilde \gamma S_{aa21}),$      

where $ S_{aa21}$ and $ S_{aa22}$ are the submatrices of $ S_{aa}$, and $ \widetilde \gamma$ is the smallest root of
$\displaystyle \vert({Y}, {W})^T({Y}, {W})-\gamma S_{aa}\vert=0.$      

Its statistical inferences refer to Section 2.4 of Fuller (1987).

The quantlet 6370 eivlinearinstrvec achieves the calculation procedure in XploRe . This generalizes the quantlet 6377 eivlinearinstr to the $ p$-dimensional case.

  gest =eivlinearinstrvec(w,z,y)

We end this section with an example, in which we randomly produce variables $ w$, instrumental variables $ z$, and response $ y$. Then we execute the quantlet 6380 eivlinearinstrvec and get the estimates.

  library("xplore")
  library("eiv")
  n=100
  randomize(n)
  w=floor(6*uniform(n,3)+#(4,5,5)')
  z=floor(8*uniform(n,4)+#(3,3,2,2)')
  y=floor(9*uniform(n)+2)
  gest=eivlinearinstrvec(w,z,y)
6384 XAGeiv08.xpl

The estimate of the parameter vector is

  gest=(0.19413, 0.24876, 0.37562)