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


C# NormalGamma.PrecisionMarginal方法代码示例

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


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

示例1: SamplesFollowsCorrectDistribution

        public void SamplesFollowsCorrectDistribution()
        {
            var cd = new NormalGamma(1.0, 4.0, 3.0, 3.5);

            // Sample from the distribution.
            var samples = cd.Samples().Take(CommonDistributionTests.NumberOfTestSamples).ToArray();

            // Extract the mean and precisions.
            var means = samples.Select(mp => mp.Mean);
            var precs = samples.Select(mp => mp.Precision);
            var meanMarginal = cd.MeanMarginal();
            var precMarginal = cd.PrecisionMarginal();

            // Check the precision distribution.
            CommonDistributionTests.VapnikChervonenkisTest(
                CommonDistributionTests.Error,
                CommonDistributionTests.ErrorProbability,
                precs,
                precMarginal);

            // Check the mean distribution.
            CommonDistributionTests.VapnikChervonenkisTest(
                CommonDistributionTests.Error,
                CommonDistributionTests.ErrorProbability,
                means,
                meanMarginal);
        }
开发者ID:hickford,项目名称:mathnet-numerics-native,代码行数:27,代码来源:NormalGammaTests.cs

示例2: CanGetPrecisionMarginal

 public void CanGetPrecisionMarginal(double meanLocation, double meanScale, double precShape, double precInvScale)
 {
     var ng = new NormalGamma(meanLocation, meanScale, precShape, precInvScale);
     var pm = ng.PrecisionMarginal();
     Assert.AreEqual(precShape, pm.Shape);
     Assert.AreEqual(precInvScale, pm.InvScale);
 }
开发者ID:hickford,项目名称:mathnet-numerics-native,代码行数:7,代码来源:NormalGammaTests.cs

示例3: SampleFollowsCorrectDistribution

        public void SampleFollowsCorrectDistribution()
        {
            var cd = new NormalGamma(1.0, 4.0, 7.0, 3.5);

            // Sample from the distribution.
            var samples = new MeanPrecisionPair[CommonDistributionTests.NumberOfTestSamples];
            for (var i = 0; i < CommonDistributionTests.NumberOfTestSamples; i++)
            {
                samples[i] = cd.Sample();
            }

            // Extract the mean and precisions.
            var means = samples.Select(mp => mp.Mean);
            var precs = samples.Select(mp => mp.Precision);
            var meanMarginal = cd.MeanMarginal();
            var precMarginal = cd.PrecisionMarginal();

            // Check the precision distribution.
            CommonDistributionTests.VapnikChervonenkisTest(
                CommonDistributionTests.Error,
                CommonDistributionTests.ErrorProbability,
                precs,
                precMarginal);

            // Check the mean distribution.
            CommonDistributionTests.VapnikChervonenkisTest(
                CommonDistributionTests.Error,
                CommonDistributionTests.ErrorProbability,
                means,
                meanMarginal);
        }
开发者ID:hickford,项目名称:mathnet-numerics-native,代码行数:31,代码来源:NormalGammaTests.cs

示例4: CanGetPrecisionMarginal

 public void CanGetPrecisionMarginal([Values(0.0, 10.0)] double meanLocation, [Values(1.0, 2.0)] double meanScale, [Values(1.0, 2.0)] double precShape, [Values(1.0, 2.0, Double.PositiveInfinity)] double precInvScale)
 {
     var ng = new NormalGamma(meanLocation, meanScale, precShape, precInvScale);
     var pm = ng.PrecisionMarginal();
     Assert.AreEqual(precShape, pm.Shape);
     Assert.AreEqual(precInvScale, pm.InvScale);
 }
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:7,代码来源:NormalGammaTests.cs


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