protected ArrayList<Float> calculateCorrelation(DataSet... params)
    {
        ArrayList<Float> correlations = new ArrayList<Float>();
        
        for (int i = 0; i < params.length - 1; i++)
        {
            for (int j = i + 1; j < params.length; j++)
            {
                featuresName.add("CORRELATION_" + params[i].getName() + "_" + 
                        params[j].getName());
                if (params[i].getStd() != null && params[j].getStd() != null)
                {
                    float covariance = calculateCovariance(params[i].getDataSet(), 
                            params[j].getDataSet());
                    Float correlation = covariance / (params[i].getStd() * params[j].getStd());
                    if (correlation.isInfinite() || correlation.isNaN())
                    {
                        correlation = 0.0F;
                    }
                    correlations.add(correlation);
                }
                else
                {
                    features.add(null);
                }
            }
        }
        return correlations;
    }