Home | History | Annotate | Download | only in inference

Lines Matching refs:counts

58      * expected and observed counts are equal.</p>
60 * @param observed array of observed frequency counts
61 * @param expected array of expected frequency counts
107 * expected and observed counts are equal.</p>
109 * @param observed array of observed frequency counts
110 * @param expected array of expected frequency counts
126 * expected and observed counts are equal.</p>
128 * @param observed array of observed frequency counts
129 * @param expected array of expected frequency counts
147 * @param counts array representation of 2-way table
151 public double chiSquare(long[][] counts) throws IllegalArgumentException {
153 checkArray(counts);
154 int nRows = counts.length;
155 int nCols = counts[0].length;
163 rowSum[row] += counts[row][col];
164 colSum[col] += counts[row][col];
165 total += counts[row][col];
169 // compute expected counts and chi-square
175 sumSq += ((counts[row][col] - expected) *
176 (counts[row][col] - expected)) / expected;
183 * @param counts array representation of 2-way table
188 public double chiSquareTest(long[][] counts)
190 checkArray(counts);
191 double df = ((double) counts.length -1) * ((double) counts[0].length - 1);
193 return 1 - distribution.cumulativeProbability(chiSquare(counts));
197 * @param counts array representation of 2-way table
204 public boolean chiSquareTest(long[][] counts, double alpha)
211 return chiSquareTest(counts) < alpha;
215 * @param observed1 array of observed frequency counts of the first data set
216 * @param observed2 array of observed frequency counts of the second data set
235 // Ensure non-negative counts
286 * @param observed1 array of observed frequency counts of the first data set
287 * @param observed2 array of observed frequency counts of the second data set
301 * @param observed1 array of observed frequency counts of the first data set
302 * @param observed2 array of observed frequency counts of the second data set