Java Doc for StatUtils.java in  » Science » Apache-commons-math-1.1 » org » apache » commons » math » stat » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Science » Apache commons math 1.1 » org.apache.commons.math.stat 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.commons.math.stat.StatUtils

StatUtils
final public class StatUtils (Code)
StatUtils provides static methods for computing statistics based on data stored in double[] arrays.
version:
   $Revision: 233996 $ $Date: 2005-08-19 21:26:27 -0700 (Fri, 19 Aug 2005) $




Method Summary
public static  doublegeometricMean(double[] values)
     Returns the geometric mean of the entries in the input array, or Double.NaN if the array is empty.
public static  doublegeometricMean(double[] values, int begin, int length)
     Returns the geometric mean of the entries in the specified portion of the input array, or Double.NaN if the designated subarray is empty.
public static  doublemax(double[] values)
     Returns the maximum of the entries in the input array, or Double.NaN if the array is empty.

Throws IllegalArgumentException if the array is null.

  • The result is NaN iff all values are NaN (i.e.
public static  doublemax(double[] values, int begin, int length)
     Returns the maximum of the entries in the specified portion of the input array, or Double.NaN if the designated subarray is empty.

Throws IllegalArgumentException if the array is null or the array index parameters are not valid.

  • The result is NaN iff all values are NaN (i.e.
public static  doublemean(double[] values)
     Returns the arithmetic mean of the entries in the input array, or Double.NaN if the array is empty.
public static  doublemean(double[] values, int begin, int length)
     Returns the arithmetic mean of the entries in the specified portion of the input array, or Double.NaN if the designated subarray is empty.
public static  doublemeanDifference(double[] sample1, double[] sample2)
     Returns the mean of the (signed) differences between corresponding elements of the input arrays -- i.e., sum(sample1[i] - sample2[i]) / sample1.length.
public static  doublemin(double[] values)
     Returns the minimum of the entries in the input array, or Double.NaN if the array is empty.

Throws IllegalArgumentException if the array is null.

  • The result is NaN iff all values are NaN (i.e.
public static  doublemin(double[] values, int begin, int length)
     Returns the minimum of the entries in the specified portion of the input array, or Double.NaN if the designated subarray is empty.

Throws IllegalArgumentException if the array is null or the array index parameters are not valid.

  • The result is NaN iff all values are NaN (i.e.
public static  doublepercentile(double[] values, double p)
     Returns an estimate of the pth percentile of the values in the values array.
public static  doublepercentile(double[] values, int begin, int length, double p)
     Returns an estimate of the pth percentile of the values in the values array, starting with the element in (0-based) position begin in the array and including length values.
public static  doubleproduct(double[] values)
     Returns the product of the entries in the input array, or Double.NaN if the array is empty.
public static  doubleproduct(double[] values, int begin, int length)
     Returns the product of the entries in the specified portion of the input array, or Double.NaN if the designated subarray is empty.
public static  doublesum(double[] values)
     Returns the sum of the values in the input array, or Double.NaN if the array is empty.
public static  doublesum(double[] values, int begin, int length)
     Returns the sum of the entries in the specified portion of the input array, or Double.NaN if the designated subarray is empty.
public static  doublesumDifference(double[] sample1, double[] sample2)
     Returns the sum of the (signed) differences between corresponding elements of the input arrays -- i.e., sum(sample1[i] - sample2[i]).
public static  doublesumLog(double[] values)
     Returns the sum of the natural logs of the entries in the input array, or Double.NaN if the array is empty.
public static  doublesumLog(double[] values, int begin, int length)
     Returns the sum of the natural logs of the entries in the specified portion of the input array, or Double.NaN if the designated subarray is empty.
public static  doublesumSq(double[] values)
     Returns the sum of the squares of the entries in the input array, or Double.NaN if the array is empty.
public static  doublesumSq(double[] values, int begin, int length)
     Returns the sum of the squares of the entries in the specified portion of the input array, or Double.NaN if the designated subarray is empty.
public static  doublevariance(double[] values)
     Returns the variance of the entries in the input array, or Double.NaN if the array is empty.

See org.apache.commons.math.stat.descriptive.moment.Variance for details on the computing algorithm.

Returns 0 for a single-value (i.e.

public static  doublevariance(double[] values, int begin, int length)
     Returns the variance of the entries in the specified portion of the input array, or Double.NaN if the designated subarray is empty.

See org.apache.commons.math.stat.descriptive.moment.Variance for details on the computing algorithm.

Returns 0 for a single-value (i.e.

public static  doublevariance(double[] values, double mean, int begin, int length)
     Returns the variance of the entries in the specified portion of the input array, using the precomputed mean value.
public static  doublevariance(double[] values, double mean)
     Returns the variance of the entries in the input array, using the precomputed mean value.
public static  doublevarianceDifference(double[] sample1, double[] sample2, double meanDifference)
     Returns the variance of the (signed) differences between corresponding elements of the input arrays -- i.e., var(sample1[i] - sample2[i]).



Method Detail
geometricMean
public static double geometricMean(double[] values)(Code)
Returns the geometric mean of the entries in the input array, or Double.NaN if the array is empty.

Throws IllegalArgumentException if the array is null.

See org.apache.commons.math.stat.descriptive.moment.GeometricMean for details on the computing algorithm.
Parameters:
  values - the input array the geometric mean of the values or Double.NaN if the array is empty
throws:
  IllegalArgumentException - if the array is null




geometricMean
public static double geometricMean(double[] values, int begin, int length)(Code)
Returns the geometric mean of the entries in the specified portion of the input array, or Double.NaN if the designated subarray is empty.

Throws IllegalArgumentException if the array is null.

See org.apache.commons.math.stat.descriptive.moment.GeometricMean for details on the computing algorithm.
Parameters:
  values - the input array
Parameters:
  begin - index of the first array element to include
Parameters:
  length - the number of elements to include the geometric mean of the values or Double.NaN if length = 0
throws:
  IllegalArgumentException - if the array is null or the array indexparameters are not valid




max
public static double max(double[] values)(Code)
Returns the maximum of the entries in the input array, or Double.NaN if the array is empty.

Throws IllegalArgumentException if the array is null.

  • The result is NaN iff all values are NaN (i.e. NaN values have no impact on the value of the statistic).
  • If any of the values equals Double.POSITIVE_INFINITY, the result is Double.POSITIVE_INFINITY.

Parameters:
  values - the input array the maximum of the values or Double.NaN if the array is empty
throws:
  IllegalArgumentException - if the array is null



max
public static double max(double[] values, int begin, int length)(Code)
Returns the maximum of the entries in the specified portion of the input array, or Double.NaN if the designated subarray is empty.

Throws IllegalArgumentException if the array is null or the array index parameters are not valid.

  • The result is NaN iff all values are NaN (i.e. NaN values have no impact on the value of the statistic).
  • If any of the values equals Double.POSITIVE_INFINITY, the result is Double.POSITIVE_INFINITY.

Parameters:
  values - the input array
Parameters:
  begin - index of the first array element to include
Parameters:
  length - the number of elements to include the maximum of the values or Double.NaN if length = 0
throws:
  IllegalArgumentException - if the array is null or the array indexparameters are not valid



mean
public static double mean(double[] values)(Code)
Returns the arithmetic mean of the entries in the input array, or Double.NaN if the array is empty.

Throws IllegalArgumentException if the array is null.

See org.apache.commons.math.stat.descriptive.moment.Mean for details on the computing algorithm.
Parameters:
  values - the input array the mean of the values or Double.NaN if the array is empty
throws:
  IllegalArgumentException - if the array is null




mean
public static double mean(double[] values, int begin, int length)(Code)
Returns the arithmetic mean of the entries in the specified portion of the input array, or Double.NaN if the designated subarray is empty.

Throws IllegalArgumentException if the array is null.

See org.apache.commons.math.stat.descriptive.moment.Mean for details on the computing algorithm.
Parameters:
  values - the input array
Parameters:
  begin - index of the first array element to include
Parameters:
  length - the number of elements to include the mean of the values or Double.NaN if length = 0
throws:
  IllegalArgumentException - if the array is null or the array indexparameters are not valid




meanDifference
public static double meanDifference(double[] sample1, double[] sample2) throws IllegalArgumentException(Code)
Returns the mean of the (signed) differences between corresponding elements of the input arrays -- i.e., sum(sample1[i] - sample2[i]) / sample1.length.
Parameters:
  sample1 - the first array
Parameters:
  sample2 - the second array mean of paired differences
throws:
  IllegalArgumentException - if the arrays do not have the same(positive) length



min
public static double min(double[] values)(Code)
Returns the minimum of the entries in the input array, or Double.NaN if the array is empty.

Throws IllegalArgumentException if the array is null.

  • The result is NaN iff all values are NaN (i.e. NaN values have no impact on the value of the statistic).
  • If any of the values equals Double.NEGATIVE_INFINITY, the result is Double.NEGATIVE_INFINITY.

Parameters:
  values - the input array the minimum of the values or Double.NaN if the array is empty
throws:
  IllegalArgumentException - if the array is null



min
public static double min(double[] values, int begin, int length)(Code)
Returns the minimum of the entries in the specified portion of the input array, or Double.NaN if the designated subarray is empty.

Throws IllegalArgumentException if the array is null or the array index parameters are not valid.

  • The result is NaN iff all values are NaN (i.e. NaN values have no impact on the value of the statistic).
  • If any of the values equals Double.NEGATIVE_INFINITY, the result is Double.NEGATIVE_INFINITY.

Parameters:
  values - the input array
Parameters:
  begin - index of the first array element to include
Parameters:
  length - the number of elements to include the minimum of the values or Double.NaN if length = 0
throws:
  IllegalArgumentException - if the array is null or the array indexparameters are not valid



percentile
public static double percentile(double[] values, double p)(Code)
Returns an estimate of the pth percentile of the values in the values array.

  • Returns Double.NaN if values has length 0
  • Returns (for any value of p) values[0] if values has length 1
  • Throws IllegalArgumentException if values is null or p is not a valid quantile value (p must be greater than 0 and less than or equal to 100)

See org.apache.commons.math.stat.descriptive.rank.Percentile for a description of the percentile estimation algorithm used.
Parameters:
  values - input array of values
Parameters:
  p - the percentile value to compute the percentile value or Double.NaN if the array is empty
throws:
  IllegalArgumentException - if values is null or p is invalid




percentile
public static double percentile(double[] values, int begin, int length, double p)(Code)
Returns an estimate of the pth percentile of the values in the values array, starting with the element in (0-based) position begin in the array and including length values.

  • Returns Double.NaN if length = 0
  • Returns (for any value of p) values[begin] if length = 1
  • Throws IllegalArgumentException if values is null , begin or length is invalid, or p is not a valid quantile value (p must be greater than 0 and less than or equal to 100)

See org.apache.commons.math.stat.descriptive.rank.Percentile for a description of the percentile estimation algorithm used.
Parameters:
  values - array of input values
Parameters:
  p - the percentile to compute
Parameters:
  begin - the first (0-based) element to include in the computation
Parameters:
  length - the number of array elements to include the percentile value
throws:
  IllegalArgumentException - if the parameters are not valid or theinput array is null




product
public static double product(double[] values)(Code)
Returns the product of the entries in the input array, or Double.NaN if the array is empty.

Throws IllegalArgumentException if the array is null.
Parameters:
  values - the input array the product of the values or Double.NaN if the array is empty
throws:
  IllegalArgumentException - if the array is null




product
public static double product(double[] values, int begin, int length)(Code)
Returns the product of the entries in the specified portion of the input array, or Double.NaN if the designated subarray is empty.

Throws IllegalArgumentException if the array is null.
Parameters:
  values - the input array
Parameters:
  begin - index of the first array element to include
Parameters:
  length - the number of elements to include the product of the values or Double.NaN if length = 0
throws:
  IllegalArgumentException - if the array is null or the array indexparameters are not valid




sum
public static double sum(double[] values)(Code)
Returns the sum of the values in the input array, or Double.NaN if the array is empty.

Throws IllegalArgumentException if the input array is null.
Parameters:
  values - array of values to sum the sum of the values or Double.NaN if the arrayis empty
throws:
  IllegalArgumentException - if the array is null




sum
public static double sum(double[] values, int begin, int length)(Code)
Returns the sum of the entries in the specified portion of the input array, or Double.NaN if the designated subarray is empty.

Throws IllegalArgumentException if the array is null.
Parameters:
  values - the input array
Parameters:
  begin - index of the first array element to include
Parameters:
  length - the number of elements to include the sum of the values or Double.NaN if length = 0
throws:
  IllegalArgumentException - if the array is null or the array indexparameters are not valid




sumDifference
public static double sumDifference(double[] sample1, double[] sample2) throws IllegalArgumentException(Code)
Returns the sum of the (signed) differences between corresponding elements of the input arrays -- i.e., sum(sample1[i] - sample2[i]).
Parameters:
  sample1 - the first array
Parameters:
  sample2 - the second array sum of paired differences
throws:
  IllegalArgumentException - if the arrays do not have the same(positive) length



sumLog
public static double sumLog(double[] values)(Code)
Returns the sum of the natural logs of the entries in the input array, or Double.NaN if the array is empty.

Throws IllegalArgumentException if the array is null.

See org.apache.commons.math.stat.descriptive.summary.SumOfLogs .
Parameters:
  values - the input array the sum of the natural logs of the values or Double.NaN if the array is empty
throws:
  IllegalArgumentException - if the array is null




sumLog
public static double sumLog(double[] values, int begin, int length)(Code)
Returns the sum of the natural logs of the entries in the specified portion of the input array, or Double.NaN if the designated subarray is empty.

Throws IllegalArgumentException if the array is null.

See org.apache.commons.math.stat.descriptive.summary.SumOfLogs .
Parameters:
  values - the input array
Parameters:
  begin - index of the first array element to include
Parameters:
  length - the number of elements to include the sum of the natural logs of the values or Double.NaN if length = 0
throws:
  IllegalArgumentException - if the array is null or the array indexparameters are not valid




sumSq
public static double sumSq(double[] values)(Code)
Returns the sum of the squares of the entries in the input array, or Double.NaN if the array is empty.

Throws IllegalArgumentException if the array is null.
Parameters:
  values - input array the sum of the squared values or Double.NaN if thearray is empty
throws:
  IllegalArgumentException - if the array is null




sumSq
public static double sumSq(double[] values, int begin, int length)(Code)
Returns the sum of the squares of the entries in the specified portion of the input array, or Double.NaN if the designated subarray is empty.

Throws IllegalArgumentException if the array is null.
Parameters:
  values - the input array
Parameters:
  begin - index of the first array element to include
Parameters:
  length - the number of elements to include the sum of the squares of the values or Double.NaN if length = 0
throws:
  IllegalArgumentException - if the array is null or the array indexparameters are not valid




variance
public static double variance(double[] values)(Code)
Returns the variance of the entries in the input array, or Double.NaN if the array is empty.

See org.apache.commons.math.stat.descriptive.moment.Variance for details on the computing algorithm.

Returns 0 for a single-value (i.e. length = 1) sample.

Throws IllegalArgumentException if the array is null.
Parameters:
  values - the input array the variance of the values or Double.NaN if the array is empty
throws:
  IllegalArgumentException - if the array is null




variance
public static double variance(double[] values, int begin, int length)(Code)
Returns the variance of the entries in the specified portion of the input array, or Double.NaN if the designated subarray is empty.

See org.apache.commons.math.stat.descriptive.moment.Variance for details on the computing algorithm.

Returns 0 for a single-value (i.e. length = 1) sample.

Throws IllegalArgumentException if the array is null or the array index parameters are not valid.
Parameters:
  values - the input array
Parameters:
  begin - index of the first array element to include
Parameters:
  length - the number of elements to include the variance of the values or Double.NaN if length = 0
throws:
  IllegalArgumentException - if the array is null or the array indexparameters are not valid




variance
public static double variance(double[] values, double mean, int begin, int length)(Code)
Returns the variance of the entries in the specified portion of the input array, using the precomputed mean value. Returns Double.NaN if the designated subarray is empty.

See org.apache.commons.math.stat.descriptive.moment.Variance for details on the computing algorithm.

The formula used assumes that the supplied mean value is the arithmetic mean of the sample data, not a known population parameter. This method is supplied only to save computation when the mean has already been computed.

Returns 0 for a single-value (i.e. length = 1) sample.

Throws IllegalArgumentException if the array is null or the array index parameters are not valid.
Parameters:
  values - the input array
Parameters:
  mean - the precomputed mean value
Parameters:
  begin - index of the first array element to include
Parameters:
  length - the number of elements to include the variance of the values or Double.NaN if length = 0
throws:
  IllegalArgumentException - if the array is null or the array indexparameters are not valid




variance
public static double variance(double[] values, double mean)(Code)
Returns the variance of the entries in the input array, using the precomputed mean value. Returns Double.NaN if the array is empty.

See org.apache.commons.math.stat.descriptive.moment.Variance for details on the computing algorithm.

The formula used assumes that the supplied mean value is the arithmetic mean of the sample data, not a known population parameter. This method is supplied only to save computation when the mean has already been computed.

Returns 0 for a single-value (i.e. length = 1) sample.

Throws IllegalArgumentException if the array is null.
Parameters:
  values - the input array
Parameters:
  mean - the precomputed mean value the variance of the values or Double.NaN if the array is empty
throws:
  IllegalArgumentException - if the array is null




varianceDifference
public static double varianceDifference(double[] sample1, double[] sample2, double meanDifference) throws IllegalArgumentException(Code)
Returns the variance of the (signed) differences between corresponding elements of the input arrays -- i.e., var(sample1[i] - sample2[i]).
Parameters:
  sample1 - the first array
Parameters:
  sample2 - the second array
Parameters:
  meanDifference - the mean difference between corresponding entries
See Also:   StatUtils.meanDifference(double[],double[]) variance of paired differences
throws:
  IllegalArgumentException - if the arrays do not have the samelength or their common length is less than 2.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.