~ubuntu-branches/ubuntu/maverick/commons-math/maverick

« back to all changes in this revision

Viewing changes to src/java/org/apache/commons/math/stat/inference/OneWayAnova.java

  • Committer: Bazaar Package Importer
  • Author(s): Damien Raude-Morvan
  • Date: 2009-08-22 01:13:25 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090822011325-hi4peq1ua5weguwn
Tags: 2.0-1
* New upstream release.
* Set Maintainer field to Debian Java Team
* Add myself as Uploaders
* Switch to Quilt patch system:
  - Refresh all patchs
  - Remove B-D on dpatch, Add B-D on quilt
  - Include patchsys-quilt.mk in debian/rules
* Bump Standards-Version to 3.8.3:
  - Add a README.source to describe patch system
* Maven POMs:
  - Add a Build-Depends-Indep dependency on maven-repo-helper
  - Use mh_installpom and mh_installjar to install the POM and the jar to the
    Maven repository
* Use default-jdk/jre:
  - Depends on java5-runtime-headless
  - Build-Depends on default-jdk
  - Use /usr/lib/jvm/default-java as JAVA_HOME
* Move api documentation to /usr/share/doc/libcommons-math-java/api
* Build-Depends on junit4 instead of junit

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 
 * contributor license agreements.  See the NOTICE file distributed with
4
 
 * this work for additional information regarding copyright ownership.
5
 
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 
 * (the "License"); you may not use this file except in compliance with
7
 
 * the License.  You may obtain a copy of the License at
8
 
 *
9
 
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 
 *
11
 
 * Unless required by applicable law or agreed to in writing, software
12
 
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 
 * See the License for the specific language governing permissions and
15
 
 * limitations under the License.
16
 
 */
17
 
package org.apache.commons.math.stat.inference;
18
 
 
19
 
import org.apache.commons.math.MathException;
20
 
import java.util.Collection;
21
 
 
22
 
/**
23
 
 * An interface for one-way ANOVA (analysis of variance). 
24
 
 *
25
 
 * <p> Tests for differences between two or more categories of univariate data
26
 
 * (for example, the body mass index of accountants, lawyers, doctors and
27
 
 * computer programmers).  When two categories are given, this is equivalent to
28
 
 * the {@link org.apache.commons.math.stat.inference.TTest}.
29
 
 * </p>
30
 
 *
31
 
 * @since 1.2
32
 
 * @version $Revision$ $Date$ 
33
 
 */
34
 
public interface OneWayAnova {
35
 
    /**
36
 
     * Computes the ANOVA F-value for a collection of <code>double[]</code>
37
 
     * arrays.
38
 
     * 
39
 
     * <p><strong>Preconditions</strong>: <ul>
40
 
     * <li>The categoryData <code>Collection</code> must contain
41
 
     * <code>double[]</code> arrays.</li>
42
 
     * <li> There must be at least two <code>double[]</code> arrays in the
43
 
     * <code>categoryData</code> collection and each of these arrays must
44
 
     * contain at least two values.</li></ul></p>
45
 
     *
46
 
     * @param categoryData <code>Collection</code> of <code>double[]</code>
47
 
     * arrays each containing data for one category
48
 
     * @return Fvalue
49
 
     * @throws IllegalArgumentException if the preconditions are not met
50
 
     * @throws MathException if the statistic can not be computed do to a
51
 
     *         convergence or other numerical error.
52
 
     */
53
 
    public double anovaFValue(Collection categoryData)
54
 
        throws IllegalArgumentException, MathException;
55
 
 
56
 
    /**
57
 
     * Computes the ANOVA P-value for a collection of <code>double[]</code>
58
 
     * arrays.
59
 
     *
60
 
     * <p><strong>Preconditions</strong>: <ul>
61
 
     * <li>The categoryData <code>Collection</code> must contain
62
 
     * <code>double[]</code> arrays.</li>
63
 
     * <li> There must be at least two <code>double[]</code> arrays in the
64
 
     * <code>categoryData</code> collection and each of these arrays must
65
 
     * contain at least two values.</li></ul></p>
66
 
     *
67
 
     * @param categoryData <code>Collection</code> of <code>double[]</code>
68
 
     * arrays each containing data for one category
69
 
     * @return Pvalue
70
 
     * @throws IllegalArgumentException if the preconditions are not met
71
 
     * @throws MathException if the statistic can not be computed do to a
72
 
     *         convergence or other numerical error.
73
 
     */
74
 
    public double anovaPValue(Collection categoryData)
75
 
        throws IllegalArgumentException, MathException;
76
 
 
77
 
    /**
78
 
     * Performs an ANOVA test, evaluating the null hypothesis that there
79
 
     * is no difference among the means of the data categories.
80
 
     * 
81
 
     * <p><strong>Preconditions</strong>: <ul>
82
 
     * <li>The categoryData <code>Collection</code> must contain
83
 
     * <code>double[]</code> arrays.</li>
84
 
     * <li> There must be at least two <code>double[]</code> arrays in the
85
 
     * <code>categoryData</code> collection and each of these arrays must
86
 
     * contain at least two values.</li>
87
 
     * <li>alpha must be strictly greater than 0 and less than or equal to 0.5.
88
 
     * </li></ul></p>
89
 
     *
90
 
     * @param categoryData <code>Collection</code> of <code>double[]</code>
91
 
     * arrays each containing data for one category
92
 
     * @param alpha significance level of the test
93
 
     * @return true if the null hypothesis can be rejected with 
94
 
     * confidence 1 - alpha
95
 
     * @throws IllegalArgumentException if the preconditions are not met
96
 
     * @throws MathException if the statistic can not be computed do to a
97
 
     *         convergence or other numerical error.
98
 
    */
99
 
    public boolean anovaTest(Collection categoryData, double alpha)
100
 
        throws IllegalArgumentException, MathException;
101
 
 
102
 
}
 
 
b'\\ No newline at end of file'