|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.math3.distribution.IntegerDistributionAbstractTest
public abstract class IntegerDistributionAbstractTest
Abstract base class for IntegerDistribution tests.
To create a concrete test class for an integer distribution implementation, implement makeDistribution() to return a distribution instance to use in tests and each of the test data generation methods below. In each case, the test points and test values arrays returned represent parallel arrays of inputs and expected values for the distribution returned by makeDistribution().
makeDensityTestPoints() -- arguments used to test probability density calculation makeDensityTestValues() -- expected probability densities makeCumulativeTestPoints() -- arguments used to test cumulative probabilities makeCumulativeTestValues() -- expected cumulative probabilites makeInverseCumulativeTestPoints() -- arguments used to test inverse cdf evaluation makeInverseCumulativeTestValues() -- expected inverse cdf values
To implement additional test cases with different distribution instances and test data, use the setXxx methods for the instance data in test cases and call the verifyXxx methods to verify results.
| Constructor Summary | |
|---|---|
IntegerDistributionAbstractTest()
|
|
| Method Summary | |
|---|---|
protected int[] |
getCumulativeTestPoints()
|
protected double[] |
getCumulativeTestValues()
|
protected int[] |
getDensityTestPoints()
|
protected double[] |
getDensityTestValues()
|
protected IntegerDistribution |
getDistribution()
|
protected double[] |
getInverseCumulativeTestPoints()
|
protected int[] |
getInverseCumulativeTestValues()
|
protected double |
getTolerance()
|
abstract int[] |
makeCumulativeTestPoints()
Creates the default cumulative probability density test input values |
abstract double[] |
makeCumulativeTestValues()
Creates the default cumulative probability density test expected values |
abstract int[] |
makeDensityTestPoints()
Creates the default probability density test input values |
abstract double[] |
makeDensityTestValues()
Creates the default probability density test expected values |
abstract IntegerDistribution |
makeDistribution()
Creates the default discrete distribution instance to use in tests. |
abstract double[] |
makeInverseCumulativeTestPoints()
Creates the default inverse cumulative probability test input values |
abstract int[] |
makeInverseCumulativeTestValues()
Creates the default inverse cumulative probability density test expected values |
protected void |
setCumulativeTestPoints(int[] cumulativeTestPoints)
|
protected void |
setCumulativeTestValues(double[] cumulativeTestValues)
|
protected void |
setDensityTestPoints(int[] densityTestPoints)
|
protected void |
setDensityTestValues(double[] densityTestValues)
|
protected void |
setDistribution(IntegerDistribution distribution)
|
protected void |
setInverseCumulativeTestPoints(double[] inverseCumulativeTestPoints)
|
protected void |
setInverseCumulativeTestValues(int[] inverseCumulativeTestValues)
|
protected void |
setTolerance(double tolerance)
|
void |
setUp()
Setup sets all test instance data to default values |
void |
tearDown()
Cleans up test instance data |
void |
testConsistencyAtSupportBounds()
|
void |
testCumulativeProbabilities()
Verifies that cumulative probability density calculations match expected values using default test instance data |
void |
testDensities()
Verifies that probability density calculations match expected values using default test instance data |
void |
testIllegalArguments()
Verifies that illegal arguments are correctly handled |
void |
testInverseCumulativeProbabilities()
Verifies that inverse cumulative probability density calculations match expected values using default test instance data |
void |
testSampling()
Test sampling |
protected void |
verifyCumulativeProbabilities()
Verifies that cumulative probability density calculations match expected values using current test instance data |
protected void |
verifyDensities()
Verifies that probability density calculations match expected values using current test instance data |
protected void |
verifyInverseCumulativeProbabilities()
Verifies that inverse cumulative probability density calculations match expected values using current test instance data |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IntegerDistributionAbstractTest()
| Method Detail |
|---|
public abstract IntegerDistribution makeDistribution()
public abstract int[] makeDensityTestPoints()
public abstract double[] makeDensityTestValues()
public abstract int[] makeCumulativeTestPoints()
public abstract double[] makeCumulativeTestValues()
public abstract double[] makeInverseCumulativeTestPoints()
public abstract int[] makeInverseCumulativeTestValues()
public void setUp()
public void tearDown()
protected void verifyDensities()
protected void verifyCumulativeProbabilities()
protected void verifyInverseCumulativeProbabilities()
public void testDensities()
public void testCumulativeProbabilities()
public void testInverseCumulativeProbabilities()
public void testConsistencyAtSupportBounds()
public void testIllegalArguments()
public void testSampling()
protected int[] getCumulativeTestPoints()
protected void setCumulativeTestPoints(int[] cumulativeTestPoints)
cumulativeTestPoints - The cumulativeTestPoints to set.protected double[] getCumulativeTestValues()
protected void setCumulativeTestValues(double[] cumulativeTestValues)
cumulativeTestValues - The cumulativeTestValues to set.protected int[] getDensityTestPoints()
protected void setDensityTestPoints(int[] densityTestPoints)
densityTestPoints - The densityTestPoints to set.protected double[] getDensityTestValues()
protected void setDensityTestValues(double[] densityTestValues)
densityTestValues - The densityTestValues to set.protected IntegerDistribution getDistribution()
protected void setDistribution(IntegerDistribution distribution)
distribution - The distribution to set.protected double[] getInverseCumulativeTestPoints()
protected void setInverseCumulativeTestPoints(double[] inverseCumulativeTestPoints)
inverseCumulativeTestPoints - The inverseCumulativeTestPoints to set.protected int[] getInverseCumulativeTestValues()
protected void setInverseCumulativeTestValues(int[] inverseCumulativeTestValues)
inverseCumulativeTestValues - The inverseCumulativeTestValues to set.protected double getTolerance()
protected void setTolerance(double tolerance)
tolerance - The tolerance to set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||