javanpst.tests.goodness.chiSquareTest
Class ChiSquareTest
- java.lang.Object
-
- javanpst.tests.StatisticalTest
-
- javanpst.tests.goodness.chiSquareTest.ChiSquareTest
-
public class ChiSquareTest extends StatisticalTest
The Chi-square test. This goodness of fit can be used to test if a given sample follows a discrete distribution. This implementation allow to adjust the data to a uniform, binomial, poisson or geometric distribution.
-
-
Constructor Summary
Constructors Constructor and Description ChiSquareTest()Default builderChiSquareTest(DataTable newData)Builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidadjustBinomial(int N)Sets the distribution to adjust as a binomial distribution with N parameter.voidadjustBinomial(int N, double P)Sets the distribution to adjust as a binomial distribution with N and P parametersvoidadjustGeometric(double P)Sets the distribution to adjust as a Geometric distribution with P parameter.voidadjustPoisson()Sets the distribution to adjust as a Poisson distribution.voidadjustPoisson(int K)Sets the distribution to adjust as a Poisson distribution with K mean.voidadjustUniform(int N)Sets the distribution to adjust as a uniform distribution with N parametervoidclearData()Clears the data stored in the testvoiddoTest()Performs the testdoublegetPValue()Get p-value of the testdoublegetQ()Get Q statisticjava.lang.StringprintData()Prints the data stored in the testjava.lang.StringprintReport()Prints a report with the results of the testvoidsetData(DataTable newData)Load data to test.-
Methods inherited from class javanpst.tests.StatisticalTest
isDataReady, isPerformed
-
-
-
-
Constructor Detail
-
ChiSquareTest
public ChiSquareTest()
Default builder
-
ChiSquareTest
public ChiSquareTest(DataTable newData)
Builder. Load data to test.- Parameters:
newData- data to test.
-
-
Method Detail
-
clearData
public void clearData()
Clears the data stored in the test- Specified by:
clearDatain classStatisticalTest
-
setData
public void setData(DataTable newData)
Load data to test.- Parameters:
newData- data to test.
-
adjustUniform
public void adjustUniform(int N)
Sets the distribution to adjust as a uniform distribution with N parameter- Parameters:
N- N parameter of the distribution
-
adjustBinomial
public void adjustBinomial(int N, double P)Sets the distribution to adjust as a binomial distribution with N and P parameters- Parameters:
N- N parameter of the distributionP- P parameter of the distribution
-
adjustBinomial
public void adjustBinomial(int N)
Sets the distribution to adjust as a binomial distribution with N parameter. P parameter will be estimated from data- Parameters:
N- N parameter of the distribution
-
adjustPoisson
public void adjustPoisson(int K)
Sets the distribution to adjust as a Poisson distribution with K mean.- Parameters:
K- mean of the distribution of the distribution
-
adjustPoisson
public void adjustPoisson()
Sets the distribution to adjust as a Poisson distribution. K parameter (mean) will be estimated from data
-
adjustGeometric
public void adjustGeometric(double P)
Sets the distribution to adjust as a Geometric distribution with P parameter.- Parameters:
P- parameter of the distribution of the distribution
-
doTest
public void doTest()
Performs the test- Specified by:
doTestin classStatisticalTest
-
getQ
public double getQ()
Get Q statistic- Returns:
- Q Statistic
-
getPValue
public double getPValue()
Get p-value of the test- Returns:
- 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