/* ** Autocorrelated Regression Models: ** Nonlinear Maximum Likelikood Estimation ** AR(1), MA(1), ARMA(1,1) ** Greene [1999], Chap. 13 */ use gpe2; n=21; load data[n,5]=tsinghua\usinv.txt; rinv=data[2:n,3]./data[2:n,4]; @ real investment @ rgnp=data[2:n,2]./data[2:n,4]; @ real GNP @ rate=data[2:n,5]- @ real interest rate @ 100*(data[2:n,4]-lagn(data[2:n,4],1))./lagn(data[2:n,4],1); data=packr(rinv~rate~rgnp); data=data~ones(rows(data),1); /* data matrix is arranged with the dependent variable in the first column, followed by colums of independent variables including constant */ @ OLS estimates as Table 13.2 of Greene [1999] @ b=data[.,1]/data[.,2:4]; call reset; _nlopt=1; _method=3; _iter=100; /* _fdiff=0.5; */ _arma={1,0}; call armaest(data[.,1],data[.,2:4],b); end; #include gpe\arma.gpe;