function acf = acfplot(z)
% ACFPLOT(z) computes sample ACF and
% produces Splus-style plot of ACF
% complete with white noise bars
% z should be a column vector
n=length(z);
w=2/sqrt(n);
acvf=autocov(z);
na=length(acvf)-1;
acf=acvf/acvf(1);
plot(0:na,acf,'o')
hold on
plot([0 na] , [0 0], 'r')
plot([0 na] , [w w], 'c--')
plot([0 na] , [-w -w], 'c--')
for i=0:na
   plot([i i],[0 acf(i+1)])
end
hold off
