class PearsonsCorrelation {

    public RealMatrix getCorrelationPValues() {
        TDistribution tDistribution = new TDistribution(nObs - 2);
        int nVars = correlationMatrix.getColumnDimension();
        double[][] out = new double[nVars][nVars];
        for (int i = 0; i < nVars; i++) {
            for (int j = 0; j < nVars; j++) {
                if (i == j) {
                    out[i][j] = 0d;
                } else {
                    double r = correlationMatrix.getEntry(i, j);
                    double t = FastMath.abs(r * FastMath.sqrt((nObs - 2)/(1 - r * r)));
                    out[i][j] = 2 * tDistribution.cumulativeProbability(-t);
                }
            }
        }
        return new BlockRealMatrix(out);
    }

    public  PearsonsCorrelation();
    public  PearsonsCorrelation(double[][] data);
    public  PearsonsCorrelation(RealMatrix matrix);
    public  PearsonsCorrelation(Covariance covariance);
    public  PearsonsCorrelation(RealMatrix covarianceMatrix, int numberOfObservations);

}