Home > bobstuff > veccor.m

veccor

PURPOSE ^

VECCOR computes the vector correlation coefficient.

SYNOPSIS ^

function r=veccor(u1,v1,u2,v2)

DESCRIPTION ^

 VECCOR computes the vector correlation coefficient.

 r=VECCOR(u1,v1,u2,v2) computes the vector correlation coefficient 
 squared between two vector time series following Crosby et al 
 (1993), JAOT, 355-367. Assumes ui,vi are signle vectors.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 ver. 1: 12/1/96 (RB)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001    function r=veccor(u1,v1,u2,v2)
0002 
0003 % VECCOR computes the vector correlation coefficient.
0004 %
0005 % r=VECCOR(u1,v1,u2,v2) computes the vector correlation coefficient
0006 % squared between two vector time series following Crosby et al
0007 % (1993), JAOT, 355-367. Assumes ui,vi are signle vectors.
0008 %
0009 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0010 % ver. 1: 12/1/96 (RB)
0011 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0012 
0013 f1=cv(u1,u1).*(cv(u2,u2).*cv(v1,v2).^2 + cv(v2,v2).*cv(v1,u2).^2);
0014 f2=cv(v1,v1).*(cv(u2,u2).*cv(u1,v2).^2+cv(v2,v2).*cv(u1,u2).^2);
0015 f3=2.*cv(u1,v1).*cv(u1,v2).*cv(v1,u2).*cv(u2,v2);
0016 f4=2.*cv(u1,v1).*cv(u1,u2).*cv(v1,v2).*cv(u2,v2);
0017 f5=-2.*cv(u1,u1).*cv(v1,u2).*cv(v1,v2).*cv(u2,v2);
0018 f6=-2.*cv(u1,u1).*cv(v1,u2).*cv(v1,v2).*cv(u2,v2);
0019 f7=-2.*cv(v1,v1).*cv(u1,u2).*cv(u1,v2).*cv(u2,v2);
0020 f8=-2.*cv(u2,u2).*cv(u1,v1).*cv(u1,v2).*cv(v1,v2);
0021 f9=-2.*cv(v2,v2).*cv(u1,v1).*cv(u1,u2).*cv(v1,u2);
0022 
0023 g1=cv(u1,u1).*cv(v1,v1)-cv(u1,v1).^2;
0024 g2=cv(u2,u2).*cv(v2,v2)-cv(u2,v2).^2;
0025 
0026 r=(f1+f2+f3+f4+f5+f6+f7+f8+f9)./(g1.*g2);
0027 
0028 end

Generated on Thu 01-Dec-2005 07:46:03 by m2html © 2003