/* ** Fractional Differenced Error Process: ** Nonlinear Maximum Likelikood Estimation ** based on the example of 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; _rplot=2; _acf=8; _acf2=8; call estimate(data[.,1],data[.,2:3]); end; call reset; _rplot=2; _nlopt=1; @ maximum likelihood estimation @ _method=3; @ optimization method @ _iter=100; _fdiff=0.5; @ fractional difference @ call armaest(data[.,1],data[.,2:4],b); _bjtest=1; _bptest=1; _bgtest=4; _ebtest=5; _acf=8; _acf2=8; call diagnose(data[.,1],data[.,2:4],__e); end; #include gpe\arma.gpe; #include gpe\diagnose.gpe;