Documentation of 'javanpst.tests.goodness.chiSquareTest.ChiSquareTest' Java class
ChiSquareTest
javanpst.tests.goodness.chiSquareTest

Class 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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void adjustBinomial(int N)
      Sets the distribution to adjust as a binomial distribution with N parameter.
      void adjustBinomial(int N, double P)
      Sets the distribution to adjust as a binomial distribution with N and P parameters
      void adjustGeometric(double P)
      Sets the distribution to adjust as a Geometric distribution with P parameter.
      void adjustPoisson()
      Sets the distribution to adjust as a Poisson distribution.
      void adjustPoisson(int K)
      Sets the distribution to adjust as a Poisson distribution with K mean.
      void adjustUniform(int N)
      Sets the distribution to adjust as a uniform distribution with N parameter
      void clearData()
      Clears the data stored in the test
      void doTest()
      Performs the test
      double getPValue()
      Get p-value of the test
      double getQ()
      Get Q statistic
      java.lang.String printData()
      Prints the data stored in the test
      java.lang.String printReport()
      Prints a report with the results of the test
      void setData(DataTable newData)
      Load data to test.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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:
        clearData in class StatisticalTest
      • 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 distribution
        P - 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
      • 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:
        printData in class StatisticalTest
        Returns:
        Data stored
      • printReport

        public java.lang.String printReport()
        Prints a report with the results of the test
        Specified by:
        printReport in class StatisticalTest
        Returns:
        Output report

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.