/* ** CPE Disequilibrium Econometric Model: MAXLIK Estimation ** R. Portes and D. Winter, "Disequilibrium Estimates for Consumption ** Goods Markets in Centrally Planned Economies," Review of Economic ** Studies, 1980, 137-159. ** Discrete Switch Regression Approach ** Data from Burkett [1988]; The results may not duplicate */ use gpe2; @ Poland Data: 1954 to 1980 (usable from 1956) @ n=23; @ P&W study period: 1954-1975 @ load x[n,8]=course\poland.txt; year=x[2:n,1]; c=x[2:n,2]; @ consumption @ s1=x[2:n,3]; @ lagged savings @ dyd=x[2:n,4]; @ change in disposable income @ yd1=x[2:n,5]; @ lagged disposable income @ ct=x[2:n,6]; @ target consumption @ cyx=x[2:n,7]; @ CTZ @ mx1=x[2:n,8]; @ RNFA1: residual net financial assets of households @ @ deviation from trend, lagged @ z=c~s1~dyd~yd1~ct~cyx~lagn(cyx,1)~mx1; n=rows(z); year=year[3:n]; z=z[3:n,.]; @ estimation starts from 1956 @ @ since CZX is available from 1956 only @ @ the study period is not the same as P&W @ call reset; _nlopt=2; _method=5; _iter=500; _conv=1; _b={-0.5,1.0,1.0,1.0,1.0,0.5,0.5,1,5}; call estimate(&llf,z); b=__b; vb=__vb; /* Final Results */ cd=z[.,2:4]*b[1:3]; @ estimated demand @ cs=z[.,5:8]*b[4:7]; @ estimated supply @ scd=b[8]; @ s.e. of demand equation (re-scaled) @ scs=b[9]; @ s.e. of supply equation (re-scaled) @ xd=cd-cs; @ excess demand @ zxd=xd./sqrt(scd^2+scs^2); @ standarized excess demand @ print "\n YEAR Pr(XD) XD% XD/s.e.";; print year~cdfn(zxd)~(100*xd./z[.,1])~zxd; @ c=z[.,1] @ end; /* Switch Regression Method: Portes and Winter [1980] */ proc llf(x,b); local q,d,s,sd,ss,zd,zs,f; q=x[.,1]; @ observed quantity = min(d,s) @ d=x[.,2:4]*b[1:3]; @ demand equation @ s=x[.,5:8]*b[4:7]; @ supply equation @ sd=b[8]; @ s.e. of demand equation (re-scaled) @ ss=b[9]; @ s.e. of supply equation (re-scaled) @ zd=(q-d)./sd; zs=(q-s)./ss; f=(pdfn(zd)./sd).*cdfnc(zs)+(pdfn(zs)./ss).*cdfnc(zd); f=f.*(f.>0)+(0.0)*(f.<=0); retp(ln(f)); endp;