commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Rosellen <Martin.Rosel...@fu-berlin.de>
Subject [math] Pearson Correaltion NaNs
Date Tue, 06 Nov 2012 09:14:20 GMT
Dear all,

I am having difficulties using the Pearson Correlation because it seems 
that it does not work if some cell is NaN. Is that intended? Here is 
some code:

public static void main(String[] args) {
         double [] row1 = new double[]{3,4};
         double [] row2 = new double[]{1,8};
         double [] row3 = new double[]{Double.NaN,4};
         double[][] data = new double[][]{row1,row2,row3};
         System.out.println(Arrays.deepToString(data));

         PearsonsCorrelation coefMatrixP = new PearsonsCorrelation(data);

System.out.println(coefMatrixP.getCorrelationMatrix().toString());
     }

Greetings
Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message