public NormalDistributionDecimal(decimal[] array) { dataArray = array; sd = new StandardDeviation(dataArray); standardDeviation = (decimal)sd.GetResult(); mean = (decimal)sd.GetMean(); }
public NormalDistributionDouble(double[] array) { dataArray = array; sd = new StandardDeviation(dataArray); standardDeviation = (double)sd.GetResult(); mean = (double)sd.GetMean(); }
public NormalDistributionFloat(float[] array) { dataArray = array; sd = new StandardDeviation(dataArray); standardDeviation = (float)sd.GetResult(); mean = (float)sd.GetMean(); }
public override object GetTTestValue(object array1, object array2) { StandardDeviation sd1 = new StandardDeviation(array1); StandardDeviation sd2 = new StandardDeviation(array2); decimal array1Mean = (decimal)sd1.GetMean(); decimal array1SD = (decimal)sd1.GetResult(); decimal array2Mean = (decimal)sd2.GetMean(); decimal array2SD = (decimal)sd2.GetResult(); int length1 = (array1 as Array).Length; int length2 = (array2 as Array).Length; return((double)Math.Abs(array1Mean - array2Mean) / (Math.Sqrt(Math.Pow(Convert.ToDouble(array1SD), 2) / length1 + Math.Pow(Convert.ToDouble(array2SD), 2) / length2))); }
public override object GetTTestValue(object array1, object array2) { StandardDeviation sd1 = new StandardDeviation(array1); StandardDeviation sd2 = new StandardDeviation(array2); float array1Mean = (float)sd1.GetMean(); float array1SD = (float)sd1.GetResult(); float array2Mean = (float)sd2.GetMean(); float array2SD = (float)sd2.GetResult(); int length1 = (array1 as Array).Length; int length2 = (array2 as Array).Length; return(Math.Abs(array1Mean - array2Mean) / (Math.Sqrt(Math.Pow(array1SD, 2) / length1 + Math.Pow(array2SD, 2) / length2))); }
public override object GetCorrelationRatio() { StandardDeviation sd1 = new StandardDeviation(array1); StandardDeviation sd2 = new StandardDeviation(array2); double mean1 = (double)sd1.GetMean(); double mean2 = (double)sd2.GetMean(); double sum = 0; for (int i = 0; i < length; i++) { sum += (array1[i] - mean1) * (array2[i] - mean2); } return((sum / ((double)sd1.GetResult() * (double)sd2.GetResult())) / (length - 1)); }
public override void GetGreatFive(out object mean1, out object mean2, out object sigma1, out object sigma2, out object r) { StandardDeviation sd1 = new StandardDeviation(array1); StandardDeviation sd2 = new StandardDeviation(array2); mean1 = (double)sd1.GetMean(); mean2 = (double)sd2.GetMean(); sigma1 = (double)sd1.GetResult(); sigma2 = (double)sd2.GetResult(); double sum = 0; for (int i = 0; i < length; i++) { sum += (array1[i] - (double)mean1) * (array2[i] - (double)mean2); } r = (sum / ((double)sigma1 * (double)sigma2)) / (length - 1); }
public override object GetStandardDeviation() { return(sd.GetResult()); }