当前位置: 首页>>代码示例>>C#>>正文


C# Normal.InverseCumulativeDistribution方法代码示例

本文整理汇总了C#中MathNet.Numerics.Distributions.Normal.InverseCumulativeDistribution方法的典型用法代码示例。如果您正苦于以下问题:C# Normal.InverseCumulativeDistribution方法的具体用法?C# Normal.InverseCumulativeDistribution怎么用?C# Normal.InverseCumulativeDistribution使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MathNet.Numerics.Distributions.Normal的用法示例。


在下文中一共展示了Normal.InverseCumulativeDistribution方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InflationFactor

 /// <summary>
 /// Truncated N(0, 1) to (x1, x2), where P(X <= x1) = trim and P(X <= x2) = 1 - trim
 /// </summary>
 /// <param name="trim">tail probability</param>
 /// <returns>approximately (E[X^2] = 1) / Et[X^2]</returns>
 private static double InflationFactor(double trim)
 {
     var norm = new Normal(); // N(0, 1)
     double a = norm.InverseCumulativeDistribution(1 - trim);
     double step = 2 * a / 10000;
     double[] x1s = Helper.Seq(-a + step / 2, a - step / 2, 10000);
     // Truncated N(0, 1) to P(X <= x) = trim and P(X <= x) = 1 - trim
     double eX2 = 0.0;
     foreach (double x1 in x1s) { eX2 += (x1 * x1) * norm.Density(x1); }
     eX2 = eX2 * step / (1 - 2 * trim);
     // eX2 now approximates Et[X^2]: E[X^2] of the truncated N(0, 1)
     return 1 / eX2; // approx (E[X^2] = 1) / Et[X^2]
     // == 1 / (1 + (-a * dnorm(-a) - a * dnorm(a)) / (1 - 2*trim) - ((dnorm(-1) - dnorm(a)) / (1 - 2* trim))^2)
     // According to http://en.wikipedia.org/wiki/Truncated_normal_distribution
 }
开发者ID:abladon,项目名称:canvas,代码行数:20,代码来源:ChangePoint.cs


注:本文中的MathNet.Numerics.Distributions.Normal.InverseCumulativeDistribution方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。