smile.stat.hypothesis
Class ChiSqTest
- java.lang.Object
-
- smile.stat.hypothesis.ChiSqTest
-
public class ChiSqTest extends java.lang.ObjectPearson's chi-square test, also known as the chi-square goodness-of-fit test or chi-square test for independence. Note that the chi-square distribution is only approximately valid for large sample size. If a siginficant fraction of bins have small numbers of counts (say, < 10), then it the statistic is not well approximated by a chi-square probability function.
-
-
Field Summary
Fields Modifier and Type Field and Description doublechisqchi-square statisticdoubledfThe degree of freedom of chisq-statistic.doublepvaluep-value
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static ChiSqTesttest(int[] bins, double[] prob)One-sample chisq test.static ChiSqTesttest(int[] bins, double[] prob, int constraints)One-sample chisq test.static ChiSqTesttest(int[] bins1, int[] bins2)Two-sample chisq test.static ChiSqTesttest(int[] bins1, int[] bins2, int constraints)Two-sample chisq test.
-
-
-
Field Detail
-
df
public double df
The degree of freedom of chisq-statistic.
-
chisq
public double chisq
chi-square statistic
-
pvalue
public double pvalue
p-value
-
-
Method Detail
-
test
public static ChiSqTest test(int[] bins, double[] prob)
One-sample chisq test. Given the array bins containing the observed numbers of events, and an array prob containing the expected probabilities of events, and given one constraint, a small value of p-value indicates a significant difference between the distributions.
-
test
public static ChiSqTest test(int[] bins, double[] prob, int constraints)
One-sample chisq test. Given the array bins containing the observed numbers of events, and an array prob containing the expected probabilities of events, and given the number of constraints (normally one), a small value of p-value indicates a significant difference between the distributions.
-
test
public static ChiSqTest test(int[] bins1, int[] bins2)
Two-sample chisq test. Given the arrays bins1 and bins2, containing two sets of binned data, and given one constraint, a small value of p-value indicates a significant difference between the distributions.
-
test
public static ChiSqTest test(int[] bins1, int[] bins2, int constraints)
Two-sample chisq test. Given the arrays bins1 and bins2, containing two sets of binned data, and given the number of constraints (normally one), a small value of p-value indicates a significant difference between the distributions.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG