【Covariance_a】
[code]Inputs: IndArray[Xsize](NumericArrayRef), DepArray[Ysize](NumericArrayRef), ArraySize(Numeric);Variables: var0(0), var1(0), var2(0);
condition1 = MinList(Xsize, Ysize, ArraySize) > 0 ;
If condition1 Then Begin
var0 = Average_a(IndArray, ArraySize);
var1 = Average_a(DepArray, ArraySize);
var2 = 0;
For value1 = 1 To ArraySize Begin
var2 = var2 + (IndArray[value1] - var0) * (DepArray[value1] - var1);
End;
Covariance_a = var2 / ArraySize;
End
Else
Covariance_a = -1;
[/code]
页:
[1]