performs D test of model comparaison for GMM
rd = gmmDtest(ugmm,rgmm,nr,np)
* ugmm = tlist result for unrestricted estimation
* rgmm = tlist result for restricted estimation
* nr = number of parameter restriction
* np = 'noprint' if the user does not want to print the results
* rd = a tlist with:
-rd('chistat') = test statisitc
-rd('pvalue') = pvalue of the test
-rd('df') = number of restrictions
X = [ones(1000,1) grand(1000,1,'nor',0,1) grand(1000,1,'nor',0,1)]; b = [0;1;-1]; e = grand(1000,1,'nor',0,1); y = X*b + e; gmmopt = tlist(['gmm';'momt';'jake';'prt';'gmmit';'S']); gmmopt('prt')=1; gmmopt('gmmit') = 1; gmmopt('S')='W'; gmmopt('momt')='gmmLinM'; gmmopt('jake')='gmmLinJ'; b0=zeros(3,1); uout=gmm('y',gmmopt,'exo=''X''','ivar=''X''','parm0=b0'); W0 = uout('W'); rout=gmm('y',gmmopt,'exo=''X(:,2:3)''','ivar=''X''','parm0=[0;0]','Win=W0','noprint'); rd = gmmDtest(uout,rout,1); // Examples taken from gmmLin_d() : the first parameter is set to 0 // and the model is reestimated with the prior weighting matrix, // then the test is performed. | ![]() | ![]() |