I will need to write an app to run statistical analysis on a DataGrid. Pp and Ppk is easy to do with standard deviation calculation in C#. But Some number such as estimated deviation (rBar/d2) used for Cp and Cpk - that is too complex (for me ) to code. Are there existing libraries, commercial or open source, that I can implement?
Asked
Active
Viewed 3,501 times
3 Answers
2
Extreme Optimization might be something you are looking for.
Edit
How about SPC Chart?

Sani Huttunen
- 23,620
- 6
- 72
- 79
-
Nope..Extremem Optimization does not contain Statistical Process Control method (e.g. No estimated deviation, Cp, Cpk ) – KMC Feb 25 '11 at 08:34
-
Thanks. But "SPC Chart" did not calculate Cpk correctly (Cpk is too close to Ppk) - that is due to using StdDev or SteDevp to calculate deviation instead of using rBar/d2 or rBar/c4 (which is where I'm getting stuck coding). Many "SPC Chart" or "Excel SPC" etc has close but inaccurate Cpk, which is why many of us resorted to use the expensive Minitab... – KMC Feb 25 '11 at 09:17
1
You might wanna check out Sho, it's a tool for doing stuff with data and it provides a lot of math libraries.
http://channel9.msdn.com/Blogs/Charles/John-Platt-Introduction-to-Sho

John Leidegren
- 59,920
- 20
- 131
- 152
-
Sho is very nice, just that it does not contain SPC functions (e.g. Cp, Cpk, Pp, Ppk etc.) – KMC Feb 25 '11 at 08:35
-1
I have used MathNet.Numerics for these type calculations.
https://www.nuget.org/packages/MathNet.Numerics/
https://numerics.mathdotnet.com/
Example for cp and cpk:
public class ProcessPerformance
{
public static ProcessPerformanceResult Calculate(double[] data,double lsl,double usl,double sigma =3.0,double cpSigma=6.0)
{
if(data.Count() ppkLsl ? ppkLsl : ppkUsl;
var cP = (usl - lsl) / (descriptiveStatistics.StandardDeviation * cpSigma);
var median = MathNet.Numerics.Statistics.Statistics.Median(data);
return new ProcessPerformanceResult(){Cp=cP,Cpk=cPk,Median= median, DescriptiveStatistics=descriptiveStatistics};
}
public class ProcessPerformanceResult
{
//https://en.wikipedia.org/wiki/Process_capability_index
public double Cpk { get; set; }
public double Cp {get;set;}
public double Median {get;set;}
public MathNet.Numerics.Statistics.DescriptiveStatistics DescriptiveStatistics {get;set;}
}
}

ulm
- 51
- 1
- 3
-
Please provide additional details in your answer. As it's currently written, it's hard to understand your solution. – Community Aug 27 '21 at 06:49