echo on p=2; q=2; n=500; sigma2=2.25; sigma=sqrt(sigma2); PHI = [0.5,0.2]; THETA = -[0.5,0.2]; [x,phir,thetar]=armagen(PHI,THETA,n,sigma); phir, thetar [xro,xroE,mi,miE,xacf]=acf(x,figure); [xpacf,phi,phiE,v]=pacf(xacf(1:p+1),n,figure); v xs=conv(x,[0;phi]); xs=xs(1:n); length(xs) % figure; plot(1:n,x,'w',1:n,xs,'y--'); ve=std(xs-x).^2 echo off