javanpst.tests.randomness.numberRunsTest
Class NumberRunsTest
- java.lang.Object
-
- javanpst.tests.StatisticalTest
-
- javanpst.tests.randomness.numberRunsTest.NumberRunsTest
-
public class NumberRunsTest extends StatisticalTest
A number of runs test. This tests check randomness of a binary string sequence (e.g XYXXYYXXXYXYXXYXYXXY) by analyzing its number of runs. A normal approximation is also provided.
-
-
Constructor Summary
Constructors Constructor and Description NumberRunsTest()Default builderNumberRunsTest(StringSequence newSequence)Builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclearData()Clears the data stored in the testvoiddoTest()Perform the testdoublegetDoublePValue()Get double tail p-valuedoublegetExactDoublePValue()Get double tail exact p-valuedoublegetExactLeftPValue()Get left tail exact p-valuedoublegetExactRightPValue()Get right tail exact p-valuedoublegetLeftPValue()Get left tail p-valuedoublegetN1()Get the number of elements of the less common typedoublegetN2()Get the number of elements of the most common typedoublegetRightPValue()Get right tail p-valuedoublegetRuns()Get the number of runsjava.lang.StringprintData()Prints the data stored in the testjava.lang.StringprintReport()Prints a report with the results of the testvoidsetData(StringSequence newSequence)Builder.-
Methods inherited from class javanpst.tests.StatisticalTest
isDataReady, isPerformed
-
-
-
-
Constructor Detail
-
NumberRunsTest
public NumberRunsTest()
Default builder
-
NumberRunsTest
public NumberRunsTest(StringSequence newSequence)
Builder. Load data to test.- Parameters:
newSequence- data to test.
-
-
Method Detail
-
clearData
public void clearData()
Clears the data stored in the test- Specified by:
clearDatain classStatisticalTest
-
setData
public void setData(StringSequence newSequence)
Builder. Load data to test.- Parameters:
newSequence- data to test.
-
doTest
public void doTest()
Perform the test- Specified by:
doTestin classStatisticalTest
-
getN1
public double getN1()
Get the number of elements of the less common type- Returns:
- n1 value
-
getN2
public double getN2()
Get the number of elements of the most common type- Returns:
- n2 value
-
getRuns
public double getRuns()
Get the number of runs- Returns:
- number of runs
-
getExactLeftPValue
public double getExactLeftPValue()
Get left tail exact p-value- Returns:
- left tail p-value computed
-
getExactRightPValue
public double getExactRightPValue()
Get right tail exact p-value- Returns:
- right tail p-value computed
-
getExactDoublePValue
public double getExactDoublePValue()
Get double tail exact p-value- Returns:
- double tail p-value computed
-
getLeftPValue
public double getLeftPValue()
Get left tail p-value- Returns:
- left tail p-value computed
-
getRightPValue
public double getRightPValue()
Get right tail p-value- Returns:
- right tail p-value computed
-
getDoublePValue
public double getDoublePValue()
Get double tail p-value- Returns:
- double tail p-value computed
-
printData
public java.lang.String printData()
Prints the data stored in the test- Specified by:
printDatain classStatisticalTest- Returns:
- Data stored
-
printReport
public java.lang.String printReport()
Prints a report with the results of the test- Specified by:
printReportin classStatisticalTest- Returns:
- Output report
-
-
DMelt 3.0 © DataMelt by jWork.ORG