SPC value
List<double> values = new List<double>();
foreach (String[] raw in csvData)
{
try {values.Add(Double.Parse(raw[IndexLoading]));} catch (Exception ex) {LogError("ProcessEAP_SPC",ex.Message);}
}
values.Sort();
double max = values[values.Count - 1];
double min = values[0];
double average = values.Average();
double range = max-min;
double sigma = standardDeviation(values);
public static double standardDeviation(this IEnumerable<double> sequence)
{
double average = sequence.Average();
double sum = sequence.Sum(d => Math.Pow(d - average, 2));
return Math.Sqrt((sum) / (sequence.Count() - 1));
}
留言
張貼留言