Change the formula for empirical autocorrelations, so that the result always lies in [-1,1] (thanks to Johannes Pfeifer for pointing this)

time-shift
Sébastien Villemot 2011-01-12 11:23:44 +01:00
parent 17bc655159
commit 9e38d85053
1 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
function disp_moments(y,var_list)
% Displays moments of simulated variables
% Copyright (C) 2001-2010 Dynare Team
% Copyright (C) 2001-2011 Dynare Team
%
% This file is part of Dynare.
%
@ -84,7 +84,7 @@ ar = options_.ar;
if ar > 0
autocorr = [];
for i=1:ar
oo_.autocorr{i} = y(ar+1:end,:)'*y(ar+1-i:end-i,:)./((size(y,1)-ar)*s'*s);
oo_.autocorr{i} = y(ar+1:end,:)'*y(ar+1-i:end-i,:)./((size(y,1)-ar)*std(y(ar+1:end,:))'*std(y(ar+1-i:end-i,:)));
autocorr = [ autocorr diag(oo_.autocorr{i}) ];
end
title = 'AUTOCORRELATION OF SIMULATED VARIABLES';