Library: | eiv |
See also: | eivvec2 |
Macro: | 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, Sigu are known. All of the variables obey normal distributions. All parameters are estimated by maximum likelihood method in measurement error models, see Fuller W. A. "Measurement Error Models", Wiley and Sons 1987, section 2.2. |
Usage: | {mux,hatbeta,beta0,hatsigmae,hatsigmax)=eivvec1(X,Y,Sigue,Sigu) | |
Input: | ||
X | 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 | |
Sigu | 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("eiv") library("xplore") 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' X =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) Sigu=0*matrix(3,3) Sigu[,1]=#(1.25, 0.009, 0.01) Sigu[,2]=#(0.009,0.081, 0.02) Sigu[,3]=#(0.01, 0.02, 1.96) gest=eivvec1(X,Y,Sigue,Sigu) gest.mux gest.hatbeta gest.beta0 gest.hatsigmax gest.hatsigmae
gest.mux=(2.024, 2.9106, 3.9382) gest.hatbeta=(1.1387, 1.3217, 1.3852) gest.beta0=0.87062 gest.hatsigmax=(0.84466, 1.0319, 0.43677 1.0319, 1.664, 1.0941 0.43677, 1.0941, 19.781) gest.hatsigmae=1034.9
Library: | eiv |
See also: | eivvec2 |