使用.NET的StatisticFormula库 [英] Using .Net's StatisticFormula Library

查看:624
本文介绍了使用.NET的StatisticFormula库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

C#的命名空间System.Windows.Forms.DataVisualization.Charting.StatisticFormula似乎有我需要一些统计功能。命名空间被记录在<一个href="http://msdn.microsoft.com/en-us/library/system.windows.forms.datavisualization.charting.statisticformula.aspx"相对=nofollow> 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)

这篇关于使用.NET的StatisticFormula库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆