Article From: Department of Economics Subject: LGMMHET.SET Posted by: Information Provider Phone Number: (202) 885-3770 E-Mail Address: econ@american.edu Post Date: 28 Sep 1994 Expiration Date: 28 Oct 2004 LGMMHET.SET (Ogaki) /* FILE LGMMHET.SET revised 8/6/91 CONDITIONAL HETEROSCEDASTICITY CASE L*m*tend must be less than 8190. L>=K shoud hold to be identified. Syntax: b=lgmmhet(y,xp,zp,tend,ru,zero,maxiter,rm,rv); y=|y(1) | y=m*tend by 1 matrix. | | | y(t) mx1 matrix, t=1,..,tend. |y(tend)| xp=|x(1)' | xp=m*tend by k matrix. |x(2)' | x(t) kxm matrix, t=1,..,tend. | | | |x(tend)'| zp=|z(1)' | zp=m*tend by L matrix. |z(2)' | z(t) Lxm matrix, t=1,..,tend. | | | |z(tend)'| tend,k,m,l,r scalars Model: y(t)=x(t)'b+u(t) E[u(t)|I(t)]=0 z(t) is in I(t). u(t) is in I(t+r+1). This Program Calculate and Iterate: initial condition w=I, 1. sigmazy=1/tend*(sum t=1,tend{z(t)y(t)}) sigmazx=1/tend*(sum t=1,tend{z(t)x(t)'}) b=inv(sigmazx'*w*sigmazx)*sigmazx'w*sigmazy (unrestrictted) u(t)=y(t)-x(t)'b Appropriate elements of Rzu(j) will be replaced by zeros. Rzu(j)=1/tend*(sum t=j+1,tend{z(t)u(t)u(t-j)z(t-j)'} j=0,1,..,ru w1=Rzu(0)+{Rzu(1)+Rzu(1)'}+,..,+{Rzu(r)+Rzu(r)'} w=inv(w1) go back to 1. */ PROC LGMMHET(y,xp,zp,tend,ru,zero,maxiter); local sigmazy,sigmazx,differ,iter,u,v,se,g,prob,t,ruj,rzuj,vt,ut, zpt,zptj,w,j,i,vtj,utj,df,chi,w0,b, varbu,zxw,tstr,rpri,rbur,k,l,m; clear chi; k=cols(xp); L=cols(zp); m=round(rows(y)/tend); sigmazy=zp'y/tend; sigmazx=zp'xp/tend; w0=eye(l); df=L-k; differ=10;iter=1; do until (differmaxiter); zxw=sigmazx'w0; v=invpd(zxw*sigmazx); b=v*zxw*sigmazy; u=y-xp*b; varbu=v/tend; save b; if iter==1; goto lab10; endif; g=zp'u/tend; if df>0; chi=tend*(g'w0*g); prob=cdfchic(chi,df);endif; ? "********************* ITERATION=" iter "********************"; ? " b=" b'; ? " s.e.=" sqrt(diag(varbu))'; if df>0; ? " chi square for overidentifying restrictions="; chi "(" prob ")"; elseif df==0;? " Just Identified"; else;? " L