Пример #1
0
 //-------------------------------------
 public double clcMCorelation(int k, qData aX, qData aY)
 {
     int sizeX;
     int sizeY;
     int size;
     sizeX = aX.size();
     sizeY = aY.size();
     size = (sizeX <= sizeY) ? sizeX : sizeY;
     if (size != 0)
     {
         double C = 0;
         C = clcMCovariation(k, new qData(aX), new qData(aY));
         double R = 0;
         double sgmX = 0;
         double sgmY = 0;
         sgmX = aX.clcVar();
         sgmY = aY.clcVar();
         sgmX = Math.Sqrt(sgmX);
         sgmY = Math.Sqrt(sgmY);
         if (sgmX * sgmY > 0)
         {
             R = C / (sgmX * sgmY);
         }
         else
         {
             R = 0;
         }
         return R;
     }
     else
     {
         return 0;
     }
 }