Library: | eiv |
See also: | eivvec2 |
Quantlet: | eivvec1 | |
Description: | eivvect1 presents the maximum likelihood estimators of the parameters in the measurement error models, which has more than one variable x. The covariances between e and u, Sigeu and the covariance matrix of u, siguu are known. All of the variables obey normal distributions. All parameters are estimated by maximum likelihood method in measurement error models. |
Usage: | {mux,hatbeta,beta0,hatsigmae,hatsigmax)=eivvec1(w,y,sigue,siguu) | |
Input: | ||
w | n x p matrix, the design variables | |
y | n x 1 matrix, the response | |
sigue | p x 1 matrix, the vector of covariances between u and e | |
siguu | p x p matrix, the covariance matrix of U | |
Output: | ||
mux | scalar, the mean value of x | |
hatbeta1 | vector, the estimate | |
hatbeta0 | scalar, the estimate | |
hatsigmax | p x p matrix, the estimate of the covariance matrix of x | |
hatsigmae | scalar, the estimate of the variance of error e |
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) gest.mux gest.hatbeta gest.beta0 gest.hatsigmax gest.hatsigmae
Contents of mux [1,] 2.024 2.9106 3.9382 Contents of hatbeta [1,] 0.011384 [2,] 0.013461 [3,] 0.013913 Contents of beta0 [1,] 12.362 Contents of hatsigmax [1,] 0.84466 1.0319 0.43677 [2,] 1.0319 1.664 1.0941 [3,] 0.43677 1.0941 19.781 Contents of hatsigmae [1,] 1034.9