new; library pgraph; format /m1 /rd 9,6; /* Load Data */ load data[205,2]=arima212.dta; mu=0.815603; phi1=1.341846; phi2=-0.705894; theta1=-1.054277; theta2=0.518756; x_mat=zeros(205,4); x_mat[.,1]=data[1:205,1]-mu; x_mat[.,2]=0|data[1:204,1]-mu; x_mat[.,3]=data[1:205,2]; x_mat[.,4]=0|data[1:204,2]; F=phi1~phi2~theta1~theta2| 1~0~0~0| 0~0~0~0| 0~0~1~0; BN=(-F*inv(eye(4)-F)*x_mat')'; output file=c:\bn.dta reset; BN[.,1]; output off; xlabel("month"); xindex=seqa(1,1,rows(BN)); begwind; title("Cycle"); xy(xindex, BN[.,1]); endwind; end;