Exemplo n.º 1
0
 public static double a(statistics design1, statistics design2)
 {
     try
     {
         return(cov(design1, design2) / (Math.Pow(design2.s(), 2)));
     }
     catch (Exception)
     {
         return(double.NaN);
     }
 }
Exemplo n.º 2
0
 public double a(statistics design)
 {
     try
     {
         return(this.cov(design) / (Math.Pow(design.s(), 2)));
     }
     catch (Exception)
     {
         return(double.NaN);
     }
 }
Exemplo n.º 3
0
 public static double r(statistics design1, statistics design2)
 {
     try
     {
         return(cov(design1, design2) / (design1.s() * design2.s()));
     }
     catch (Exception)
     {
         return(double.NaN);
     }
 }
Exemplo n.º 4
0
 public double r(statistics design)
 {
     try
     {
         return(this.cov(design) / (this.s() * design.s()));
     }
     catch (Exception)
     {
         return(double.NaN);
     }
 }
Exemplo n.º 5
0
        public void initialForm(List <double> listDouble)
        {
            statistics sta = new statistics(listDouble.ToArray());

            lblMean.Text          = "均值= " + sta.mean().ToString("0.0");
            lblValueMax.Text      = "最大值= " + sta.max().ToString("0.0");
            lblValueMin.Text      = "最小值= " + sta.min().ToString("0.0");
            this.lblDataNum.Text  = "数据个数= " + sta.length().ToString("0");
            this.lblSum.Text      = "总和= " + listDouble.Sum().ToString("0.0");
            this.lblQ2.Text       = "Q2= " + sta.Q2().ToString("0.0");
            this.lblVariance.Text = "方差= " + sta.var().ToString("0.0");
        }
Exemplo n.º 6
0
 public static double cov(statistics s1, statistics s2)
 {
     try
     {
         if (s1.length() != s2.length())
         {
             return(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(double.NaN);
     }
 }
Exemplo n.º 7
0
 public double cov(statistics s)
 {
     try
     {
         if (this.length() != s.length())
         {
             return(double.NaN);
         }
         int    len     = this.length();
         double sum_mul = 0;
         for (int i = 0; i <= len - 1; i++)
         {
             sum_mul += (this.list[i] * s.list[i]);
         }
         return((sum_mul - len * this.mean() * s.mean()) / (len - 1));
     }
     catch (Exception)
     {
         return(double.NaN);
     }
 }
Exemplo n.º 8
0
 public static double b(statistics design1, statistics design2)
 {
     return(design1.mean() - a(design1, design2) * design2.mean());
 }
Exemplo n.º 9
0
 public double b(statistics design)
 {
     return(this.mean() - this.a(design) * design.mean());
 }