类 IntegerDistributionAbstractTest
java.lang.Object
org.hipparchus.distribution.discrete.IntegerDistributionAbstractTest
- 直接已知子类:
-
BinomialDistributionTest,GeometricDistributionTest,HypergeometricDistributionTest,PascalDistributionTest,PoissonDistributionTest,UniformIntegerDistributionTest,ZipfDistributionTest
整数分布
的抽象基类测试。要为整数分布实现创建一个具体的测试类,实现makeDistribution()以返回用于测试的分布实例,以及下面的每个测试数据生成方法。在每种情况下,返回的测试点和测试值数组表示用于测试makeDistribution()返回的分布的输入和期望值的并行数组。
makeDensityTestPoints() -- 用于测试概率密度计算的参数 makeDensityTestValues() -- 期望的概率密度 makeCumulativeTestPoints() -- 用于测试累积概率 makeCumulativeTestValues() -- 期望的累积概率 makeInverseCumulativeTestPoints() -- 用于测试逆cdf评估 makeInverseCumulativeTestValues() -- 期望的逆cdf值
要使用不同的分布实例和测试数据实现额外的测试用例,使用测试用例中的实例数据的setXxx方法,并调用verifyXxx方法来验证结果。
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected int[]protected double[]protected int[]protected double[]protected IntegerDistributionprotected double[]protected int[]protected doubleabstract int[]创建默认的累积概率密度测试输入值abstract double[]创建默认的累积概率密度测试期望值abstract int[]创建默认的概率密度测试输入值abstract double[]创建默认的概率密度测试期望值abstract IntegerDistribution创建默认的离散分布实例以用于测试。abstract double[]创建默认的逆累积概率测试输入值abstract int[]创建默认的逆累积概率密度测试期望值double[]创建默认的对数概率密度测试期望值。protected voidsetCumulativeTestPoints(int[] cumulativeTestPoints) protected voidsetCumulativeTestValues(double[] cumulativeTestValues) protected voidsetDensityTestPoints(int[] densityTestPoints) protected voidsetDensityTestValues(double[] densityTestValues) protected voidsetDistribution(IntegerDistribution distribution) protected voidsetInverseCumulativeTestPoints(double[] inverseCumulativeTestPoints) protected voidsetInverseCumulativeTestValues(int[] inverseCumulativeTestValues) protected voidsetTolerance(double tolerance) voidsetUp()设置所有测试实例数据为默认值voidtearDown()清除测试实例数据voidvoid验证使用默认测试实例数据的累积概率密度计算是否与期望值匹配void验证使用默认测试实例数据的概率密度计算是否与期望值匹配void验证非法参数是否被正确处理void验证使用默认测试实例数据的逆累积概率密度计算是否与期望值匹配void验证使用默认测试实例数据的对数概率密度计算是否与期望值匹配protected void验证使用当前测试实例数据的累积概率密度计算是否与期望值匹配protected void验证使用当前测试实例数据的概率密度计算是否与期望值匹配protected void验证使用当前测试实例数据的逆累积概率密度计算是否与期望值匹配protected void验证使用当前测试实例数据的对数概率密度计算是否与期望值匹配。
-
构造器详细资料
-
IntegerDistributionAbstractTest
public IntegerDistributionAbstractTest()
-
-
方法详细资料
-
makeDistribution
创建默认的离散分布实例以用于测试。 -
makeDensityTestPoints
public abstract int[] makeDensityTestPoints()创建默认的概率密度测试输入值 -
makeDensityTestValues
public abstract double[] makeDensityTestValues()创建默认的概率密度测试期望值 -
makeLogDensityTestValues
public double[] makeLogDensityTestValues()创建默认的对数概率密度测试期望值。默认实现仅计算makeDensityTestValues()中所有值的对数。- 返回:
- double[] 默认的对数概率密度测试期望值。
-
makeCumulativeTestPoints
public abstract int[] makeCumulativeTestPoints()创建默认的累积概率密度测试输入值 -
makeCumulativeTestValues
public abstract double[] makeCumulativeTestValues()创建默认的累积概率密度测试期望值 -
makeInverseCumulativeTestPoints
public abstract double[] makeInverseCumulativeTestPoints()创建默认的逆累积概率测试输入值 -
makeInverseCumulativeTestValues
public abstract int[] makeInverseCumulativeTestValues()创建默认的逆累积概率密度测试期望值 -
setUp
public void setUp()设置所有测试实例数据为默认值 -
tearDown
public void tearDown()清除测试实例数据 -
verifyDensities
protected void verifyDensities()验证使用当前测试实例数据的概率密度计算是否与期望值匹配 -
verifyLogDensities
protected void verifyLogDensities()验证使用当前测试实例数据的对数概率密度计算是否与期望值匹配。 -
verifyCumulativeProbabilities
protected void verifyCumulativeProbabilities()验证使用当前测试实例数据的累积概率密度计算是否与期望值匹配 -
verifyInverseCumulativeProbabilities
protected void verifyInverseCumulativeProbabilities()验证使用当前测试实例数据的逆累积概率密度计算是否与期望值匹配 -
testDensities
public void testDensities()验证使用默认测试实例数据的概率密度计算是否与期望值匹配 -
testLogDensities
public void testLogDensities()验证使用默认测试实例数据的对数概率密度计算是否与期望值匹配 -
testCumulativeProbabilities
public void testCumulativeProbabilities()验证使用默认测试实例数据的累积概率密度计算是否与期望值匹配 -
testInverseCumulativeProbabilities
public void testInverseCumulativeProbabilities()验证使用默认测试实例数据的逆累积概率密度计算是否与期望值匹配 -
testConsistencyAtSupportBounds
public void testConsistencyAtSupportBounds() -
testIllegalArguments
public void testIllegalArguments()验证非法参数是否被正确处理 -
getCumulativeTestPoints
protected int[] getCumulativeTestPoints()- 返回:
- 返回累积测试点。
-
setCumulativeTestPoints
protected void setCumulativeTestPoints(int[] cumulativeTestPoints) - 参数:
-
cumulativeTestPoints- 要设置的累积测试点。
-
getCumulativeTestValues
protected double[] getCumulativeTestValues()- 返回:
- 返回累积测试值。
-
setCumulativeTestValues
protected void setCumulativeTestValues(double[] cumulativeTestValues) - 参数:
-
cumulativeTestValues- 要设置的累积测试值。
-
getDensityTestPoints
protected int[] getDensityTestPoints()- 返回:
- 返回密度测试点。
-
setDensityTestPoints
protected void setDensityTestPoints(int[] densityTestPoints) - 参数:
-
densityTestPoints- 要设置的密度测试点。
-
getDensityTestValues
protected double[] getDensityTestValues()- 返回:
- 返回密度测试值。
-
setDensityTestValues
protected void setDensityTestValues(double[] densityTestValues) - 参数:
-
densityTestValues- 要设置的密度测试值。
-
getDistribution
- 返回:
- 返回分布。
-
setDistribution
- 参数:
-
distribution- 要设置的分布。
-
getInverseCumulativeTestPoints
protected double[] getInverseCumulativeTestPoints()- 返回:
- 返回逆累积测试点。
-
setInverseCumulativeTestPoints
protected void setInverseCumulativeTestPoints(double[] inverseCumulativeTestPoints) - 参数:
-
inverseCumulativeTestPoints- 要设置的逆累积测试点。
-
getInverseCumulativeTestValues
protected int[] getInverseCumulativeTestValues()- 返回:
- 返回逆累积测试值。
-
setInverseCumulativeTestValues
protected void setInverseCumulativeTestValues(int[] inverseCumulativeTestValues) - 参数:
-
inverseCumulativeTestValues- 要设置的逆累积测试值。
-
getTolerance
protected double getTolerance()- 返回:
- 返回容差。
-
setTolerance
protected void setTolerance(double tolerance) - 参数:
-
tolerance- 要设置的容差。
-