- #1
- 572
- 10
Does anyone know a C# class that can return a value (0 - 100 percentage) of How close a perfect gaussian curve an 2D Matrix is?
for example, these would all return a 100%:
for example, these would all return a 100%:
I am doing grading( 100% -0) 100-90 is a A, 89- 80 is a B, 79-70 C, and 60 on down is a FWhat do the percentages mean? Are they related to probabilities? or confidence numbers?
I can only think of the Chi-square goodness of fit method to measure how close a sample histogram is to a theoretical distribution. But that gives a number that allows you to conclude that a certain sample would be unlikely to fit a distribution that represents the null hypothesis. Using it to PROVE that the sample IS from the given distribution is misusing the statistic. It only allows you to continue to SUPPOSE that it is from the given distribution.
I was reading this article and I trying to follow their code example but I think I am missing a library.What do the percentages mean? Are they related to probabilities? or confidence numbers?
I can only think of the Chi-square goodness of fit method to measure how close a sample histogram is to a theoretical distribution. But that gives a number that allows you to conclude that a certain sample would be unlikely to fit a distribution that represents the null hypothesis. Using it to PROVE that the sample IS from the given distribution is misusing the statistic. It only allows you to continue to SUPPOSE that it is from the given distribution.
var rand = new Random();
var matrix = new double[5,5];
for(int i=0; i < matrix.GetLength(0); i++)
{
for(int j=0; j < matrix.GetLength(1); j++)
{
matrix = rand.NextDouble() * 100;
}
}
double mean = matrix.Average();
double stdDev = Math.Sqrt(matrix.Variance());
lang=cpp
to the opening tag (or select C in the menu if you are using the wysiwyg editor button) so it highlights c-like syntax.What article?I was reading this article
I found this StatisticFormulaI do not have a C# compiler and I can not find any evidence (using Google) that C# has a Variance method for an array. All I see are people defining their own variance or standard deviation program as in this link.
As you can see from the name, members of that namespace are used for plotting data in a web app: is that what you are doing? How much experience do you have with C#?I found this StatisticFormula
but when I add it to my WPF project, I get an error: it can't find it, but added the .dll.
So I Tried using System.Web.UI.DataVisualization.Charting;
but it found that, but it still can't find Variance.
if you look at the original link, is says :As you can see from the name, members of that namespace are used for plotting data in a web app: is that what you are doing? How much experience do you have with C#?
Namespace:
System.Windows.Forms.DataVisualization.Charting
Assembly:
System.Windows.Forms.DataVisualization.dll
Severity Code Description Project File Line Suppression State
Error CS0234 The type or namespace name 'DataVisualization' does not exist in the namespace 'System.Windows.Forms' (are you missing an assembly reference?)
So I Tried using System.Web.UI.DataVisualization.Charting;
but it found that, but it still can't find Variance.
Right, but it doesn't say System.Web.UI.DataVisualization.Charting, which is what you said you tried.if you look at the original link, is says :
Code:Namespace: System.Windows.Forms.DataVisualization.Charting Assembly: System.Windows.Forms.DataVisualization.dll
Did you specify the full namespace? I.e.,btb4198 said:I added that .dll and I tried that using but it says:
Code:Severity Code Description Project File Line Suppression State Error CS0234 The type or namespace name 'DataVisualization' does not exist in the namespace 'System.Windows.Forms' (are you missing an assembly reference?)
So I was looking for a WPF one but I only find that Web one and I was just trying it.
I posted the question here and got the right answer which out anyone questions my background. They just answered the question, it was really nice and easy. You can close this post.Are you sure you know what you are doing here, both from a statistical and a coding point of view? Can you answer the background questions @FactChecker and I have answered, and provide a link to the article you are trying to follow?
Mark44,Right, but it doesn't say System.Web.UI.DataVisualization.Charting, which is what you said you tried.
It seems to me that if you include the correct namespace, Visual Studio will link in the appropriate DLL. I don't think you need to do this yourself.
Did you specify the full namespace? I.e.,
System.Windows.Forms.DataVisualization.Charting?
Done.You can close this post.
Mark44 said:Did you specify the full namespace? I.e.,
System.Windows.Forms.DataVisualization.Charting?
@btb198, one possibility is that in the tutorial you were reading, they were using a different version of the .NET framework than the one you have on your computer. That's the only reason I can think of as to why Visual Studio was unable to find the DataVisualization class (namespace?).Mark44,
Yes I did. but it did not work.