Commit Graph

5417 Commits

Author SHA1 Message Date
Mark R. Diggory acde85f2bf Improved Variance calculation, test for negative variance and added some more javadoc.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140887 13f79535-47bb-0310-9956-ffa450edef68
2003-06-04 04:05:39 +00:00
Mark R. Diggory b3dd72f6e0 Adjusted the code to be able to control the files used and the tolerance for each file (important, hard tests currently require lower tolerance to pass).
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140886 13f79535-47bb-0310-9956-ffa450edef68
2003-06-04 04:03:55 +00:00
Mark R. Diggory ba74c2510f PR: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20442
Submitted by:	Phil Steitz


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140885 13f79535-47bb-0310-9956-ffa450edef68
2003-06-04 02:45:49 +00:00
Mark R. Diggory fe27566380 PR: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20404
Submitted by:	Phil Steitz


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140884 13f79535-47bb-0310-9956-ffa450edef68
2003-06-04 02:40:26 +00:00
Mark R. Diggory 42e427ce8c PR: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20390
Submitted by:	Phil Steitz


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140883 13f79535-47bb-0310-9956-ffa450edef68
2003-06-04 02:31:14 +00:00
Mark R. Diggory 516c15d88b PR: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20377
Submitted by:	Phil Steitz


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140882 13f79535-47bb-0310-9956-ffa450edef68
2003-06-04 02:24:51 +00:00
Mark R. Diggory 11898601e0 PR: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20375
Submitted by:	Albert Davidson Chou


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140881 13f79535-47bb-0310-9956-ffa450edef68
2003-06-04 02:17:17 +00:00
Mark R. Diggory 108ea5741c Changing the name of data files, the default javac target in the ant file misses files of the extension "dat"
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140880 13f79535-47bb-0310-9956-ffa450edef68
2003-06-02 05:21:06 +00:00
Mark R. Diggory 546eeaf219 Commenting out testUnivariateImpl unitl I figure out why this fails in UnivariateImpl
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140879 13f79535-47bb-0310-9956-ffa450edef68
2003-06-02 04:58:33 +00:00
Mark R. Diggory 736e42145c project.xml had two dependencies sections, I removed the empty one.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140878 13f79535-47bb-0310-9956-ffa450edef68
2003-06-02 04:48:21 +00:00
Mark R. Diggory 5a755b8f82 Removed System.out's
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140877 13f79535-47bb-0310-9956-ffa450edef68
2003-06-02 04:27:26 +00:00
Mark R. Diggory 60314410e2 Initial Certified Tests for Univariate. Note UnivariateImpl currently fails
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140876 13f79535-47bb-0310-9956-ffa450edef68
2003-06-02 04:25:52 +00:00
Tim O'Brien d23bf18b40 Licensing issues have prompted the removal of all source reliant on
Gamma.java.  Gamma.java explicitly stated that it was "based on" an
implementation from Numerical Recipes in C.  Please see
http://www.nr.com/infotop.html - these implementations (and derivatives
of these works) are covered under restrictive licensing terms.  This
code will be removed from the repository until these issues can be
addressed.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140875 13f79535-47bb-0310-9956-ffa450edef68
2003-06-02 03:44:13 +00:00
Mark R. Diggory 6aa45e2047 This is the new build.xml file generated by Maven. This was generated using the latest checkout of Maven.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140874 13f79535-47bb-0310-9956-ffa450edef68
2003-06-02 02:34:03 +00:00
Mark R. Diggory 91f675100d Adding myself to the developers
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140873 13f79535-47bb-0310-9956-ffa450edef68
2003-06-01 15:43:40 +00:00
Tim O'Brien 25b3e45109 * add the numerical analysis and prob/stat references that have been posted or
included in javadoc recently, plus a few more generic references.
* update the task list based on accomplishments and discussion

PR: Issue 20357
Obtained from: Bugzilla
Submitted by: Phil Steitz
Reviewed by: Tim O'Brien


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140872 13f79535-47bb-0310-9956-ffa450edef68
2003-05-30 15:40:28 +00:00
Tim O'Brien 70c8906868 Removed tasklist report, until this has content, no reason for the added distraction
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140871 13f79535-47bb-0310-9956-ffa450edef68
2003-05-29 23:30:48 +00:00
Tim O'Brien a0ff9fd630 linkcheck report was throwing 404s for every URL, I've removed it until someone can generate a meaningful report
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140870 13f79535-47bb-0310-9956-ffa450edef68
2003-05-29 23:26:24 +00:00
Tim O'Brien 429a652114 Removed old Univariate tests
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140869 13f79535-47bb-0310-9956-ffa450edef68
2003-05-29 23:25:12 +00:00
Tim O'Brien e9488d7cf6 Checkstyle should check that each source file include a license
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140868 13f79535-47bb-0310-9956-ffa450edef68
2003-05-29 23:25:00 +00:00
Tim O'Brien a286c243eb Moved all Univariate and Bivariate stats interfaces and classes to the math.stat package
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140867 13f79535-47bb-0310-9956-ffa450edef68
2003-05-29 20:35:46 +00:00
Tim O'Brien be5a9fb219 Patch adds getSkewness and getKurtosis to Univariate and an implimentation
in UnivariateImpl. It also adds test for NaN and 0.0 to UnivariateImplTest

PR: Issue 20250
Obtained from: Bugzilla
Submitted by: Mark Diggory
Reviewed by: Tim O'Brien


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140866 13f79535-47bb-0310-9956-ffa450edef68
2003-05-29 19:49:18 +00:00
Tim O'Brien 8a13741f2d Adds the following two capabilities to RandomData: Generating random permutations
of integers, Generating random samples (returned as Object arrays) from Collections.
Tests validate expected sample distribtution using chi-square tests

PR: Issue 20303
Obtained from: Bugzilla
Submitted by: Phil Steitz
Reviewed by: Tim O'Brien


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140865 13f79535-47bb-0310-9956-ffa450edef68
2003-05-29 19:45:35 +00:00
Tim O'Brien dda7833110 Added an LICENSE.txt in commons-math
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140864 13f79535-47bb-0310-9956-ffa450edef68
2003-05-29 19:41:52 +00:00
Tim O'Brien c9fc45757a Addition of a BeanListUnivariateImpl which can gather univariate statistics on a
List of JavaBeans.  This implementation extends the ListUnivariateImpl, and uses the
PropertyUtils classes from commons-beanutils.  With this implementation, the following
is possible:

List persons = new ArrayList();
// populate array with 100 persons
Univariate ageU = new BeanListUnivariateImpl( persons, "age" );
Univariate incomeU = new BeanListUnivariateImpl( persons, "jobInfo.income" );
System.out.println( "Mean age is: " + ageU.getMean() );
System.out.println( "Mean income is: " + incomeU.getMean() );

Better error handling is needed near our use of PropertyUtils.

This patch introduces a dependency on commons-beanutils, which in turn depends
on commons-collections and commons-logging.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140863 13f79535-47bb-0310-9956-ffa450edef68
2003-05-29 19:41:32 +00:00
Tim O'Brien 3cb56af4e4 Unit tests for previous commit - from Brent Worden's submission in Bugzilla Issue 20279
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140862 13f79535-47bb-0310-9956-ffa450edef68
2003-05-29 19:35:56 +00:00
Tim O'Brien 703fbafa34 Contributions from Brent Worden - Bugzilla Issue 20279
* a distribution factory following the abstract factory pattern.
The value being, if users want to swap out the default distribution
implementations with their own, why stop them.  The factory is responsible for
create the distribution instances (only continuous ones for now).

* Each distribution has a cummulativeProbabilty method which returns the value of
the CDF for a given value.  By default, via the abstract distribution base
class, an inverseCummulativeProbability method is all provided for all
distributions.  It's implementation is generically handled by applying root
finding techniques to the cummulativeProbability method.  That way, when new
distributions are added, authors only need to create the CDF method and the
inverse is provided automatically.

* Currenty, the only distributions are Chi-Squared and Gamma (one actually since
Chi-Squared is a specialized Gamma) but more are planned.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140861 13f79535-47bb-0310-9956-ffa450edef68
2003-05-29 19:34:38 +00:00
Tim O'Brien 03e996b075 Fixed spelling of INFINITE_WINDOW.
PR: 20234
Submitted by: Al Chou


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140860 13f79535-47bb-0310-9956-ffa450edef68
2003-05-26 17:40:20 +00:00
Tim O'Brien 43c787eb35 Adds the one sample, t-test statistic to TestStatistic and implementations.
Also add unit tests. - BW

PR: Issue #20231
Obtained from: Bugzilla
Submitted by: Brent Worden
Reviewed by: Tim O'Brien


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140859 13f79535-47bb-0310-9956-ffa450edef68
2003-05-26 17:29:36 +00:00
Tim O'Brien 57b9151881 An implementation of ordinary least squares regression with one independent
variable. The implementation uses running sums and does not require the data
to be stored in memory.  Since I could not conceive of any significantly
different implementation strategies that did not amount to just improving
efficiency or numerical accuracy of what I am submitting, I did not abstract
the interface.

The test cases validate the computations against NIST reference data and
verified computations. The slope, intercept, their standard errors and
r-square estimates are accurate to within 10E-12 against the reference data
set.  MSE and other ANOVA stats are good at least to within 10E-8. -- Phil S.

PR: Issue #20224
Obtained from: Bugzilla
Submitted by: Phil Steitz
Reviewed by: Tim O'Brien


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140858 13f79535-47bb-0310-9956-ffa450edef68
2003-05-26 02:11:50 +00:00
Tim O'Brien b84e61ffcf From Phil Steitz patch submission for Issue #20175
The attached patch includes the following improvements to Univariate and
UnivariateImpl:

* Improved efficiency of min, max and product maintenance when windowSize is
  limited by incorporating suggestion posted to commons-dev by Brend Worden
  (added author credit).  Thanks, Brent!

* Added javadoc specifying NaN contracts for all statistics, definitions for
  geometric and arithmetic means.

* Made some slight modifications to UnivariateImpl to make it consistent with
  NaN contracts

* All interface documentation moved to Univariate. The interface specification
  includes the NaN semantics and a first attempt at clealy defining exactly
  what "rolling" means and how this effects what statistics are defined when.

* Added test cases to verify that min, max, product are correctly maintained
  when "rolling" and to verify that NaN contracts are satisfied.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140857 13f79535-47bb-0310-9956-ffa450edef68
2003-05-23 17:33:18 +00:00
Tim O'Brien 5918a1fe1e Readded the linkcheck and tasklist reports
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140856 13f79535-47bb-0310-9956-ffa450edef68
2003-05-23 16:28:16 +00:00
Tim O'Brien e0161bb4cf Added mdiggory patch for developer resources
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140855 13f79535-47bb-0310-9956-ffa450edef68
2003-05-22 16:55:22 +00:00
Tim O'Brien 8216dd89b5 RandomDataTest.testNextGaussian() was using Univarite.getN(). Added
an explicit cast from int to double.  Test now succeeds.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140854 13f79535-47bb-0310-9956-ffa450edef68
2003-05-22 15:31:38 +00:00
Tim O'Brien ca304541d8 The EmpiricalDistributionImpl that submitted yesterday assumed the "old"
Univariate interface, in which getN() returned a double.  The attached patch
inserts the necessary casts to avoid the rounding/truncation errors that were
causing the EmpiricalDistribution and ValueServer unit tests to fail.

The patch also adds a RandomData member variable so that getNext() does not
instantiate a new RandomData instance for each activation

PR: Bugzilla #20149
Obtained from: Issue Patch
Submitted by: Phil Steitz
Reviewed by: Tim O'Brien


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140853 13f79535-47bb-0310-9956-ffa450edef68
2003-05-22 15:19:32 +00:00
Tim O'Brien 1376d960b5 Added task to bring javadoc into compliance with standard. Javadoc
generate currently throws 35 errors.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140852 13f79535-47bb-0310-9956-ffa450edef68
2003-05-21 18:24:46 +00:00
Tim O'Brien 8ed6e84dc6 Added Product and Mean to Univariate and all implementations, this patch
contains contributions from Mark Diggory.

* This patch introduces Product and GeometricMean into the Univariate
implementation.

* Discarding the contribution of a discarded element in a rolling
UnivariateImpl requires that the product be calculated explicitly each
time a value is discarded.  This is necessary because not all values will
have non-zero values.

* Errors in rolling logic for ListUimpl, and UnivariateImpl were corrected,
and more test cases were added to the JUnit tests for the Univariate
implementations.  More rigorous test cases are needed for the entire
suite of Univariate implementations


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140851 13f79535-47bb-0310-9956-ffa450edef68
2003-05-21 17:59:20 +00:00
Tim O'Brien a3e8ae46e0 xdoc tasks.xml was updated to reflect tasks pertaining to the next planned
release.  There tasks were lifted from Phil S. earlier message to
commons-dev@


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140850 13f79535-47bb-0310-9956-ffa450edef68
2003-05-21 15:11:54 +00:00
Tim O'Brien 60bf133582 project.properties changes. 1. The build will not fail on a failed
unit test, 2. The date/time and version are included in the xdoc
transformation, 3. JUnit is now forker, and 4. We use checkstyle.properties
to customize the behavior of Checkstyle.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140849 13f79535-47bb-0310-9956-ffa450edef68
2003-05-21 15:10:51 +00:00
Tim O'Brien 5de3587b86 Commited patch for issue 20112 from Phil Steitz.
EmpiricalDistribution -- represents an empirical probability distribution and
supports generation of data values that are "like" values in an input file
without making any assumptions about the functional form of the probability
distribution that the data come from.   This is useful in simulation
applications where historical data about component performance are
available but do not follow standard distributions (or any application that
requires random data generation from an empirical distribution). Also
generates data for grouped frequency histograms based on the input file.

ValueServer -- a wrapper for RandomData and EmpiricalDistribution that
generates values in each of the following modes:
  * DIGEST_MODE -- uses an empirical distribution
  * REPLAY_MODE -- replays data from an input file
  * UNIFORM_MODE -- generates uniformly distributed random values
  * EXPONENTIAL_MODE -- generates exponentially distributed random
                        values
  * GAUSSIAN_MODE -- generates Gaussian distributed random values
  * CONSTANT_MODE -- returns the same value every time.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140848 13f79535-47bb-0310-9956-ffa450edef68
2003-05-21 14:21:15 +00:00
Tim O'Brien a99cbac0bb Updated class javadoc for ContractableDoubleArray
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140847 13f79535-47bb-0310-9956-ffa450edef68
2003-05-21 06:46:26 +00:00
Tim O'Brien 246d50aa44 Added more substantial class javadoc to ExpandableDoubleArray
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140846 13f79535-47bb-0310-9956-ffa450edef68
2003-05-21 06:24:30 +00:00
Tim O'Brien 5d9efdbcd4 Added javadoc to FixedDA and altered exceptions in DoubleArray
* One should be able to use a DoubleArray in a similar way to a
regular double[], to this effect methods for accessing element
values will no longer throw NoSuchElementExceptions when an
index is outside of the element set.  These method all throw
ArrayIndexOutOfBoundException if a bad index is supplied.

* Filled out javadoc in FixedDoubleArray.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140845 13f79535-47bb-0310-9956-ffa450edef68
2003-05-21 05:48:25 +00:00
Robert Burrell Donkin 7d540cfa99 Corrected upload directory.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140844 13f79535-47bb-0310-9956-ffa450edef68
2003-05-20 19:54:58 +00:00
Tim O'Brien 437e275a50 Updated source code to reflect Jakarta source code guidelines specifically
tab characters.  Changes were driven by Checkstyle report on
http://jakarta.apache.org/commons/sandbox/math


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140843 13f79535-47bb-0310-9956-ffa450edef68
2003-05-20 18:15:29 +00:00
Tim O'Brien a008ed1316 Added Mark Diggory as a contributor
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140842 13f79535-47bb-0310-9956-ffa450edef68
2003-05-20 13:24:50 +00:00
Robert Burrell Donkin 118ae33102 Created outline user guide This will be built using maven. Lots more content needed.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140841 13f79535-47bb-0310-9956-ffa450edef68
2003-05-20 10:27:57 +00:00
Robert Burrell Donkin 526e1c4171 Created outline documentation. This will be built using maven. Lots more content needed.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140840 13f79535-47bb-0310-9956-ffa450edef68
2003-05-20 10:27:26 +00:00
Robert Burrell Donkin 2ebf818b42 Mavenization phase one - moving documentation build to maven, will complete by generating build.xml etc later.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140839 13f79535-47bb-0310-9956-ffa450edef68
2003-05-20 10:24:32 +00:00
Tim O'Brien 60f4205f1f Phil Steitz wrote:
This commit contains the suite of random data generation utilities that
I originally
proposed as extensions to lang.math.  There is some functional overlap
with lang.math, but the contract and intention of this implementation is
different in several significant ways.

* the lang implementation maintains "immutability" of the underlying
   random number generator (emulating Math). The RandomData
   implementation allows users to reseed the random number generator(s)
   (this is in effect possible in the recent extensions to lang.math by
   passing in a user-supplied random as an actual parameter to the
   next() methods) Users can also reset the PRNG algorithm and provider
   used by the "secure" methods.

* RandomData includes "secure" methods (delegating to SecureRandom)

* RandomData will generate random deviates from exponential and poisson,
   as well as Gaussian and Uniform distributions.  These are useful in
   simulation applications.

* Overlapping somewhat with lang.StringUtils, RandomData will generate
   random hex strings.  There is a nextSecureHexString method that will
   (I claim :-) generate cryptographically secure string identifiers. I
   would appreciate feedback on this algorithm, which I have seen used
   elsewhere (similar to what tomcat does to generate session ids); but
   not documented as a standard.

PR: Bugzilla 20013
Obtained from: Phil S.
Submitted by: Phil S.
Reviewed by: Tim O.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@140838 13f79535-47bb-0310-9956-ffa450edef68
2003-05-18 00:58:52 +00:00