Submitted by:	phil@steitz.com

I applied this patch on the sourcecode, I think all project.xml and 
xdoc documentation should retain some authorship at this time. If 
we decide otherwise we can change this in the future.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140974 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark R. Diggory 2003-07-07 23:19:22 +00:00
parent 4bf125a356
commit 7b6c61666e
44 changed files with 156 additions and 84 deletions

View File

@ -56,8 +56,7 @@ package org.apache.commons.math.linear;
/**
* Interface defining a real-valued matrix with basic algebraic operations
* @author Phil Steitz
* @version $Revision: 1.2 $ $Date: 2003/06/25 01:39:36 $
* @version $Revision: 1.3 $ $Date: 2003/07/07 23:19:22 $
*/
public interface RealMatrix {

View File

@ -78,8 +78,7 @@ import java.io.Serializable;
* explicitly invoke <code>LUDecompose()</code> to recompute the decomposition
* before using any of the methods above.
*
* @author Phil Steitz
* @version $Revision: 1.2 $ $Date: 2003/06/25 01:39:36 $
* @version $Revision: 1.3 $ $Date: 2003/07/07 23:19:22 $
*/
public class RealMatrixImpl implements RealMatrix, Serializable {

View File

@ -80,8 +80,7 @@ import org.apache.commons.math.stat.Univariate;
* build grouped frequnecy histograms representing the input data or to
* generate random values "like" those in the input file -- i.e., the values
* generated will follow the distribution of the values in the file.
* @author Phil Steitz
* @version $Revision: 1.1 $
* @version $Revision: 1.2 $
*/
public interface EmpiricalDistribution {

View File

@ -89,8 +89,7 @@ import org.apache.commons.math.stat.UnivariateImpl;
* entry per line.</li>
* </ol></p>
*
* @author Phil Steitz
* @version $Revision: 1.1 $
* @version $Revision: 1.2 $
*/
public class EmpiricalDistributionImpl implements Serializable,EmpiricalDistribution {

View File

@ -57,8 +57,7 @@ import java.util.Collection;
/**
* Random data generation utilities
* @author Phil Steitz
* @version $Revision: 1.1 $ $Date: 2003/06/22 03:57:57 $
* @version $Revision: 1.2 $ $Date: 2003/07/07 23:19:21 $
*/
public interface RandomData {
/**

View File

@ -104,8 +104,7 @@ import java.util.Collection;
* (so secure sequences started with calls to reseedSecure(long) won't be
* identical).</li></ul>
*
* @author Phil Steitz
* @version $Revision: 1.1 $ $Date: 2003/06/22 03:57:57 $
* @version $Revision: 1.2 $ $Date: 2003/07/07 23:19:21 $
*/
public class RandomDataImpl implements RandomData {

View File

@ -78,8 +78,7 @@ import java.net.MalformedURLException;
* standard deviation = <code>sigma</code></li>
* <li> CONSTANT_MODE -- returns <code>mu</code> every time.</li></ul>
*
* @author Phil Steitz
* @version $Revision: 1.1 $
* @version $Revision: 1.2 $
*
*/
public class ValueServer {

View File

@ -59,7 +59,6 @@ import java.util.Arrays;
*
* @author <a href="mailto:tobrien@apache.org">Tim O'Brien</a>
* @author Mark Diggory
* @author <a href="mailto:phil@steitz.com">Phil Steitz</a>
*/
public abstract class AbstractStoreUnivariate implements StoreUnivariate {

View File

@ -84,8 +84,7 @@ import org.apache.commons.math.stat.distribution.TDistribution;
* the necessary computations to return the requested statistic.</li>
* </ul>
*
* @author Phil Steitz
* @version $Revision: 1.3 $ $Date: 2003/06/21 02:13:41 $
* @version $Revision: 1.4 $ $Date: 2003/07/07 23:19:20 $
*/
public class BivariateRegression {

View File

@ -63,7 +63,6 @@ import org.apache.commons.collections.HashBag;
* Accepts int, long or string values, converting
* all to Strings and maintaining frequency counts.
*
* @author Phil Steitz
*/
public class Frequency {
/** name for this frequency distribution. */

View File

@ -55,8 +55,7 @@ package org.apache.commons.math.stat;
/**
* A collection of commonly used test statistics and statistical tests.
*
* @author Phil Steitz
* @version $Revision: 1.2 $ $Date: 2003/06/25 01:35:46 $
* @version $Revision: 1.3 $ $Date: 2003/07/07 23:19:20 $
*
*/
public interface TestStatistic {

View File

@ -61,8 +61,7 @@ import org.apache.commons.math.stat.distribution.ChiSquaredDistribution;
/**
* Implements test statistics defined in the TestStatistic interface.
*
* @author Phil Steitz
* @version $Revision: 1.2 $ $Date: 2003/06/25 01:35:46 $
* @version $Revision: 1.3 $ $Date: 2003/07/07 23:19:20 $
*
*/
public class TestStatisticImpl implements TestStatistic {

View File

@ -70,10 +70,9 @@ package org.apache.commons.math.stat;
* The default windowSize is "infinite" -- i.e., all values added are included
* in all computations.
*
* @author Phil Steitz
* @author <a href="mailto:tobrien@apache.org">Tim O'Brien</a>
* @author <a href="mailto:mdiggory@apache.org">Mark Diggory</a>
* @version $Revision: 1.5 $ $Date: 2003/07/05 19:25:38 $
* @version $Revision: 1.6 $ $Date: 2003/07/07 23:19:20 $
*
*/
public interface Univariate {

View File

@ -66,12 +66,11 @@ import org.apache.commons.math.util.FixedDoubleArray;
* Integers, floats and longs can be added, but they will be converted
* to doubles by addValue().
*
* @author Phil Steitz
* @author <a href="mailto:tobrien@apache.org">Tim O'Brien</a>
* @author <a href="mailto:mdiggory@apache.org">Mark Diggory</a>
* @author Brent Worden
* @author <a href="mailto:HotFusionMan@Yahoo.com">Albert Davidson Chou</a>
* @version $Revision: 1.15 $ $Date: 2003/06/22 03:57:55 $
* @version $Revision: 1.16 $ $Date: 2003/07/07 23:19:20 $
*
*/
public class UnivariateImpl implements Univariate, Serializable {

View File

@ -57,8 +57,7 @@ package org.apache.commons.math.util;
/**
* Some useful additions to the built-in functions in lang.Math<p>
*
* @author Phil Steitz
* @version $Revision: 1.1 $ $Date: 2003/06/22 03:57:56 $
* @version $Revision: 1.2 $ $Date: 2003/07/07 23:19:22 $
*/
public class MathUtils {

View File

@ -60,8 +60,7 @@ import junit.framework.TestSuite;
/**
* Test cases for the {@link RealMatrixImpl} class.
*
* @author Phil Steitz
* @version $Revision: 1.2 $ $Date: 2003/06/25 01:39:36 $
* @version $Revision: 1.3 $ $Date: 2003/07/07 23:19:22 $
*/
public final class RealMatrixImplTest extends TestCase {

View File

@ -65,8 +65,7 @@ import org.apache.commons.math.stat.UnivariateImpl;
/**
* Test cases for the EmpiricalDistribution class
*
* @author Phil Steitz
* @version $Revision: 1.1 $ $Date: 2003/06/22 03:57:56 $
* @version $Revision: 1.2 $ $Date: 2003/07/07 23:19:21 $
*/
public final class EmpiricalDistributionTest extends TestCase {

View File

@ -68,8 +68,7 @@ import org.apache.commons.math.stat.UnivariateImpl;
/**
* Test cases for the RandomData class.
*
* @author Phil Steitz
* @version $Revision: 1.1 $ $Date: 2003/06/22 03:57:56 $
* @version $Revision: 1.2 $ $Date: 2003/07/07 23:19:21 $
*/
public final class RandomDataTest extends TestCase {

View File

@ -64,8 +64,7 @@ import org.apache.commons.math.stat.UnivariateImpl;
/**
* Test cases for the ValueServer class.
*
* @author Phil Steitz
* @version $Revision: 1.1 $
* @version $Revision: 1.2 $
*/
public final class ValueServerTest extends TestCase {

View File

@ -59,8 +59,7 @@ import junit.framework.TestSuite;
/**
* Test cases for the TestStatistic class.
*
* @author Phil Steitz
* @version $Revision: 1.3 $ $Date: 2003/06/21 02:13:41 $
* @version $Revision: 1.4 $ $Date: 2003/07/07 23:19:19 $
*/
public final class BivariateRegressionTest extends TestCase {

View File

@ -60,8 +60,7 @@ import junit.framework.TestSuite;
/**
* Test cases for the {@link Frequency} class.
*
* @author Phil Steitz
* @version $Revision: 1.1 $ $Date: 2003/06/22 03:57:53 $
* @version $Revision: 1.2 $ $Date: 2003/07/07 23:19:19 $
*/
public final class FrequencyTest extends TestCase {

View File

@ -63,8 +63,7 @@ import junit.framework.TestSuite;
/**
* Test cases for the {@link Univariate} class.
*
* @author <a href="mailto:phil@steitz.com">Phil Steitz</a>
* @version $Revision: 1.4 $ $Date: 2003/06/22 03:57:53 $
* @version $Revision: 1.5 $ $Date: 2003/07/07 23:19:19 $
*/
public final class ListUnivariateImplTest extends TestCase {

View File

@ -60,9 +60,8 @@ import junit.framework.TestSuite;
/**
* Test cases for the {@link StatUtils} class.
*
* @author <a href="mailto:phil@steitz.com">Phil Steitz</a>
* @author <a href="mailto:mdiggory@apache.org">Mark Diggory</a>
* @version $Revision: 1.3 $ $Date: 2003/06/24 14:08:40 $
* @version $Revision: 1.4 $ $Date: 2003/07/07 23:19:19 $
*/
public final class StatUtilsTest extends TestCase {

View File

@ -63,8 +63,7 @@ import org.apache.commons.math.random.RandomDataImpl;
/**
* Test cases for the {@link Univariate} class.
*
* @author <a href="mailto:phil@steitz.com">Phil Steitz</a>
* @version $Revision: 1.4 $ $Date: 2003/06/22 03:57:53 $
* @version $Revision: 1.5 $ $Date: 2003/07/07 23:19:19 $
*/
public final class StoreUnivariateImplTest extends TestCase {

View File

@ -59,8 +59,7 @@ import junit.framework.TestSuite;
/**
* Test cases for the TestStatistic class.
*
* @author Phil Steitz
* @version $Revision: 1.2 $ $Date: 2003/06/25 01:35:46 $
* @version $Revision: 1.3 $ $Date: 2003/07/07 23:19:19 $
*/
public final class TestStatisticTest extends TestCase {

View File

@ -60,9 +60,8 @@ import junit.framework.TestSuite;
/**
* Test cases for the {@link Univariate} class.
*
* @author Phil Steitz
* @author Tim Obrien
* @version $Revision: 1.4 $ $Date: 2003/06/22 03:57:53 $
* @version $Revision: 1.5 $ $Date: 2003/07/07 23:19:19 $
*/
public final class UnivariateImplTest extends TestCase {

View File

@ -0,0 +1,129 @@
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.commons.math.stat.univariate;
import org.apache.commons.math.stat.univariate.moment.FourthMoment;
import org.apache.commons.math.stat.univariate.moment.Kurtosis;
import org.apache.commons.math.stat.univariate.moment.Mean;
import org.apache.commons.math.stat.univariate.moment.Skewness;
import org.apache.commons.math.stat.univariate.moment.Variance;
import junit.framework.TestCase;
/**
*
*/
public class InteractionTest extends TestCase {
protected double mean = 12.40454545454550;
protected double var = 10.00235930735930;
protected double skew = 1.437423729196190;
protected double kurt = 2.377191264804700;
protected double tolerance = 10E-12;
protected double[] testArray =
{
12.5,
12,
11.8,
14.2,
14.9,
14.5,
21,
8.2,
10.3,
11.3,
14.1,
9.9,
12.2,
12,
12.1,
11,
19.8,
11,
10,
8.8,
9,
12.3 };
public InteractionTest(String name) {
super(name);
}
public void testInteraction() {
FourthMoment m4 = new FourthMoment();
Mean m = new Mean(m4);
Variance v = new Variance(m4);
Skewness s= new Skewness(m4);
Kurtosis k = new Kurtosis(m4);
for (int i = 0; i < testArray.length; i++){
m4.increment(testArray[i]);
m.increment(testArray[i]);
v.increment(testArray[i]);
s.increment(testArray[i]);
k.increment(testArray[i]);
}
assertEquals(mean,m.getValue(),tolerance);
assertEquals(var,v.getValue(),tolerance);
assertEquals(skew ,s.getValue(),tolerance);
assertEquals(kurt,k.getValue(),tolerance);
}
}

View File

@ -57,8 +57,6 @@ import junit.framework.TestCase;
/**
* Test cases for the {@link UnivariateStatistic} class.
*
* @author Mark Diggory
*/
public abstract class StorelessUnivariateStatisticAbstractTest
extends UnivariateStatisticAbstractTest {

View File

@ -57,12 +57,12 @@ import junit.framework.TestCase;
/**
* Test cases for the {@link UnivariateStatistic} class.
*
* @author Mark Diggory
*/
public abstract class UnivariateStatisticAbstractTest extends TestCase {
protected double mean = 12.40454545454550;
protected double geoMean = 12.070589161633011;
protected double var = 10.00235930735930;
protected double std = Math.sqrt(var);
protected double skew = 1.437423729196190;

View File

@ -62,8 +62,6 @@ import org.apache.commons.math.stat.univariate.UnivariateStatisticAbstractTest;
/**
* Test cases for the {@link UnivariateStatistic} class.
*
* @author Mark Diggory
*/
public class GeometricMeanTest extends StorelessUnivariateStatisticAbstractTest{

View File

@ -62,8 +62,6 @@ import org.apache.commons.math.stat.univariate.UnivariateStatisticAbstractTest;
/**
* Test cases for the {@link UnivariateStatistic} class.
*
* @author Mark Diggory
*/
public class KurtosisTest extends StorelessUnivariateStatisticAbstractTest{

View File

@ -62,8 +62,6 @@ import org.apache.commons.math.stat.univariate.UnivariateStatisticAbstractTest;
/**
* Test cases for the {@link UnivariateStatistic} class.
*
* @author Mark Diggory
*/
public class MeanTest extends StorelessUnivariateStatisticAbstractTest{

View File

@ -62,8 +62,6 @@ import org.apache.commons.math.stat.univariate.UnivariateStatisticAbstractTest;
/**
* Test cases for the {@link UnivariateStatistic} class.
*
* @author Mark Diggory
*/
public class SkewnessTest extends StorelessUnivariateStatisticAbstractTest{

View File

@ -62,8 +62,6 @@ import org.apache.commons.math.stat.univariate.UnivariateStatisticAbstractTest;
/**
* Test cases for the {@link UnivariateStatistic} class.
*
* @author Mark Diggory
*/
public class StandardDeviationTest extends StorelessUnivariateStatisticAbstractTest{

View File

@ -62,8 +62,6 @@ import org.apache.commons.math.stat.univariate.UnivariateStatisticAbstractTest;
/**
* Test cases for the {@link UnivariateStatistic} class.
*
* @author Mark Diggory
*/
public class VarianceTest extends StorelessUnivariateStatisticAbstractTest{

View File

@ -62,8 +62,6 @@ import org.apache.commons.math.stat.univariate.UnivariateStatisticAbstractTest;
/**
* Test cases for the {@link UnivariateStatistic} class.
*
* @author Mark Diggory
*/
public class MaxTest extends StorelessUnivariateStatisticAbstractTest{

View File

@ -61,8 +61,6 @@ import org.apache.commons.math.stat.univariate.UnivariateStatisticAbstractTest;
/**
* Test cases for the {@link UnivariateStatistic} class.
*
* @author Mark Diggory
*/
public class MedianTest extends UnivariateStatisticAbstractTest{

View File

@ -62,8 +62,6 @@ import org.apache.commons.math.stat.univariate.UnivariateStatisticAbstractTest;
/**
* Test cases for the {@link UnivariateStatistic} class.
*
* @author Mark Diggory
*/
public class MinTest extends StorelessUnivariateStatisticAbstractTest{

View File

@ -61,8 +61,6 @@ import org.apache.commons.math.stat.univariate.UnivariateStatisticAbstractTest;
/**
* Test cases for the {@link UnivariateStatistic} class.
*
* @author Mark Diggory
*/
public class PercentileTest extends UnivariateStatisticAbstractTest{

View File

@ -62,8 +62,6 @@ import org.apache.commons.math.stat.univariate.UnivariateStatisticAbstractTest;
/**
* Test cases for the {@link UnivariateStatistic} class.
*
* @author Mark Diggory
*/
public class ProductTest extends StorelessUnivariateStatisticAbstractTest{

View File

@ -62,8 +62,6 @@ import org.apache.commons.math.stat.univariate.UnivariateStatisticAbstractTest;
/**
* Test cases for the {@link UnivariateStatistic} class.
*
* @author Mark Diggory
*/
public class SumLogTest extends StorelessUnivariateStatisticAbstractTest{

View File

@ -62,8 +62,6 @@ import org.apache.commons.math.stat.univariate.UnivariateStatisticAbstractTest;
/**
* Test cases for the {@link UnivariateStatistic} class.
*
* @author Mark Diggory
*/
public class SumSqTest extends StorelessUnivariateStatisticAbstractTest{

View File

@ -62,8 +62,6 @@ import org.apache.commons.math.stat.univariate.UnivariateStatisticAbstractTest;
/**
* Test cases for the {@link UnivariateStatistic} class.
*
* @author Mark Diggory
*/
public class SumTest extends StorelessUnivariateStatisticAbstractTest{

View File

@ -60,8 +60,7 @@ import junit.framework.TestSuite;
/**
* Test cases for the MathUtils class.
*
* @author Phil Steitz
* @version $Revision: 1.1 $ $Date: 2003/06/22 03:57:55 $
* @version $Revision: 1.2 $ $Date: 2003/07/07 23:19:22 $
*/
public final class MathUtilsTest extends TestCase {