%% Compare the ACF for Normalized and Unnormalized Series
% Although various estimates of the sample autocorrelation function exist, autocorr uses the form in Box, Jenkins, and Reinsel, 1994. In their estimate, they scale the correlation at each lag by the sample variance (var(y,1)) so that the autocorrelation at lag 0 is unity. However, certain applications require rescaling the normalized ACF by another factor.
% Simulate 1000 observations from the standard Gaussian distribution.

rng(1); % For reproducibility
y = randn(1000, 1);

%
% Compute the normalized and unnormalized sample ACF.

[normalizedACF, lags] = autocorr(y,'NumLags',10);
unnormalizedACF = normalizedACF*var(y,1);

%
% Compare the first 10 lags of the sample ACF with and without normalization.

[lags  normalizedACF  unnormalizedACF]

% Copyright 2015 The MathWorks, Inc.