/* This program plots the ACF and PACF for an AR(1) process. Phi1 is the first-order autoregressive coefficient. In order for the model to be stationary, -1 < phi1 < 1. */ data a; phi1=0.8; /* Here is where you can choose the value of phi1. */ do lag = 1 to 30; rho=phi1**lag; if lag = 1 then phijj=phi1**lag; else phijj=0; output; end; run; symbol interpol=needle cv=blue ci=black value=dot height=1 width=1; proc gplot data=a; title1 'Theoretical ACF for AR(1) Process'; title2 'with phi1 = 0.8'; plot rho*lag; run; title1 'Theoretical PACF for AR(1) Process'; title2 'with phi1 = 0.8'; plot phijj*lag; run;