本文整理汇总了C#中MathNet.Numerics.Distributions.ContinuousUniform.InverseCumulativeDistribution方法的典型用法代码示例。如果您正苦于以下问题:C# ContinuousUniform.InverseCumulativeDistribution方法的具体用法?C# ContinuousUniform.InverseCumulativeDistribution怎么用?C# ContinuousUniform.InverseCumulativeDistribution使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MathNet.Numerics.Distributions.ContinuousUniform
的用法示例。
在下文中一共展示了ContinuousUniform.InverseCumulativeDistribution方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ValidateInverseCumulativeDistribution
public void ValidateInverseCumulativeDistribution(double lower, double upper)
{
var n = new ContinuousUniform(lower, upper);
for (var i = 0; i < 11; i++)
{
var x = i - 5.0;
if (x <= lower)
{
Assert.AreEqual(lower, n.InverseCumulativeDistribution(0.0), 1e-12);
Assert.AreEqual(lower, ContinuousUniform.InvCDF(lower, upper, 0.0), 1e-12);
}
else if (x >= upper)
{
Assert.AreEqual(upper, n.InverseCumulativeDistribution(1.0), 1e-12);
Assert.AreEqual(upper, ContinuousUniform.InvCDF(lower, upper, 1.0), 1e-12);
}
else
{
Assert.AreEqual(x, n.InverseCumulativeDistribution((x - lower)/(upper - lower)), 1e-12);
Assert.AreEqual(x, ContinuousUniform.InvCDF(lower, upper, (x - lower)/(upper - lower)), 1e-12);
}
}
}