Exemplo n.º 1
0
 /// <summary>
 /// Calculate the standard deviation
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 static public Complex StdDev(Complex[] data)
 {
     Debug.Assert(data != null);
     if (data.Length == 0)
     {
         throw new DivideByZeroException("length of data is zero");
     }
     return(ComplexMath.Sqrt(ComplexStats.Variance(data)));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Calculate the variance
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 static public Complex Variance(Complex[] data)
 {
     Debug.Assert(data != null);
     if (data.Length == 0)
     {
         throw new DivideByZeroException("length of data is zero");
     }
     return(ComplexStats.SumOfSquares(data) / data.Length - ComplexStats.Sum(data));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Calculate the standard deviation
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public static Complex StdDev(Complex[] data)
 {
     if (!(data != null))
     {
         throw new ArgumentNullException(nameof(data));
     }
     if (data.Length == 0)
     {
         throw new DivideByZeroException("length of data is zero");
     }
     return(ComplexMath.Sqrt(ComplexStats.Variance(data)));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Calculate the variance
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public static Complex Variance(Complex[] data)
 {
     if (!(data != null))
     {
         throw new ArgumentNullException(nameof(data));
     }
     if (data.Length == 0)
     {
         throw new DivideByZeroException("length of data is zero");
     }
     return(ComplexStats.SumOfSquares(data) / data.Length - ComplexStats.Sum(data));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Calculate the mean (average)
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public static Complex Mean(Complex[] data)
 {
     return(ComplexStats.Sum(data) / data.Length);
 }
Exemplo n.º 6
0
        //--------------------------------------------------------------------------------------------
        //--------------------------------------------------------------------------------------------

        /// <summary>
        /// Calculate the mean (average)
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        static public ComplexFloat    Mean(ComplexFloat[] data)
        {
            return(ComplexStats.Sum(data) / data.Length);
        }