• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Distributions.Gamma类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



Gamma类属于MathNet.Numerics.Distributions命名空间,在下文中一共展示了Gamma类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: TestStarUniformDistribution

 public void TestStarUniformDistribution()
 {
     IContinuousDistribution distribution = new Gamma(9, 1/5000.0);
     Console.WriteLine(distribution.CumulativeDistribution(30000));
     //IContinuousDistribution distribution = new Gamma(3, 0.05);
     for (double d = 0; d < 50000; d = d + 1000)
     {
         //Console.WriteLine(Gamma.PDF(3, 0.05, d));
         //Console.WriteLine(Gamma.CDF(3, 0.05, d));
         Console.WriteLine("" + d + ": " + distribution.CumulativeDistribution(d));
     }
 }
开发者ID:cmdrmcdonald,项目名称:EliteDangerousDataProvider,代码行数:12,代码来源:StarTests.cs


示例2: SetupDistributions

        public void SetupDistributions()
        {
            dists = new IDistribution[8];

            dists[0] = new Beta(1.0, 1.0);
            dists[1] = new ContinuousUniform(0.0, 1.0);
            dists[2] = new Gamma(1.0, 1.0);
            dists[3] = new Normal(0.0, 1.0);
            dists[4] = new Bernoulli(0.6);
            dists[5] = new Weibull(1.0, 1.0);
            dists[6] = new DiscreteUniform(1, 10);
            dists[7] = new LogNormal(1.0, 1.0);
        }
开发者ID:DvptUml,项目名称:mathnet-numerics,代码行数:13,代码来源:CommonDistributionTests.cs


示例3: SetShapeFailsWithNegativeShape

 public void SetShapeFailsWithNegativeShape()
 {
     var n = new Gamma(1.0, 1.0);
     n.Shape = -1.0;
 }
开发者ID:joeynelson,项目名称:mathnet-numerics,代码行数:5,代码来源:GammaTests.cs


示例4: CanCreateGamma

 public void CanCreateGamma(double shape, double invScale)
 {
     var n = new Gamma(shape, invScale);
     Assert.AreEqual(shape, n.Shape);
     Assert.AreEqual(invScale, n.Rate);
 }
开发者ID:kityandhero,项目名称:mathnet-numerics,代码行数:6,代码来源:GammaTests.cs


示例5: ValidateToString

 public void ValidateToString()
 {
     var n = new Gamma(1d, 2d);
     Assert.AreEqual("Gamma(α = 1, β = 2)", n.ToString());
 }
开发者ID:kityandhero,项目名称:mathnet-numerics,代码行数:5,代码来源:GammaTests.cs


示例6: ValidateSkewness

 public void ValidateSkewness(double shape, double invScale, double skewness)
 {
     var n = new Gamma(shape, invScale);
     AssertHelpers.AlmostEqualRelative(skewness, n.Skewness, 15);
 }
开发者ID:kityandhero,项目名称:mathnet-numerics,代码行数:5,代码来源:GammaTests.cs


示例7: ValidateMinimum

 public void ValidateMinimum()
 {
     var n = new Gamma(1.0, 1.0);
     Assert.AreEqual(0.0, n.Minimum);
 }
开发者ID:kityandhero,项目名称:mathnet-numerics,代码行数:5,代码来源:GammaTests.cs


示例8: ValidateMean

 public void ValidateMean(double shape, double invScale, double mean)
 {
     var n = new Gamma(shape, invScale);
     Assert.AreEqual(mean, n.Mean);
 }
开发者ID:kityandhero,项目名称:mathnet-numerics,代码行数:5,代码来源:GammaTests.cs


示例9: ValidateInverseCumulativeDistribution

 public void ValidateInverseCumulativeDistribution(int shape, double invScale, double x, double cdf)
 {
     var gamma = new Gamma(shape, invScale);
     Assert.That(gamma.InverseCumulativeDistribution(cdf), Is.EqualTo(x).Within(10));
     Assert.That(Gamma.InvCDF(shape, invScale, cdf), Is.EqualTo(x).Within(10));
 }
开发者ID:kityandhero,项目名称:mathnet-numerics,代码行数:6,代码来源:GammaTests.cs


示例10: ValidateCumulativeDistribution

 public void ValidateCumulativeDistribution(int shape, double invScale, double x, double cdf)
 {
     var n = new Gamma(shape, invScale);
     AssertHelpers.AlmostEqual(cdf, n.CumulativeDistribution(x), 14);
     AssertHelpers.AlmostEqual(cdf, Gamma.CDF(shape, invScale, x), 14);
 }
开发者ID:nakamoton,项目名称:mathnet-numerics,代码行数:6,代码来源:GammaTests.cs


示例11: CanCreateGamma

 public void CanCreateGamma(double shape, double invScale)
 {
     var n = new Gamma(shape, invScale);
     AssertEx.AreEqual<double>(shape, n.Shape);
     AssertEx.AreEqual<double>(invScale, n.InvScale);
 }
开发者ID:joeynelson,项目名称:mathnet-numerics,代码行数:6,代码来源:GammaTests.cs


示例12: ValidateToString

 public void ValidateToString()
 {
     var n = new Gamma(1.0, 2.0);
     AssertEx.AreEqual<string>("Gamma(Shape = 1, Inverse Scale = 2)", n.ToString());
 }
开发者ID:joeynelson,项目名称:mathnet-numerics,代码行数:5,代码来源:GammaTests.cs


示例13: ValidateMedian

 public void ValidateMedian(double shape, double invScale)
 {
     var n = new Gamma(shape, invScale);
     var median = n.Median;
 }
开发者ID:joeynelson,项目名称:mathnet-numerics,代码行数:5,代码来源:GammaTests.cs


示例14: ValidateMaximum

 public void ValidateMaximum()
 {
     var n = new Gamma(1.0, 1.0);
     AssertEx.AreEqual<double>(System.Double.PositiveInfinity, n.Maximum);
 }
开发者ID:joeynelson,项目名称:mathnet-numerics,代码行数:5,代码来源:GammaTests.cs


示例15: ValidateDensityLn

 public void ValidateDensityLn(double shape, double invScale, double x, double pdfln)
 {
     var n = new Gamma(shape, invScale);
     AssertHelpers.AlmostEqual(pdfln, n.DensityLn(x), 14);
 }
开发者ID:joeynelson,项目名称:mathnet-numerics,代码行数:5,代码来源:GammaTests.cs


示例16: ValidateDensityLn

 public void ValidateDensityLn(int shape, double invScale, double x, double pdfln)
 {
     var n = new Gamma(shape, invScale);
     AssertHelpers.AlmostEqualRelative(pdfln, n.DensityLn(x), 13);
     AssertHelpers.AlmostEqualRelative(pdfln, Gamma.PDFLn(shape, invScale, x), 13);
 }
开发者ID:kityandhero,项目名称:mathnet-numerics,代码行数:6,代码来源:GammaTests.cs


示例17: ValidateEntropy

 public void ValidateEntropy(double shape, double invScale, double entropy)
 {
     var n = new Gamma(shape, invScale);
     AssertHelpers.AlmostEqualRelative(entropy, n.Entropy, 12);
 }
开发者ID:kityandhero,项目名称:mathnet-numerics,代码行数:5,代码来源:GammaTests.cs


示例18: ValidateDensity

 public void ValidateDensity(int shape, double invScale, double x, double pdf)
 {
     var n = new Gamma(shape, invScale);
     AssertHelpers.AlmostEqual(pdf, n.Density(x), 14);
     AssertHelpers.AlmostEqual(pdf, Gamma.PDF(shape, invScale, x), 14);
 }
开发者ID:nakamoton,项目名称:mathnet-numerics,代码行数:6,代码来源:GammaTests.cs


示例19: ValidateMaximum

 public void ValidateMaximum()
 {
     var n = new Gamma(1.0, 1.0);
     Assert.AreEqual(Double.PositiveInfinity, n.Maximum);
 }
开发者ID:kityandhero,项目名称:mathnet-numerics,代码行数:5,代码来源:GammaTests.cs


示例20: SetInvScaleFailsWithNegativeInvScale

 public void SetInvScaleFailsWithNegativeInvScale()
 {
     var n = new Gamma(1.0, 1.0);
     Assert.Throws<ArgumentOutOfRangeException>(() => n.Rate = -1.0);
 }
开发者ID:rookboom,项目名称:mathnet-numerics,代码行数:5,代码来源:GammaTests.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Distributions.LogNormal类代码示例发布时间:2022-05-26
下一篇:
C# Distributions.ContinuousUniform类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap