Пример #1
0
 public static double a(statistics design1, statistics design2)
 {
     try
     {
         return(cov(design1, design2) / (Math.Pow(design2.s(), 2)));
     }
     catch (Exception)
     {
         return(0.0);                //double.Nan;;
     }
 }
Пример #2
0
 public double a(statistics design)
 {
     try
     {
         return(this.cov(design) / (Math.Pow(design.s(), 2)));
     }
     catch (Exception)
     {
         return(0.0);                //double.Nan;;
     }
 }
Пример #3
0
 public static double r(statistics design1, statistics design2)
 {
     try
     {
         return(cov(design1, design2) / (design1.s() * design2.s()));
     }
     catch (Exception)
     {
         return(0.0);                //double.Nan;;
     }
 }
Пример #4
0
 public double r(statistics design)
 {
     try
     {
         return(this.cov(design) / (this.s() * design.s()));
     }
     catch (Exception)
     {
         return(0.0);                //double.Nan;;
     }
 }
Пример #5
0
 public static double cov(statistics s1, statistics s2)
 {
     try
     {
         if (s1.length() != s2.length())
         {
             return(0.0);                                          //double.Nan;;
         }
         int    len     = s1.length();
         double sum_mul = 0;
         for (int i = 0; i <= len - 1; i++)
         {
             sum_mul += (s1.list[i] * s2.list[i]);
         }
         return((sum_mul - len * s1.mean() * s2.mean()) / (len - 1));
     }
     catch (Exception)
     {
         return(0.0);                //double.Nan;;
     }
 }
Пример #6
0
 public static double b(statistics design1, statistics design2)
 {
     return(design1.mean() - a(design1, design2) * design2.mean());
 }
Пример #7
0
 public double b(statistics design)
 {
     return(this.mean() - this.a(design) * design.mean());
 }