Documentation of get_dof


Global Index (all files) (short | long) | Local Index (files in subdir) (short | long)


Function Synopsis

dofx = dof(data);

Help text


  dofx = dof(data);


Cross-Reference Information

This function calls

Listing of function get_dof

function dofx = dof(data);

[m, n] = size(data);

if m == 1; data = data'; [m, n] = size(data); end;

%  The following calculates the one lag autocorrelation, based
%  on the one lag, and two-lag autocorrelations (the sqrt of the
%  two lag autocorrelation is used to 'improve' the estimate).

for i = 1:n;
  acorr(i) = (corr(data(:,i), data(:,i), 1) + ...
              sqrt(corr(data(:,i), data(:,i), 2))) ./ 2;
end

dofx = -0.5 * m * log(abs(real(acorr)));

for i = 1:n;
  dofx(i) = min([m dofx(i)]);
end