Exemplo n.º 1
0
        /// <summary>
        /// Determines whether the specified <see cref="ChannelStatistics"/> is equal to the current <see cref="ChannelStatistics"/>.
        /// </summary>
        /// <param name="other">The channel statistics to compare this <see cref="ChannelStatistics"/> with.</param>
        /// <returns>True when the specified <see cref="ChannelStatistics"/> is equal to the current <see cref="ChannelStatistics"/>.</returns>
        public bool Equals(ChannelStatistics other)
        {
            if (ReferenceEquals(other, null))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                (Depth.Equals(other.Depth) &&
                 Entropy.Equals(other.Entropy) &&
                 Kurtosis.Equals(other.Kurtosis) &&
                 Maximum.Equals(other.Maximum) &&
                 Mean.Equals(other.Mean) &&
                 Minimum.Equals(other.Minimum) &&
                 Skewness.Equals(other.Skewness) &&
                 StandardDeviation.Equals(other.StandardDeviation) &&
                 Sum.Equals(other.Sum) &&
                 SumCubed.Equals(other.SumCubed) &&
                 SumFourthPower.Equals(other.SumFourthPower) &&
                 SumSquared.Equals(other.SumSquared) &&
                 Variance.Equals(other.Variance));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Serves as a hash of this type.
 /// </summary>
 /// <returns>A hash code for the current instance.</returns>
 public override int GetHashCode()
 {
     return
         (Depth.GetHashCode() ^
          Entropy.GetHashCode() ^
          Kurtosis.GetHashCode() ^
          Maximum.GetHashCode() ^
          Mean.GetHashCode() ^
          Minimum.GetHashCode() ^
          Skewness.GetHashCode() ^
          StandardDeviation.GetHashCode() ^
          Sum.GetHashCode() ^
          SumCubed.GetHashCode() ^
          SumFourthPower.GetHashCode() ^
          SumSquared.GetHashCode() ^
          Variance.GetHashCode());
 }
        public void WriteXml(XmlWriter writer)
        {
            writer.WriteAttributeString("nominal", Nominal.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString("mean", Mean.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString("standardDeviation", StandardDeviation.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString("lowerSpecLimit", LowerSpecLimit.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString("upperSpecLimit", UpperSpecLimit.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString("cp", Cp.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString("cpk", Cpk.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString("distribution", Distribution);
            writer.WriteAttributeString("skewness", Skewness.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString("kurtosis", Kurtosis.ToString(CultureInfo.InvariantCulture));
            writer.WriteAttributeString("sampleSize", SampleSize.ToString(CultureInfo.InvariantCulture));

            writer.WriteStartElement("Sample");
            Sample.WriteXml(writer);
            writer.WriteEndElement();

            writer.WriteStartElement("Estimate");
            Estimate.WriteXml(writer);
            writer.WriteEndElement();
        }
Exemplo n.º 4
0
 public void intSkewTest()
 {
     int[] nums = { 1, 2, 3, 4, 100, 400, 400, 600, 700 };
     Assert.AreEqual("Negative Skewness", Skewness.findSkew(nums));
 }
Exemplo n.º 5
0
 public void decimalSkewTest()
 {
     decimal[] nums = { 1, 1.7M, 1.8M, 1.9M, 2.1M, 4M, 6M, 8M };
     Assert.AreEqual("Likely a Positive Skewness", Skewness.findSkew(nums));
 }