Update of /cvsroot/quantproject/QuantProject/b1_ADT/Statistics
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv30066/b1_ADT/Statistics
Modified Files:
BasicFunctions.cs
Log Message:
Some code has been added to test the method that computes the Pearson correlation coefficient
Index: BasicFunctions.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/Statistics/BasicFunctions.cs,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** BasicFunctions.cs 27 Feb 2008 22:26:44 -0000 1.10
--- BasicFunctions.cs 6 Mar 2008 20:13:49 -0000 1.11
***************
*** 321,324 ****
--- 321,333 ----
currentValueFromSecondDataSet * currentValueFromSecondDataSet;
}
+ double n1 = n*sumOfProduct;
+ double n2 = sumOfFirst*sumOfSecond;
+ double numerator = n*sumOfProduct - sumOfFirst*sumOfSecond;
+ double d1 = n*sumOfSquaredFirst;
+ double d2 = sumOfFirst*sumOfFirst;
+ double d3 = n*sumOfSquaredSecond;
+ double d4 = sumOfSecond*sumOfSecond;
+ double d5 = d1 - d2;
+ double d6 = d3 - d4;
return (n*sumOfProduct - sumOfFirst*sumOfSecond)/
Math.Sqrt( (n*sumOfSquaredFirst - sumOfFirst*sumOfFirst)*
|