commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject cvs commit: jakarta-commons/math/src/java/org/apache/commons/math/stat/univariate AbstractStorelessUnivariateStatistic.java AbstractUnivariateStatistic.java StorelessUnivariateStatistic.java
Date Sun, 18 Jan 2004 03:45:02 GMT
psteitz     2004/01/17 19:45:02

  Modified:    math/src/java/org/apache/commons/math/stat
                        AbstractDescriptiveStatistics.java
                        AbstractStorelessDescriptiveStatistics.java
                        DescriptiveStatistics.java
               math/src/java/org/apache/commons/math/stat/univariate
                        AbstractStorelessUnivariateStatistic.java
                        AbstractUnivariateStatistic.java
                        StorelessUnivariateStatistic.java
  Log:
  javadoc.
  
  Revision  Changes    Path
  1.2       +4 -3      jakarta-commons/math/src/java/org/apache/commons/math/stat/AbstractDescriptiveStatistics.java
  
  Index: AbstractDescriptiveStatistics.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/math/src/java/org/apache/commons/math/stat/AbstractDescriptiveStatistics.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractDescriptiveStatistics.java	15 Nov 2003 16:01:37 -0000	1.1
  +++ AbstractDescriptiveStatistics.java	18 Jan 2004 03:45:02 -0000	1.2
  @@ -1,7 +1,7 @@
   /* ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2003 The Apache Software Foundation.  All rights
  + * Copyright (c) 2003-2004 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -58,7 +58,8 @@
   import org.apache.commons.math.stat.univariate.rank.Percentile;
   
   /**
  - * Provides univariate measures for an array of doubles. 
  + * Extends {@link AbstractStorelessDescriptiveStatistics} to include univariate statistics
  + * that may require access to the full set of sample values. 
    * @version $Revision$ $Date$
    */
   public abstract class AbstractDescriptiveStatistics
  
  
  
  1.2       +5 -3      jakarta-commons/math/src/java/org/apache/commons/math/stat/AbstractStorelessDescriptiveStatistics.java
  
  Index: AbstractStorelessDescriptiveStatistics.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/math/src/java/org/apache/commons/math/stat/AbstractStorelessDescriptiveStatistics.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractStorelessDescriptiveStatistics.java	15 Nov 2003 16:01:37 -0000	1.1
  +++ AbstractStorelessDescriptiveStatistics.java	18 Jan 2004 03:45:02 -0000	1.2
  @@ -1,7 +1,7 @@
   /* ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2003 The Apache Software Foundation.  All rights
  + * Copyright (c) 2003-2004 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -67,7 +67,9 @@
   import org.apache.commons.math.stat.univariate.summary.SumOfSquares;
   
   /**
  - * Provides univariate measures for an array of doubles.
  + * Provides a default {@link DescriptiveStatistics} implementation, including only statistics
  + * that can be computed in one pass through the data without storing the full set of sample
  + * data values.
    * @version $Revision$ $Date$  
    */
   public abstract class AbstractStorelessDescriptiveStatistics extends DescriptiveStatistics
{
  
  
  
  1.3       +4 -8      jakarta-commons/math/src/java/org/apache/commons/math/stat/DescriptiveStatistics.java
  
  Index: DescriptiveStatistics.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/math/src/java/org/apache/commons/math/stat/DescriptiveStatistics.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DescriptiveStatistics.java	19 Nov 2003 03:28:23 -0000	1.2
  +++ DescriptiveStatistics.java	18 Jan 2004 03:45:02 -0000	1.3
  @@ -1,7 +1,7 @@
   /* ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2003 The Apache Software Foundation.  All rights
  + * Copyright (c) 2003-2004 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -58,12 +58,8 @@
   import org.apache.commons.discovery.tools.DiscoverClass;
   
   /**
  - * DescriptiveStatistics implements the Univariate interface 
  - * but maintains the set of values which contribute to 
  - * the values being returned.  This implementation of 
  - * Univariate provides additional percentile functionality 
  - * such as.  This additional functionality comes with 
  - * a price of increased storage costs.
  + * Abstract factory class for univariate statistical summaries.
  + * 
    * @version $Revision$ $Date$
    */
   public abstract class DescriptiveStatistics implements Serializable{
  
  
  
  1.12      +4 -6      jakarta-commons/math/src/java/org/apache/commons/math/stat/univariate/AbstractStorelessUnivariateStatistic.java
  
  Index: AbstractStorelessUnivariateStatistic.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/math/src/java/org/apache/commons/math/stat/univariate/AbstractStorelessUnivariateStatistic.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- AbstractStorelessUnivariateStatistic.java	14 Nov 2003 22:22:21 -0000	1.11
  +++ AbstractStorelessUnivariateStatistic.java	18 Jan 2004 03:45:02 -0000	1.12
  @@ -1,7 +1,7 @@
   /* ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2003 The Apache Software Foundation.  All rights
  + * Copyright (c) 2003-2004 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -66,10 +66,8 @@
       implements StorelessUnivariateStatistic {
   
       /**
  -     * This implements the AbstractUnivariateStatistic impl to funnel
  -     * calculation off to the instantanious increment method. In most cases of
  -     * StorelessUnivariateStatistic this is never really used because more
  -     * efficient algorithms are available for that statistic.
  +     * This default implementation just calls {@link #increment} in a loop and then {@link
#getResult} to
  +     * compute the return value.  Most implementations will override this method with a
more efficient implementation.
        * @see org.apache.commons.math.stat.univariate.UnivariateStatistic#evaluate(double[],
int, int)
        */
       public double evaluate(
  
  
  
  1.11      +9 -10     jakarta-commons/math/src/java/org/apache/commons/math/stat/univariate/AbstractUnivariateStatistic.java
  
  Index: AbstractUnivariateStatistic.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/math/src/java/org/apache/commons/math/stat/univariate/AbstractUnivariateStatistic.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- AbstractUnivariateStatistic.java	14 Nov 2003 22:22:21 -0000	1.10
  +++ AbstractUnivariateStatistic.java	18 Jan 2004 03:45:02 -0000	1.11
  @@ -1,7 +1,7 @@
   /* ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2003 The Apache Software Foundation.  All rights
  + * Copyright (c) 2003-2004 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -63,8 +63,6 @@
       implements UnivariateStatistic {
   
       /**
  -     * This implementation provides a simple wrapper around the double[]
  -     * and passes the request onto the evaluate(DoubleArray da) method.
        * @see org.apache.commons.math.stat.univariate.UnivariateStatistic#evaluate(double[])
        */
       public double evaluate(final double[] values) {
  @@ -72,7 +70,6 @@
       }
   
       /**
  -     * Subclasses of AbstractUnivariateStatistc need to implement this method.
        * @see org.apache.commons.math.stat.univariate.UnivariateStatistic#evaluate(double[],
int, int)
        */
       public abstract double evaluate(
  @@ -81,14 +78,16 @@
           final int length);
   
       /**
  -     * this protected test method used by all methods to verify the content
  -     * of the array and indicies are correct.
  +     * This method is used by all evaluation methods to verify that the content
  +     * of the array and indices are correct.
  +     * <p>
  +     *  It is used by an individual statistic to determine if calculation
  +     *  should continue, or return <code>Double.NaN</code> </p>
        * @param values Is a double[] containing the values
        * @param begin processing at this point in the array
        * @param length processing at this point in the array
  -     * @return this is used to determine if the array is of 0 length or not,
  -     * it is used by an individual statistic to determine if continuation
  -     * of a statistical calculation should continue or return NaN.
  +     * @return true if the array has postive length
  +     * @throws IllegalArgumentException if the indices are invalid or the array is null
        */
       protected boolean test(
           final double[] values,
  
  
  
  1.13      +13 -20    jakarta-commons/math/src/java/org/apache/commons/math/stat/univariate/StorelessUnivariateStatistic.java
  
  Index: StorelessUnivariateStatistic.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/math/src/java/org/apache/commons/math/stat/univariate/StorelessUnivariateStatistic.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- StorelessUnivariateStatistic.java	19 Nov 2003 03:28:25 -0000	1.12
  +++ StorelessUnivariateStatistic.java	18 Jan 2004 03:45:02 -0000	1.13
  @@ -1,7 +1,7 @@
   /* ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2003 The Apache Software Foundation.  All rights
  + * Copyright (c) 2003-2004 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -54,38 +54,31 @@
   package org.apache.commons.math.stat.univariate;
   
   /**
  - * Extends the capabilities of UnivariateStatistic with a statefull incremental
  - * strategy through three methods for calculating a statistic without having to
  - * maintain a double[] of the values. Because a StorelessUnivariateStatistic
  - * does not require that a double[] storage structure be maintained with the
  - * values in it, there are only a subset of known statistics can actually be
  - * implemented using it. If a Statistic cannot be implemented in a Storeless
  - * approach it should implement the UnivariateStatistic interface directly
  - * instead.
  + * Extends the definition of {@link UnivariateStatistic} with an {@link #increment}
  + * method for adding values and updating internal state incrementally.  This interface
  + * is designed to be used for calculating statistics that can be computed in one pass through
  + * the data without storing the full array of sample values.
  + * 
    * @version $Revision$ $Date$
    */
   public interface StorelessUnivariateStatistic extends UnivariateStatistic {
   
       /**
  -     * Increments the internal state of the Storagless
  -     * Implementation.
  -     * @param d is the value to increment the state by.
  +     * Updates the internal state of the statistic to reflect the addition of the new value.
  +     * @param d  the new value.
        */
       void increment(double d);
   
       /**
  -     * Returns the current state of the statistic after the
  -     * last increment.
  -     * @return value of the statistic, Double.NaN if it
  +     * Returns the current value of the Statistic.
  +     * @return value of the statistic, <code>Double.NaN</code> if it
        * has been cleared or just instantiated.
        */
       double getResult();
   
       /**
  -     * Returns the current state of the statistic after the
  -     * last increment.
  -     * @return value of the statistic, Double.NaN if it
  -     * has been cleared or just instantiated.
  +     * Returns the number of values that have been added.
  +     * @return the number of values.
        */
       double getN();
   
  
  
  

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


Mime
View raw message