commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob MacCallum <r.maccal...@imperial.ac.uk>
Subject [math] ANOVA proposal
Date Wed, 14 Nov 2007 13:41:06 GMT

Hello,

The org.apache.commons.math.stat.* packages are exactly what we need for our
microarray analysis web application except for the lack of an ANOVA class (the
FDistribution is already there however).  I have coded this up and it seems to
produce the same output as R's anova(lm(data)) - as described in more detail
in the test suite.

I have added the following to my anonymous SVN checkout:

src/test/org/apache/commons/math/stat/inference/AnovaTest.java
src/java/org/apache/commons/math/stat/inference/Anova.java
src/java/org/apache/commons/math/stat/inference/AnovaImpl.java

Should I add this to a bugzilla ticket for you guys to look at?  How do I get
a suitable patch file?  If I do svn diff, these new files are not in
subversion...  Or should I just tar up these files?

I guess one issue is naming... Should it be called UnivariateAnova, for
example?

Here are the methods from interface definition as a taster.
As you can see, I need to flesh out the documentation some more.

    /**
     * Computes the ANOVA F-value for a set of data in two or more classes.
     *
     * @param classdata  Hashtable - key = classname, values = double[]
     * @return Fvalue
     * @throws IllegalArgumentException if the precondition is not met
     * @throws MathException if the statistic can not be computed do to a
     *         convergence or other numerical error.
     */
    public abstract double anovaFValue(Hashtable classdata)
        throws IllegalArgumentException, MathException;

    /**
     * Computes the ANOVA P-value for a set of data in two or more classes.
     *
     * @param classdata  Hashtable - key = classname, values = double[]
     * @return Pvalue
     * @throws IllegalArgumentException if the precondition is not met
     * @throws MathException if the statistic can not be computed do to a
     *         convergence or other numerical error.
     */
    public abstract double anovaPValue(Hashtable classdata)
        throws IllegalArgumentException, MathException;


I have followed TTest as a style guide.

cheers,
Bob.


-- 
Bob MacCallum | VectorBase Developer | Kafatos/Christophides Groups |
Division of Cell and Molecular Biology | Imperial College London |
Phone +442075941945 | Email r.maccallum@imperial.ac.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message