Documentation of vectsig


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


Function Synopsis

[fval, dof1, dof2] = vectsig(c1, c2);

Help text


   [fval, dof1, dof2] = vectsig(c1, c2);

   This function returns the F-score (see Tatsuoka, Multivariate
   Analysis, 1988, pp 85 - 88).  These can be compared using the
   tables in the back of the above mentioned book.  Notice that
   c1 and c2 are complex matrices formed like:

        c1 = u1 + j*v1

   where j = sqrt(-1)

   c1 and c2 need not have the same number of time realizations 
   (columns), but need to have the same number of spatial real-
   izations (rows)

   Note that dof1 refers to the degrees of freedom in the denominator,
   while dof2 refers to the degrees of freedom in the numerator, 
   when obtaining the F-value.

   e.g.:
   fsig = finv(0.95, dof2, dof1);


Cross-Reference Information

This function calls

Listing of function vectsig

function [fval, dof1, dof2] = vectsig(c1, c2);
[m1, n1] = size(c1);
[m2, n2] = size(c2);
if n1 ~= n2; error('ERROR - number of stations (rows) must be the same'); end;
n = n1;
dif_mean = mean2(c1) - mean2(c2);
c11 = c1 - ones(m1,1) * mean2(c1);
c22 = c2 - ones(m2,1) * mean2(c2);
for i = 1:n;
  s1 = [real(c11(:,i)) imag(c11(:,i))]' * [real(c11(:,i)) imag(c11(:,i))];
  s2 = [real(c22(:,i)) imag(c22(:,i))]' * [real(c22(:,i)) imag(c22(:,i))];
%
  w = s1 + s2;
%
%   Calculate the T statistic, ref. Tatsuoka, p. 86
%
  t(i) = [real(dif_mean(i)) imag(dif_mean(i))] * ...
         inv(w * ((m1 + m2) / (m1 * m2 * (m1 + m2 - 2)))) * ... 
         [real(dif_mean(i)) imag(dif_mean(i))]';
end
%
%   Calculate the F statistic, ref. Tatsuoka, p. 86
%

fval = ((m1 + m2 - 3) / (2 * (m1 + m2 - 2))) * t;
dof1 = m1 + m2 -3;
dof2 = 2;