使用.NET的StatisticFormula库NET、StatisticFormula

由网友(如果你还爱我)分享简介:C#的命名空间System.Windows.Forms.DataVisualization.Charting.StatisticFormula似乎有我需要一些统计功能。命名空间被记录在 MSDN此处。我真的想用InverseNormalDistribution(双Z)的功能。问题在于构造函数是内部的,所以我不能访问的...

C#的命名空间System.Windows.Forms.DataVisualization.Charting.StatisticFormula似乎有我需要一些统计功能。命名空间被记录在 MSDN此处。我真的想用InverseNormalDistribution(双Z)的功能。问题在于构造函数是内部的,所以我不能访问的功能,无论如何,我知道了。

The C# namespace System.Windows.Forms.DataVisualization.Charting.StatisticFormula seems to have a few statistical functions that I need. The namespace is documented at MSDN here. I'd really like to use the InverseNormalDistribution(double Z) function. The problem is that the constructor is internal and so I can't access the functions in anyway that I know.

是否有某种方式来访问的静态函数在这个命名空间,否则我将不得不寻找其他的解决办法?

Is there some way to have access to the statics functions in this namespace, or will I have to find other solution?

推荐答案

您也许可以使用反射,这样的事情应该这样做:

You could probably use reflection, something like this should do it:

var statisticFormula = 
    (StatisticFormula) typeof(StatisticFormula).GetConstructor(
        BindingFlags.NonPublic | BindingFlags.Instance,
        null, Type.EmptyTypes, null).Invoke(null);

但是,这可能是一个更好的方法:

But this may be a better way:

var chart = new Chart();
var value = chart.DataManipulator.Statistics.InverseNormalDistribution(.15)
阅读全文

相关推荐

最新文章