Beispiel #1
0
		/// <summary>
		/// Calculate the variance 
		/// </summary>
		/// <param name="data"></param>
		/// <returns></returns>
		static public ComplexD	Variance( ComplexD[] 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 );
		}
Beispiel #2
0
		/// <summary>
		/// Calculate the standard deviation 
		/// </summary>
		/// <param name="data"></param>
		/// <returns></returns>
		static public ComplexD	StdDev( ComplexD[] data ) {
			Debug.Assert( data != null );
			if( data.Length == 0 ) {
				throw new DivideByZeroException( "length of data is zero" );
			}
			return	ComplexMath.Sqrt( ComplexStats.Variance( data ) );
		}
Beispiel #3
0
		/// <summary>
		/// Calculate the mean (average)
		/// </summary>
		/// <param name="data"></param>
		/// <returns></returns>
		static public ComplexD		Mean( ComplexD[] data ) {
			return	ComplexStats.Sum( data ) / data.Length;
		}