Javadoc only. Added missing </p>'s

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@617953 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Phil Steitz 2008-02-03 05:54:00 +00:00
parent 654a4018c4
commit 5c090bf605
57 changed files with 599 additions and 560 deletions

View File

@ -42,9 +42,9 @@ public abstract class AbstractDistribution
* For a random variable X whose values are distributed according
* to this distribution, this method returns P(x0 &le; X &le; x1).
* <p>
* The default implementation uses the identity
* The default implementation uses the identity</p>
* <p>
* P(x0 &le; X &le; x1) = P(X &le; x1) - P(X &le; x0)
* P(x0 &le; X &le; x1) = P(X &le; x1) - P(X &le; x0) </p>
*
* @param x0 the (inclusive) lower bound
* @param x1 the (inclusive) upper bound

View File

@ -166,7 +166,7 @@ public class BinomialDistributionImpl
* that P(X &le; x) &le; <code>p</code>.
* <p>
* Returns <code>-1</code> for p=0 and <code>Integer.MAX_VALUE</code> for
* p=1.
* p=1.</p>
*
* @param p the desired probability
* @return the largest x such that P(X &le; x) <= p

View File

@ -21,7 +21,7 @@ package org.apache.commons.math.distribution;
* Cauchy Distribution.
*
* <p>
* References:<p>
* References:
* <ul>
* <li><a href="http://mathworld.wolfram.com/CauchyDistribution.html">
* Cauchy Distribution</a></li>

View File

@ -87,7 +87,7 @@ public class CauchyDistributionImpl extends AbstractContinuousDistribution
* that P(X &lt; x) = <code>p</code>.
* <p>
* Returns <code>Double.NEGATIVE_INFINITY</code> for p=0 and
* <code>Double.POSITIVE_INFINITY</code> for p=1.
* <code>Double.POSITIVE_INFINITY</code> for p=1.</p>
*
* @param p the desired probability
* @return x, such that P(X &lt; x) = <code>p</code>

View File

@ -86,7 +86,7 @@ public class ChiSquaredDistributionImpl
* For this distribution, X, this method returns the critical point x, such
* that P(X &lt; x) = <code>p</code>.
* <p>
* Returns 0 for p=0 and <code>Double.POSITIVE_INFINITY</code> for p=1.
* Returns 0 for p=0 and <code>Double.POSITIVE_INFINITY</code> for p=1.</p>
*
* @param p the desired probability
* @return x, such that P(X &lt; x) = <code>p</code>

View File

@ -92,7 +92,7 @@ public class ExponentialDistributionImpl extends AbstractContinuousDistribution
* For this distribution, X, this method returns the critical point x, such
* that P(X &lt; x) = <code>p</code>.
* <p>
* Returns 0 for p=0 and <code>Double.POSITIVE_INFINITY</code> for p=1.
* Returns 0 for p=0 and <code>Double.POSITIVE_INFINITY</code> for p=1.</p>
*
* @param p the desired probability
* @return x, such that P(X &lt; x) = <code>p</code>

View File

@ -86,7 +86,7 @@ public class FDistributionImpl
* For this distribution, X, this method returns the critical point x, such
* that P(X &lt; x) = <code>p</code>.
* <p>
* Returns 0 for p=0 and <code>Double.POSITIVE_INFINITY</code> for p=1.
* Returns 0 for p=0 and <code>Double.POSITIVE_INFINITY</code> for p=1.</p>
*
* @param p the desired probability
* @return x, such that P(X &lt; x) = <code>p</code>

View File

@ -82,7 +82,7 @@ public class GammaDistributionImpl extends AbstractContinuousDistribution
* For this distribution, X, this method returns the critical point x, such
* that P(X &lt; x) = <code>p</code>.
* <p>
* Returns 0 for p=0 and <code>Double.POSITIVE_INFINITY</code> for p=1.
* Returns 0 for p=0 and <code>Double.POSITIVE_INFINITY</code> for p=1.</p>
*
* @param p the desired probability
* @return x, such that P(X &lt; x) = <code>p</code>

View File

@ -72,7 +72,7 @@ public interface IntegerDistribution extends DiscreteDistribution {
* P(X &le; M) =1, then <code>M</code> is returned by
* <code>inverseCumulativeProbability(1).</code>
* If there is no such value, <code>M, Integer.MAX_VALUE</code> is
* returned.</li></ul>
* returned.</li></ul></p>
*
* @param p the cumulative probability.
* @return the largest x such that P(X &le; x) <= p

View File

@ -21,7 +21,7 @@ package org.apache.commons.math.distribution;
* Normal (Gauss) Distribution.
*
* <p>
* References:<p>
* References:</p><p>
* <ul>
* <li><a href="http://mathworld.wolfram.com/NormalDistribution.html">
* Normal Distribution</a></li>

View File

@ -125,7 +125,7 @@ public class NormalDistributionImpl extends AbstractContinuousDistribution
* that P(X &lt; x) = <code>p</code>.
* <p>
* Returns <code>Double.NEGATIVE_INFINITY</code> for p=0 and
* <code>Double.POSITIVE_INFINITY</code> for p=1.
* <code>Double.POSITIVE_INFINITY</code> for p=1.</p>
*
* @param p the desired probability
* @return x, such that P(X &lt; x) = <code>p</code>

View File

@ -159,7 +159,7 @@ public class PascalDistributionImpl extends AbstractIntegerDistribution
* P(X &le; x) &le; <code>p</code>.
* <p>
* Returns <code>-1</code> for p=0 and <code>Integer.MAX_VALUE</code>
* for p=1.
* for p=1.</p>
* @param p the desired probability
* @return the largest x such that P(X &le; x) <= p
* @throws MathException if the inverse cumulative probability can not be

View File

@ -135,7 +135,7 @@ public class PoissonDistributionImpl extends AbstractIntegerDistribution
* distribution is used to approximate the Poisson distribution.
* <p>
* The computation uses "half-correction" -- evaluating the normal
* distribution function at <code>x + 0.5</code>
* distribution function at <code>x + 0.5</code></p>
*
* @param x the upper bound, inclusive
* @return the distribution function value calculated using a normal approximation

View File

@ -97,7 +97,7 @@ public class TDistributionImpl
* that P(X &lt; x) = <code>p</code>.
* <p>
* Returns <code>Double.NEGATIVE_INFINITY</code> for p=0 and
* <code>Double.POSITIVE_INFINITY</code> for p=1.
* <code>Double.POSITIVE_INFINITY</code> for p=1.</p>
*
* @param p the desired probability
* @return x, such that P(X &lt; x) = <code>p</code>

View File

@ -86,7 +86,7 @@ public class WeibullDistributionImpl extends AbstractContinuousDistribution
* that P(X &lt; x) = <code>p</code>.
* <p>
* Returns <code>Double.NEGATIVE_INFINITY</code> for p=0 and
* <code>Double.POSITIVE_INFINITY</code> for p=1.
* <code>Double.POSITIVE_INFINITY</code> for p=1.</p>
*
* @param p the desired probability
* @return x, such that P(X &lt; x) = <code>p</code>

View File

@ -106,7 +106,7 @@ public class Fraction extends Number implements Comparable {
* - a valid maxDenominator value and the epsilon value set to zero
* (that way epsilon only has effect if there is an exact match before
* the maxDenominator value is reached).
* <p>
* </p><p>
*
* It has been done this way so that the same code can be (re)used for both
* scenarios. However this could be confusing to users if it were part of

View File

@ -28,7 +28,7 @@ import org.apache.commons.math.util.MathUtils;
* <p>
* Minus signs are only allowed in the whole number part - i.e.,
* "-3 1/2" is legitimate and denotes -7/2, but "-3 -1/2" is invalid and
* will result in a <code>ParseException</code>.
* will result in a <code>ParseException</code>.</p>
*
* @since 1.1
* @version $Revision$ $Date$
@ -122,7 +122,7 @@ public class ProperFractionFormat extends FractionFormat {
* <p>
* Minus signs are only allowed in the whole number part - i.e.,
* "-3 1/2" is legitimate and denotes -7/2, but "-3 -1/2" is invalid and
* will result in a <code>ParseException</code>.
* will result in a <code>ParseException</code>.</p>
*
* @param source the string to parse
* @param pos input/ouput parsing parameter.

View File

@ -24,7 +24,7 @@ import java.math.BigDecimal;
* BigDecimal representations for the entries.
* <p>
* Matrix element indexing is 0-based -- e.g., <code>getEntry(0, 0)</code>
* returns the element in the first row, first column of the matrix.
* returns the element in the first row, first column of the matrix.</p>
*
* @version $Revision$ $Date$
*/
@ -170,7 +170,7 @@ public interface BigMatrix {
* Returns the entries in row number <code>row</code> as an array.
* <p>
* Row indices start at 0. A <code>MatrixIndexException</code> is thrown
* unless <code>0 <= row < rowDimension.</code>
* unless <code>0 <= row < rowDimension.</code></p>
*
* @param row the row to be fetched
* @return array of entries in the row
@ -183,7 +183,7 @@ public interface BigMatrix {
* of double values.
* <p>
* Row indices start at 0. A <code>MatrixIndexException</code> is thrown
* unless <code>0 <= row < rowDimension.</code>
* unless <code>0 <= row < rowDimension.</code></p>
*
* @param row the row to be fetched
* @return array of entries in the row
@ -195,7 +195,7 @@ public interface BigMatrix {
* Returns the entries in column number <code>col</code> as an array.
* <p>
* Column indices start at 0. A <code>MatrixIndexException</code> is thrown
* unless <code>0 <= column < columnDimension.</code>
* unless <code>0 <= column < columnDimension.</code></p>
*
* @param col the column to be fetched
* @return array of entries in the column
@ -208,7 +208,7 @@ public interface BigMatrix {
* of double values.
* <p>
* Column indices start at 0. A <code>MatrixIndexException</code> is thrown
* unless <code>0 <= column < columnDimension.</code>
* unless <code>0 <= column < columnDimension.</code></p>
*
* @param col the column to be fetched
* @return array of entries in the column
@ -224,7 +224,7 @@ public interface BigMatrix {
* <li><code>0 <= row < rowDimension</code></li>
* <li><code> 0 <= column < columnDimension</code></li>
* </ul>
* otherwise a <code>MatrixIndexException</code> is thrown.
* otherwise a <code>MatrixIndexException</code> is thrown.</p>
*
* @param row row location of entry to be fetched
* @param column column location of entry to be fetched
@ -241,7 +241,7 @@ public interface BigMatrix {
* <li><code>0 <= row < rowDimension</code></li>
* <li><code> 0 <= column < columnDimension</code></li>
* </ul>
* otherwise a <code>MatrixIndexException</code> is thrown.
* otherwise a <code>MatrixIndexException</code> is thrown.</p>
*
* @param row row location of entry to be fetched
* @param column column location of entry to be fetched

View File

@ -29,7 +29,7 @@ import java.math.BigDecimal;
* <li>solve</li>
* <li>isSingular</li>
* <li>getDeterminant</li>
* <li>inverse</li> </ul>
* <li>inverse</li> </ul></p>
* <p>
* <strong>Usage notes</strong>:<br>
* <ul><li>
@ -43,7 +43,8 @@ import java.math.BigDecimal;
* <li>
* As specified in the {@link BigMatrix} interface, matrix element indexing
* is 0-based -- e.g., <code>getEntry(0, 0)</code>
* returns the element in the first row, first column of the matrix.</li></ul>
* returns the element in the first row, first column of the matrix.</li></ul></p>
*
* @version $Revision$ $Date$
*/
public class BigMatrixImpl implements BigMatrix, Serializable {
@ -106,7 +107,7 @@ public class BigMatrixImpl implements BigMatrix, Serializable {
* Create a new BigMatrix using the <code>data</code> as the underlying
* data array.
* <p>
* The input array is copied, not referenced.
* The input array is copied, not referenced.</p>
*
* @param d data for new matrix
* @throws IllegalArgumentException if <code>d</code> is not rectangular
@ -122,7 +123,7 @@ public class BigMatrixImpl implements BigMatrix, Serializable {
* Create a new BigMatrix using the <code>data</code> as the underlying
* data array.
* <p>
* The input array is copied, not referenced.
* The input array is copied, not referenced.</p>
*
* @param d data for new matrix
* @throws IllegalArgumentException if <code>d</code> is not rectangular
@ -185,7 +186,7 @@ public class BigMatrixImpl implements BigMatrix, Serializable {
* data for the unique column of the <code>v.length x 1</code> matrix
* created.
* <p>
* The input array is copied, not referenced.
* The input array is copied, not referenced.</p>
*
* @param v column vector holding data for new matrix
*/
@ -329,7 +330,7 @@ public class BigMatrixImpl implements BigMatrix, Serializable {
/**
* Returns matrix entries as a two-dimensional array.
* <p>
* Makes a fresh copy of the underlying data.
* Makes a fresh copy of the underlying data.</p>
*
* @return 2-dimensional array of entries
*/
@ -341,7 +342,7 @@ public class BigMatrixImpl implements BigMatrix, Serializable {
* Returns matrix entries as a two-dimensional array.
* <p>
* Makes a fresh copy of the underlying data converted to
* <code>double</code> values.
* <code>double</code> values.</p>
*
* @return 2-dimensional array of entries
*/
@ -360,7 +361,7 @@ public class BigMatrixImpl implements BigMatrix, Serializable {
/**
* Returns a reference to the underlying data array.
* <p>
* Does not make a fresh copy of the underlying data.
* Does not make a fresh copy of the underlying data.</p>
*
* @return 2-dimensional array of entries
*/
@ -503,7 +504,7 @@ public class BigMatrixImpl implements BigMatrix, Serializable {
* 1 2 3 4
* 5 3 4 8
* 9 5 6 2
* </pre>
* </pre></p>
*
* @param subMatrix array containing the submatrix replacement data
* @param row row coordinate of the top, left element to be replaced
@ -595,7 +596,7 @@ public class BigMatrixImpl implements BigMatrix, Serializable {
* Returns the entries in row number <code>row</code> as an array.
* <p>
* Row indices start at 0. A <code>MatrixIndexException</code> is thrown
* unless <code>0 <= row < rowDimension.</code>
* unless <code>0 <= row < rowDimension.</code></p>
*
* @param row the row to be fetched
* @return array of entries in the row
@ -616,7 +617,7 @@ public class BigMatrixImpl implements BigMatrix, Serializable {
* of double values.
* <p>
* Row indices start at 0. A <code>MatrixIndexException</code> is thrown
* unless <code>0 <= row < rowDimension.</code>
* unless <code>0 <= row < rowDimension.</code></p>
*
* @param row the row to be fetched
* @return array of entries in the row
@ -638,7 +639,7 @@ public class BigMatrixImpl implements BigMatrix, Serializable {
* Returns the entries in column number <code>col</code> as an array.
* <p>
* Column indices start at 0. A <code>MatrixIndexException</code> is thrown
* unless <code>0 <= column < columnDimension.</code>
* unless <code>0 <= column < columnDimension.</code></p>
*
* @param col the column to be fetched
* @return array of entries in the column
@ -661,7 +662,7 @@ public class BigMatrixImpl implements BigMatrix, Serializable {
* of double values.
* <p>
* Column indices start at 0. A <code>MatrixIndexException</code> is thrown
* unless <code>0 <= column < columnDimension.</code>
* unless <code>0 <= column < columnDimension.</code></p>
*
* @param col the column to be fetched
* @return array of entries in the column
@ -687,7 +688,7 @@ public class BigMatrixImpl implements BigMatrix, Serializable {
* <li><code>0 <= row < rowDimension</code></li>
* <li><code> 0 <= column < columnDimension</code></li>
* </ul>
* otherwise a <code>MatrixIndexException</code> is thrown.
* otherwise a <code>MatrixIndexException</code> is thrown.</p>
*
* @param row row location of entry to be fetched
* @param column column location of entry to be fetched
@ -710,7 +711,7 @@ public class BigMatrixImpl implements BigMatrix, Serializable {
* <li><code>0 <= row < rowDimension</code></li>
* <li><code> 0 <= column < columnDimension</code></li>
* </ul>
* otherwise a <code>MatrixIndexException</code> is thrown.
* otherwise a <code>MatrixIndexException</code> is thrown.</p>
*
* @param row row location of entry to be fetched
* @param column column location of entry to be fetched
@ -1007,14 +1008,14 @@ public class BigMatrixImpl implements BigMatrix, Serializable {
* <p>
* <strong>Implementation Note</strong>:<br>
* Uses <a href="http://www.damtp.cam.ac.uk/user/fdl/people/sd/lectures/nummeth98/linear.htm">
* Crout's algortithm</a>, with partial pivoting.
* Crout's algortithm</a>, with partial pivoting.</p>
* <p>
* <strong>Usage Note</strong>:<br>
* This method should rarely be invoked directly. Its only use is
* to force recomputation of the LU decomposition when changes have been
* made to the underlying data using direct array references. Changes
* made using setXxx methods will trigger recomputation when needed
* automatically.
* automatically.</p>
*
* @throws InvalidMatrixException if the matrix is non-square or singular.
*/
@ -1194,7 +1195,7 @@ public class BigMatrixImpl implements BigMatrix, Serializable {
* The matrix returned is a compact representation of the LU decomposition.
* Elements below the main diagonal correspond to entries of the "L" matrix;
* elements on and above the main diagonal correspond to entries of the "U"
* matrix.
* matrix.</p>
* <p>
* Example: <pre>
*
@ -1206,7 +1207,7 @@ public class BigMatrixImpl implements BigMatrix, Serializable {
*
* The L and U matrices satisfy the matrix equation LU = permuteRows(this), <br>
* where permuteRows reorders the rows of the matrix to follow the order determined
* by the <a href=#getPermutation()>permutation</a> property.
* by the <a href=#getPermutation()>permutation</a> property.</p>
*
* @return LU decomposition matrix
* @throws InvalidMatrixException if the matrix is non-square or singular.
@ -1224,9 +1225,9 @@ public class BigMatrixImpl implements BigMatrix, Serializable {
* <p>
* Example:
* permutation = [1, 2, 0] means current 2nd row is first, current third row is second
* and current first row is last.
* and current first row is last.</p>
* <p>
* Returns a fresh copy of the array.
* Returns a fresh copy of the array.</p>
*
* @return the permutation
*/
@ -1256,7 +1257,7 @@ public class BigMatrixImpl implements BigMatrix, Serializable {
/**
* Replaces data with a fresh copy of the input array.
* <p>
* Verifies that the input array is rectangular and non-empty.
* Verifies that the input array is rectangular and non-empty.</p>
*
* @param in data to copy in
* @throws IllegalArgumentException if input array is emtpy or not

View File

@ -21,7 +21,7 @@ package org.apache.commons.math.linear;
* Interface defining a real-valued matrix with basic algebraic operations.
* <p>
* Matrix element indexing is 0-based -- e.g., <code>getEntry(0, 0)</code>
* returns the element in the first row, first column of the matrix.
* returns the element in the first row, first column of the matrix.</p>
*
* @version $Revision$ $Date$
*/
@ -153,7 +153,7 @@ public interface RealMatrix {
* Returns the entries in row number <code>row</code> as an array.
* <p>
* Row indices start at 0. A <code>MatrixIndexException</code> is thrown
* unless <code>0 <= row < rowDimension.</code>
* unless <code>0 <= row < rowDimension.</code></p>
*
* @param row the row to be fetched
* @return array of entries in the row
@ -165,7 +165,7 @@ public interface RealMatrix {
* Returns the entries in column number <code>col</code> as an array.
* <p>
* Column indices start at 0. A <code>MatrixIndexException</code> is thrown
* unless <code>0 <= column < columnDimension.</code>
* unless <code>0 <= column < columnDimension.</code></p>
*
* @param col the column to be fetched
* @return array of entries in the column
@ -181,7 +181,7 @@ public interface RealMatrix {
* <li><code>0 <= row < rowDimension</code></li>
* <li><code> 0 <= column < columnDimension</code></li>
* </ul>
* otherwise a <code>MatrixIndexException</code> is thrown.
* otherwise a <code>MatrixIndexException</code> is thrown.</p>
*
* @param row row location of entry to be fetched
* @param column column location of entry to be fetched

View File

@ -31,7 +31,7 @@ import org.apache.commons.math.util.MathUtils;
* <li>solve</li>
* <li>isSingular</li>
* <li>getDeterminant</li>
* <li>inverse</li> </ul>
* <li>inverse</li> </ul></p>
* <p>
* <strong>Usage notes</strong>:<br>
* <ul><li>
@ -45,6 +45,7 @@ import org.apache.commons.math.util.MathUtils;
* As specified in the {@link RealMatrix} interface, matrix element indexing
* is 0-based -- e.g., <code>getEntry(0, 0)</code>
* returns the element in the first row, first column of the matrix.</li></ul>
* </p>
*
* @version $Revision$ $Date$
*/
@ -97,7 +98,7 @@ public class RealMatrixImpl implements RealMatrix, Serializable {
* Create a new RealMatrix using the input array as the underlying
* data array.
* <p>
* The input array is copied, not referenced.
* The input array is copied, not referenced.</p>
*
* @param d data for new matrix
* @throws IllegalArgumentException if <code>data</code> is not rectangular
@ -114,7 +115,7 @@ public class RealMatrixImpl implements RealMatrix, Serializable {
* data for the unique column of the <code>v.length x 1</code> matrix
* created.
* <p>
* The input array is copied, not referenced.
* The input array is copied, not referenced.</p>
*
* @param v column vector holding data for new matrix
*/
@ -258,7 +259,7 @@ public class RealMatrixImpl implements RealMatrix, Serializable {
/**
* Returns matrix entries as a two-dimensional array.
* <p>
* Makes a fresh copy of the underlying data.
* Makes a fresh copy of the underlying data.</p>
*
* @return 2-dimensional array of entries
*/
@ -269,7 +270,7 @@ public class RealMatrixImpl implements RealMatrix, Serializable {
/**
* Returns a reference to the underlying data array.
* <p>
* Does not make a fresh copy of the underlying data.
* Does not make a fresh copy of the underlying data.</p>
*
* @return 2-dimensional array of entries
*/
@ -372,7 +373,7 @@ public class RealMatrixImpl implements RealMatrix, Serializable {
* 1 2 3 4
* 5 3 4 8
* 9 5 6 2
* </pre>
* </pre></p>
*
* @param subMatrix array containing the submatrix replacement data
* @param row row coordinate of the top, left element to be replaced
@ -464,7 +465,7 @@ public class RealMatrixImpl implements RealMatrix, Serializable {
* Returns the entries in row number <code>row</code> as an array.
* <p>
* Row indices start at 0. A <code>MatrixIndexException</code> is thrown
* unless <code>0 <= row < rowDimension.</code>
* unless <code>0 <= row < rowDimension.</code></p>
*
* @param row the row to be fetched
* @return array of entries in the row
@ -484,7 +485,7 @@ public class RealMatrixImpl implements RealMatrix, Serializable {
* Returns the entries in column number <code>col</code> as an array.
* <p>
* Column indices start at 0. A <code>MatrixIndexException</code> is thrown
* unless <code>0 <= column < columnDimension.</code>
* unless <code>0 <= column < columnDimension.</code></p>
*
* @param col the column to be fetched
* @return array of entries in the column
@ -510,7 +511,7 @@ public class RealMatrixImpl implements RealMatrix, Serializable {
* <li><code>0 <= row < rowDimension</code></li>
* <li><code> 0 <= column < columnDimension</code></li>
* </ul>
* otherwise a <code>MatrixIndexException</code> is thrown.
* otherwise a <code>MatrixIndexException</code> is thrown.</p>
*
* @param row row location of entry to be fetched
* @param column column location of entry to be fetched
@ -760,14 +761,14 @@ public class RealMatrixImpl implements RealMatrix, Serializable {
* <p>
* <strong>Implementation Note</strong>:<br>
* Uses <a href="http://www.damtp.cam.ac.uk/user/fdl/people/sd/lectures/nummeth98/linear.htm">
* Crout's algorithm</a>, with partial pivoting.
* Crout's algorithm</a>, with partial pivoting.</p>
* <p>
* <strong>Usage Note</strong>:<br>
* This method should rarely be invoked directly. Its only use is
* to force recomputation of the LU decomposition when changes have been
* made to the underlying data using direct array references. Changes
* made using setXxx methods will trigger recomputation when needed
* automatically.
* automatically.</p>
*
* @throws InvalidMatrixException if the matrix is non-square or singular.
*/
@ -946,7 +947,7 @@ public class RealMatrixImpl implements RealMatrix, Serializable {
* The matrix returned is a compact representation of the LU decomposition.
* Elements below the main diagonal correspond to entries of the "L" matrix;
* elements on and above the main diagonal correspond to entries of the "U"
* matrix.
* matrix.</p>
* <p>
* Example: <pre>
*
@ -958,7 +959,7 @@ public class RealMatrixImpl implements RealMatrix, Serializable {
*
* The L and U matrices satisfy the matrix equation LU = permuteRows(this), <br>
* where permuteRows reorders the rows of the matrix to follow the order determined
* by the <a href=#getPermutation()>permutation</a> property.
* by the <a href=#getPermutation()>permutation</a> property.</p>
*
* @return LU decomposition matrix
* @throws InvalidMatrixException if the matrix is non-square or singular.
@ -976,9 +977,9 @@ public class RealMatrixImpl implements RealMatrix, Serializable {
* <p>
* Example:
* permutation = [1, 2, 0] means current 2nd row is first, current third row is second
* and current first row is last.
* and current first row is last.</p>
* <p>
* Returns a fresh copy of the array.
* Returns a fresh copy of the array.</p>
*
* @return the permutation
*/
@ -1008,7 +1009,7 @@ public class RealMatrixImpl implements RealMatrix, Serializable {
/**
* Replaces data with a fresh copy of the input array.
* <p>
* Verifies that the input array is rectangular and non-empty
* Verifies that the input array is rectangular and non-empty.</p>
*
* @param in data to copy in
* @throws IllegalArgumentException if input array is empty or not

View File

@ -27,14 +27,14 @@ import java.util.TreeMap;
* <p>
* Accepts int, long, char or Object values. New values added must be
* comparable to those that have been added, otherwise the add method will
* throw an IllegalArgumentException.
* throw an IllegalArgumentException.</p>
* <p>
* Integer values (int, long, Integer, Long) are not distinguished by type --
* i.e. <code>addValue(new Long(2)), addValue(2), addValue(2l)</code> all have
* the same effect (similarly for arguments to <code>getCount,</code> etc.).
* the same effect (similarly for arguments to <code>getCount,</code> etc.).</p>
* <p>
* The values are ordered using the default (natural order), unless a
* <code>Comparator</code> is supplied in the constructor.
* <code>Comparator</code> is supplied in the constructor.</p>
*
* @version $Revision$ $Date$
*/
@ -157,7 +157,7 @@ public class Frequency implements Serializable {
* <p>
* If added values are itegral (i.e., integers, longs, Integers, or Longs),
* they are converted to Longs when they are added, so the objects returned
* by the Iterator will in this case be Longs.
* by the Iterator will in this case be Longs.</p>
*
* @return values Iterator
*/
@ -239,7 +239,7 @@ public class Frequency implements Serializable {
* Returns the percentage of values that are equal to v
* (as a proportion between 0 and 1).
* <p>
* Returns <code>Double.NaN</code> if no values have been added.
* Returns <code>Double.NaN</code> if no values have been added.</p>
*
* @param v the value to lookup
* @return the proportion of values equal to v
@ -252,7 +252,7 @@ public class Frequency implements Serializable {
}
/**
* Returns the percentage of values that are equal to v
* Returns the percentage of values that are equal to v
* (as a proportion between 0 and 1).
*
* @param v the value to lookup
@ -263,7 +263,7 @@ public class Frequency implements Serializable {
}
/**
* Returns the percentage of values that are equal to v
* Returns the percentage of values that are equal to v
* (as a proportion between 0 and 1).
*
* @param v the value to lookup
@ -289,7 +289,7 @@ public class Frequency implements Serializable {
/**
* Returns the cumulative frequency of values less than or equal to v.
* <p>
* Returns 0 if v is not comparable to the values set.
* Returns 0 if v is not comparable to the values set.</p>
*
* @param v the value to lookup.
* @return the proportion of values equal to v
@ -339,7 +339,7 @@ public class Frequency implements Serializable {
/**
* Returns the cumulative frequency of values less than or equal to v.
* <p>
* Returns 0 if v is not comparable to the values set.
* Returns 0 if v is not comparable to the values set.</p>
*
* @param v the value to lookup
* @return the proportion of values equal to v
@ -351,7 +351,7 @@ public class Frequency implements Serializable {
/**
* Returns the cumulative frequency of values less than or equal to v.
* <p>
* Returns 0 if v is not comparable to the values set.
* Returns 0 if v is not comparable to the values set.</p>
*
* @param v the value to lookup
* @return the proportion of values equal to v
@ -363,7 +363,7 @@ public class Frequency implements Serializable {
/**
* Returns the cumulative frequency of values less than or equal to v.
* <p>
* Returns 0 if v is not comparable to the values set.
* Returns 0 if v is not comparable to the values set.</p>
*
* @param v the value to lookup
* @return the proportion of values equal to v
@ -374,13 +374,13 @@ public class Frequency implements Serializable {
//----------------------------------------------------------------------------------------------
/**
/**
* Returns the cumulative percentage of values less than or equal to v
* (as a proportion between 0 and 1).
* <p>
* Returns <code>Double.NaN</code> if no values have been added.
* Returns 0 if at least one value has been added, but v is not comparable
* to the values set.
* to the values set.</p>
*
* @param v the value to lookup
* @return the proportion of values less than or equal to v
@ -396,7 +396,7 @@ public class Frequency implements Serializable {
* Returns the cumulative percentage of values less than or equal to v
* (as a proportion between 0 and 1).
* <p>
* Returns 0 if v is not comparable to the values set.
* Returns 0 if v is not comparable to the values set.</p>
*
* @param v the value to lookup
* @return the proportion of values less than or equal to v
@ -409,7 +409,7 @@ public class Frequency implements Serializable {
* Returns the cumulative percentage of values less than or equal to v
* (as a proportion between 0 and 1).
* <p>
* Returns 0 if v is not comparable to the values set.
* Returns 0 if v is not comparable to the values set.</p>
*
* @param v the value to lookup
* @return the proportion of values less than or equal to v
@ -422,7 +422,7 @@ public class Frequency implements Serializable {
* Returns the cumulative percentage of values less than or equal to v
* (as a proportion between 0 and 1).
* <p>
* Returns 0 if v is not comparable to the values set.
* Returns 0 if v is not comparable to the values set.</p>
*
* @param v the value to lookup
* @return the proportion of values less than or equal to v

View File

@ -77,7 +77,7 @@ public final class StatUtils {
* <code>Double.NaN</code> if the array is empty.
* <p>
* Throws <code>IllegalArgumentException</code> if the input array
* is null.
* is null.</p>
*
* @param values array of values to sum
* @return the sum of the values or <code>Double.NaN</code> if the array
@ -93,7 +93,7 @@ public final class StatUtils {
* the input array, or <code>Double.NaN</code> if the designated subarray
* is empty.
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
*
* @param values the input array
* @param begin index of the first array element to include
@ -111,7 +111,7 @@ public final class StatUtils {
* Returns the sum of the squares of the entries in the input array, or
* <code>Double.NaN</code> if the array is empty.
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
*
* @param values input array
* @return the sum of the squared values or <code>Double.NaN</code> if the
@ -127,7 +127,7 @@ public final class StatUtils {
* the input array, or <code>Double.NaN</code> if the designated subarray
* is empty.
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
*
* @param values the input array
* @param begin index of the first array element to include
@ -145,7 +145,7 @@ public final class StatUtils {
* Returns the product of the entries in the input array, or
* <code>Double.NaN</code> if the array is empty.
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
*
* @param values the input array
* @return the product of the values or Double.NaN if the array is empty
@ -160,7 +160,7 @@ public final class StatUtils {
* the input array, or <code>Double.NaN</code> if the designated subarray
* is empty.
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
*
* @param values the input array
* @param begin index of the first array element to include
@ -178,9 +178,10 @@ public final class StatUtils {
* Returns the sum of the natural logs of the entries in the input array, or
* <code>Double.NaN</code> if the array is empty.
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
* <p>
* See {@link org.apache.commons.math.stat.descriptive.summary.SumOfLogs}.
* </p>
*
* @param values the input array
* @return the sum of the natural logs of the values or Double.NaN if
@ -196,9 +197,10 @@ public final class StatUtils {
* the input array, or <code>Double.NaN</code> if the designated subarray
* is empty.
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
* <p>
* See {@link org.apache.commons.math.stat.descriptive.summary.SumOfLogs}.
* See {@link org.apache.commons.math.stat.descriptive.summary.SumOfLogs}.
* </p>
*
* @param values the input array
* @param begin index of the first array element to include
@ -217,10 +219,10 @@ public final class StatUtils {
* Returns the arithmetic mean of the entries in the input array, or
* <code>Double.NaN</code> if the array is empty.
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
* <p>
* See {@link org.apache.commons.math.stat.descriptive.moment.Mean} for
* details on the computing algorithm.
* details on the computing algorithm.</p>
*
* @param values the input array
* @return the mean of the values or Double.NaN if the array is empty
@ -235,10 +237,10 @@ public final class StatUtils {
* the input array, or <code>Double.NaN</code> if the designated subarray
* is empty.
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
* <p>
* See {@link org.apache.commons.math.stat.descriptive.moment.Mean} for
* details on the computing algorithm.
* details on the computing algorithm.</p>
*
* @param values the input array
* @param begin index of the first array element to include
@ -256,10 +258,10 @@ public final class StatUtils {
* Returns the geometric mean of the entries in the input array, or
* <code>Double.NaN</code> if the array is empty.
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
* <p>
* See {@link org.apache.commons.math.stat.descriptive.moment.GeometricMean}
* for details on the computing algorithm.
* for details on the computing algorithm.</p>
*
* @param values the input array
* @return the geometric mean of the values or Double.NaN if the array is empty
@ -274,10 +276,10 @@ public final class StatUtils {
* the input array, or <code>Double.NaN</code> if the designated subarray
* is empty.
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
* <p>
* See {@link org.apache.commons.math.stat.descriptive.moment.GeometricMean}
* for details on the computing algorithm.
* for details on the computing algorithm.</p>
*
* @param values the input array
* @param begin index of the first array element to include
@ -297,11 +299,11 @@ public final class StatUtils {
* <code>Double.NaN</code> if the array is empty.
* <p>
* See {@link org.apache.commons.math.stat.descriptive.moment.Variance} for
* details on the computing algorithm.
* details on the computing algorithm.</p>
* <p>
* Returns 0 for a single-value (i.e. length = 1) sample.
* Returns 0 for a single-value (i.e. length = 1) sample.</p>
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
*
* @param values the input array
* @return the variance of the values or Double.NaN if the array is empty
@ -317,12 +319,12 @@ public final class StatUtils {
* is empty.
* <p>
* See {@link org.apache.commons.math.stat.descriptive.moment.Variance} for
* details on the computing algorithm.
* details on the computing algorithm.</p>
* <p>
* Returns 0 for a single-value (i.e. length = 1) sample.
* Returns 0 for a single-value (i.e. length = 1) sample.</p>
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null or the
* array index parameters are not valid.
* array index parameters are not valid.</p>
*
* @param values the input array
* @param begin index of the first array element to include
@ -342,17 +344,17 @@ public final class StatUtils {
* <code>Double.NaN</code> if the designated subarray is empty.
* <p>
* See {@link org.apache.commons.math.stat.descriptive.moment.Variance} for
* details on the computing algorithm.
* details on the computing algorithm.</p>
* <p>
* 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.
* computed.</p>
* <p>
* Returns 0 for a single-value (i.e. length = 1) sample.
* Returns 0 for a single-value (i.e. length = 1) sample.</p>
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null or the
* array index parameters are not valid.
* array index parameters are not valid.</p>
*
* @param values the input array
* @param mean the precomputed mean value
@ -373,16 +375,16 @@ public final class StatUtils {
* is empty.
* <p>
* See {@link org.apache.commons.math.stat.descriptive.moment.Variance} for
* details on the computing algorithm.
* details on the computing algorithm.</p>
* <p>
* 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.
* computed.</p>
* <p>
* Returns 0 for a single-value (i.e. length = 1) sample.
* Returns 0 for a single-value (i.e. length = 1) sample.</p>
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
*
* @param values the input array
* @param mean the precomputed mean value
@ -397,14 +399,14 @@ public final class StatUtils {
* Returns the maximum of the entries in the input array, or
* <code>Double.NaN</code> if the array is empty.
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
* <p>
* <ul>
* <li>The result is <code>NaN</code> iff all values are <code>NaN</code>
* (i.e. <code>NaN</code> values have no impact on the value of the statistic).</li>
* <li>If any of the values equals <code>Double.POSITIVE_INFINITY</code>,
* the result is <code>Double.POSITIVE_INFINITY.</code></li>
* </ul>
* </ul></p>
*
* @param values the input array
* @return the maximum of the values or Double.NaN if the array is empty
@ -420,14 +422,14 @@ public final class StatUtils {
* is empty.
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null or
* the array index parameters are not valid.
* the array index parameters are not valid.</p>
* <p>
* <ul>
* <li>The result is <code>NaN</code> iff all values are <code>NaN</code>
* (i.e. <code>NaN</code> values have no impact on the value of the statistic).</li>
* <li>If any of the values equals <code>Double.POSITIVE_INFINITY</code>,
* the result is <code>Double.POSITIVE_INFINITY.</code></li>
* </ul>
* </ul></p>
*
* @param values the input array
* @param begin index of the first array element to include
@ -445,14 +447,14 @@ public final class StatUtils {
* Returns the minimum of the entries in the input array, or
* <code>Double.NaN</code> if the array is empty.
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
* <p>
* <ul>
* <li>The result is <code>NaN</code> iff all values are <code>NaN</code>
* (i.e. <code>NaN</code> values have no impact on the value of the statistic).</li>
* <li>If any of the values equals <code>Double.NEGATIVE_INFINITY</code>,
* the result is <code>Double.NEGATIVE_INFINITY.</code></li>
* </ul>
* </ul> </p>
*
* @param values the input array
* @return the minimum of the values or Double.NaN if the array is empty
@ -468,14 +470,14 @@ public final class StatUtils {
* is empty.
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null or
* the array index parameters are not valid.
* the array index parameters are not valid.</p>
* <p>
* <ul>
* <li>The result is <code>NaN</code> iff all values are <code>NaN</code>
* (i.e. <code>NaN</code> values have no impact on the value of the statistic).</li>
* <li>If any of the values equals <code>Double.NEGATIVE_INFINITY</code>,
* the result is <code>Double.NEGATIVE_INFINITY.</code></li>
* </ul>
* </ul></p>
*
* @param values the input array
* @param begin index of the first array element to include
@ -495,16 +497,16 @@ public final class StatUtils {
* <p>
* <ul>
* <li>Returns <code>Double.NaN</code> if <code>values</code> has length
* <code>0</code></li>
* <code>0</code></li></p>
* <li>Returns (for any value of <code>p</code>) <code>values[0]</code>
* if <code>values</code> has length <code>1</code></li>
* <li>Throws <code>IllegalArgumentException</code> if <code>values</code>
* is null or p is not a valid quantile value (p must be greater than 0
* and less than or equal to 100)</li>
* </ul>
* </ul></p>
* <p>
* See {@link org.apache.commons.math.stat.descriptive.rank.Percentile} for
* a description of the percentile estimation algorithm used.
* a description of the percentile estimation algorithm used.</p>
*
* @param values input array of values
* @param p the percentile value to compute
@ -530,10 +532,10 @@ public final class StatUtils {
* is null , <code>begin</code> or <code>length</code> is invalid, or
* <code>p</code> is not a valid quantile value (p must be greater than 0
* and less than or equal to 100)</li>
* </ul>
* </ul></p>
* <p>
* See {@link org.apache.commons.math.stat.descriptive.rank.Percentile} for
* a description of the percentile estimation algorithm used.
* a description of the percentile estimation algorithm used.</p>
*
* @param values array of input values
* @param p the percentile to compute

View File

@ -24,9 +24,9 @@ import java.io.Serializable;
* Abstract implementation of the {@link StorelessUnivariateStatistic} interface.
* <p>
* Provides default <code>evaluate()</code> and <code>incrementAll(double[])<code>
* implementations.
* implementations.</p>
* <p>
* <strong>Note that these implementations are not synchronized.</strong>
* <strong>Note that these implementations are not synchronized.</strong></p>
*
* @version $Revision$ $Date$
*/
@ -44,13 +44,13 @@ public abstract class AbstractStorelessUnivariateStatistic
* <p>
* Note that this implementation changes the internal state of the
* statistic. Its side effects are the same as invoking {@link #clear} and
* then {@link #incrementAll(double[])}.
* then {@link #incrementAll(double[])}.</p>
* <p>
* Implementations may override this method with a more efficient and
* possibly more accurate implementation that works directly with the
* input array.
* input array.</p>
* <p>
* If the array is null, an IllegalArgumentException is thrown.
* If the array is null, an IllegalArgumentException is thrown.</p>
*
* @see org.apache.commons.math.stat.descriptive.UnivariateStatistic#evaluate(double[])
*/
@ -68,14 +68,14 @@ public abstract class AbstractStorelessUnivariateStatistic
* <p>
* Note that this implementation changes the internal state of the
* statistic. Its side effects are the same as invoking {@link #clear} and
* then {@link #incrementAll(double[], int, int)}.
* then {@link #incrementAll(double[], int, int)}.</p>
* <p>
* Implementations may override this method with a more efficient and
* possibly more accurate implementation that works directly with the
* input array.
* input array.</p>
* <p>
* If the array is null or the index parameters are not valid, an
* IllegalArgumentException is thrown.
* IllegalArgumentException is thrown.</p>
*
* @see org.apache.commons.math.stat.descriptive.UnivariateStatistic#evaluate(double[], int, int)
*/
@ -106,7 +106,7 @@ public abstract class AbstractStorelessUnivariateStatistic
* This default implementation just calls {@link #increment} in a loop over
* the input array.
* <p>
* Throws IllegalArgumentException if the input values array is null.
* Throws IllegalArgumentException if the input values array is null.</p>
*
* @param values values to add
* @throws IllegalArgumentException if values is null
@ -123,7 +123,7 @@ public abstract class AbstractStorelessUnivariateStatistic
* This default implementation just calls {@link #increment} in a loop over
* the specified portion of the input array.
* <p>
* Throws IllegalArgumentException if the input values array is null.
* Throws IllegalArgumentException if the input values array is null.</p>
*
* @param values array holding values to add
* @param begin index of the first array element to add

View File

@ -24,10 +24,10 @@ import java.io.Serializable;
* <p>
* Provides a default implementation of <code>evaluate(double[]),</code>
* delegating to <code>evaluate(double[], int, int)</code> in the natural way.
* </p>
* <p>
* Also includes a <code>test</code> method that performs generic parameter
* validation for the <code>evaluate</code> methods.
* <p>
* validation for the <code>evaluate</code> methods.</p>
*
* @version $Revision$ $Date$
*/
@ -61,7 +61,7 @@ public abstract class AbstractUnivariateStatistic
* or the indices are invalid</li>
* <li>returns <code>false</li> if the array is non-null, but
* <code>length</code> is 0.
* </ul>
* </ul></p>
*
* @param values the input array
* @param begin index of the first array element to include

View File

@ -366,13 +366,13 @@ public class DescriptiveStatistics implements StatisticalSummary, Serializable {
* <p>
* The implementation provided here follows the first estimation procedure presented
* <a href="http://www.itl.nist.gov/div898/handbook/prc/section2/prc252.htm">here.</a>
* <p>
* </p><p>
* <strong>Preconditions</strong>:<ul>
* <li><code>0 &lt; p &lt; 100</code> (otherwise an
* <code>IllegalArgumentException</code> is thrown)</li>
* <li>at least one value must be stored (returns <code>Double.NaN
* </code> otherwise)</li>
* </ul>
* </ul></p>
*
* @param p the requested percentile (scaled from 0 - 100)
* @return An estimate for the pth percentile of the stored data

View File

@ -21,8 +21,9 @@ package org.apache.commons.math.stat.descriptive;
* {@link #increment} and {@link #incrementAll(double[])} methods for adding
* values and updating internal state.
* <p>
* 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.
* 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.</p>
*
* @version $Revision$ $Date$
*/

View File

@ -23,7 +23,7 @@ import java.io.Serializable;
* <p>
* Includes "stateless" <code>evaluate</code> methods that take
* <code>double[]</code> arrays as input and return the value of the statistic
* applied to the input values.
* applied to the input values.</p>
*
* @version $Revision$ $Date$
*/

View File

@ -23,25 +23,25 @@ import org.apache.commons.math.stat.descriptive.AbstractStorelessUnivariateStati
/**
* Computes the first moment (arithmetic mean). Uses the definitional formula:
* <p>
* mean = sum(x_i) / n
* mean = sum(x_i) / n </p>
* <p>
* where <code>n</code> is the number of observations.
* where <code>n</code> is the number of observations. </p>
* <p>
* To limit numeric errors, the value of the statistic is computed using the
* following recursive updating algorithm:
* following recursive updating algorithm: </p>
* <p>
* <ol>
* <li>Initialize <code>m = </code> the first value</li>
* <li>For each additional value, update using <br>
* <code>m = m + (new value - m) / (number of observations)</code></li>
* </ol>
* </ol></p>
* <p>
* Returns <code>Double.NaN</code> if the dataset is empty.
* Returns <code>Double.NaN</code> if the dataset is empty.</p>
* <p>
* <strong>Note that this implementation is not synchronized.</strong> If
* multiple threads access an instance of this class concurrently, and at least
* one of the threads invokes the <code>increment()</code> or
* <code>clear()</code> method, it must be synchronized externally.
* <code>clear()</code> method, it must be synchronized externally.</p>
*
* @version $Revision$ $Date$
*/

View File

@ -22,12 +22,12 @@ import java.io.Serializable;
* Computes a statistic related to the Fourth Central Moment. Specifically,
* what is computed is the sum of
* <p>
* (x_i - xbar) ^ 4,
* (x_i - xbar) ^ 4, </p>
* <p>
* where the x_i are the
* sample observations and xbar is the sample mean.
* sample observations and xbar is the sample mean. </p>
* <p>
* The following recursive updating formula is used:
* The following recursive updating formula is used: </p>
* <p>
* Let <ul>
* <li> dev = (current obs - previous mean) </li>
@ -35,18 +35,18 @@ import java.io.Serializable;
* <li> m2 = previous value of {@link ThirdMoment} </li>
* <li> n = number of observations (including current obs) </li>
* </ul>
* Then
* Then </p>
* <p>
* new value = old value - 4 * (dev/n) * m3 + 6 * (dev/n)^2 * m2 + <br>
* [n^2 - 3 * (n-1)] * dev^4 * (n-1) / n^3
* [n^2 - 3 * (n-1)] * dev^4 * (n-1) / n^3 </p>
* <p>
* Returns <code>Double.NaN</code> if no data values have been added and
* returns <code>0</code> if there is just one value in the data set.
* returns <code>0</code> if there is just one value in the data set. </p>
* <p>
* <strong>Note that this implementation is not synchronized.</strong> If
* multiple threads access an instance of this class concurrently, and at least
* one of the threads invokes the <code>increment()</code> or
* <code>clear()</code> method, it must be synchronized externally.
* <code>clear()</code> method, it must be synchronized externally. </p>
*
* @version $Revision$ $Date$
*/

View File

@ -24,7 +24,7 @@ import org.apache.commons.math.stat.descriptive.summary.SumOfLogs;
* geometric mean </a> of the available values.
* <p>
* Uses a {@link SumOfLogs} instance to compute sum of logs and returns
* <code> exp( 1/n (sum of logs) ).</code> Therefore,
* <code> exp( 1/n (sum of logs) ).</code> Therefore, </p>
* <ul>
* <li>If any of values are < 0, the result is <code>NaN.</code></li>
* <li>If all values are non-negative and less than
@ -33,12 +33,12 @@ import org.apache.commons.math.stat.descriptive.summary.SumOfLogs;
* <li>If both <code>Double.POSITIVE_INFINITY</code> and
* <code>Double.NEGATIVE_INFINITY</code> are among the values, the result is
* <code>NaN.</code></li>
* </ul>
* </ul> </p>
* <p>
* <strong>Note that this implementation is not synchronized.</strong> If
* multiple threads access an instance of this class concurrently, and at least
* one of the threads invokes the <code>increment()</code> or
* <code>clear()</code> method, it must be synchronized externally.
* <code>clear()</code> method, it must be synchronized externally.</p>
*
*
* @version $Revision$ $Date$
@ -87,9 +87,9 @@ public class GeometricMean extends AbstractStorelessUnivariateStatistic {
* Returns the geometric mean of the entries in the specified portion
* of the input array.
* <p>
* See {@link GeometricMean} for details on the computing algorithm.
* See {@link GeometricMean} for details on the computing algorithm.</p>
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
*
* @param values input array containing the values
* @param begin first array element to include

View File

@ -21,20 +21,20 @@ import org.apache.commons.math.stat.descriptive.AbstractStorelessUnivariateStati
/**
* Computes the Kurtosis of the available values.
* <p>
* We use the following (unbiased) formula to define kurtosis:
* We use the following (unbiased) formula to define kurtosis:</p>
* <p>
* kurtosis = { [n(n+1) / (n -1)(n - 2)(n-3)] sum[(x_i - mean)^4] / std^4 } - [3(n-1)^2 / (n-2)(n-3)]
* <p>
* </p><p>
* where n is the number of values, mean is the {@link Mean} and std is the
* {@link StandardDeviation}
* {@link StandardDeviation}</p>
* <p>
* Note that this statistic is undefined for n < 4. <code>Double.Nan</code>
* is returned when there is not sufficient data to compute the statistic.
* is returned when there is not sufficient data to compute the statistic.</p>
* <p>
* <strong>Note that this implementation is not synchronized.</strong> If
* multiple threads access an instance of this class concurrently, and at least
* one of the threads invokes the <code>increment()</code> or
* <code>clear()</code> method, it must be synchronized externally.
* <code>clear()</code> method, it must be synchronized externally.</p>
*
* @version $Revision$ $Date$
*/
@ -50,7 +50,7 @@ public class Kurtosis extends AbstractStorelessUnivariateStatistic {
* Determines whether or not this statistic can be incremented or cleared.
* <p>
* Statistics based on (constructed from) external moments cannot
* be incremented or cleared.
* be incremented or cleared.</p>
*/
protected boolean incMoment;
@ -129,9 +129,9 @@ public class Kurtosis extends AbstractStorelessUnivariateStatistic {
* Returns the kurtosis of the entries in the specified portion of the
* input array.
* <p>
* See {@link Kurtosis} for details on the computing algorithm.
* See {@link Kurtosis} for details on the computing algorithm.</p>
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
*
* @param values the input array
* @param begin index of the first array element to include

View File

@ -68,7 +68,7 @@ public class Mean extends AbstractStorelessUnivariateStatistic
* Determines whether or not this statistic can be incremented or cleared.
* <p>
* Statistics based on (constructed from) external moments cannot
* be incremented or cleared.
* be incremented or cleared.</p>
*/
protected boolean incMoment;
@ -125,9 +125,9 @@ public class Mean extends AbstractStorelessUnivariateStatistic
* the input array, or <code>Double.NaN</code> if the designated subarray
* is empty.
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
* <p>
* See {@link Mean} for details on the computing algorithm.
* See {@link Mean} for details on the computing algorithm.</p>
*
* @param values the input array
* @param begin index of the first array element to include

View File

@ -22,23 +22,23 @@ import java.io.Serializable;
* Computes a statistic related to the Second Central Moment. Specifically,
* what is computed is the sum of squared deviations from the sample mean.
* <p>
* The following recursive updating formula is used:
* The following recursive updating formula is used:</p>
* <p>
* Let <ul>
* <li> dev = (current obs - previous mean) </li>
* <li> n = number of observations (including current obs) </li>
* </ul>
* Then
* Then</p>
* <p>
* new value = old value + dev^2 * (n -1) / n.
* new value = old value + dev^2 * (n -1) / n.</p>
* <p>
* Returns <code>Double.NaN</code> if no data values have been added and
* returns <code>0</code> if there is just one value in the data set.
* returns <code>0</code> if there is just one value in the data set.</p>
* <p>
* <strong>Note that this implementation is not synchronized.</strong> If
* multiple threads access an instance of this class concurrently, and at least
* one of the threads invokes the <code>increment()</code> or
* <code>clear()</code> method, it must be synchronized externally.
* <code>clear()</code> method, it must be synchronized externally.</p>
*
* @version $Revision$ $Date$
*/

View File

@ -23,17 +23,17 @@ import org.apache.commons.math.stat.descriptive.AbstractStorelessUnivariateStati
/**
* Computes the skewness of the available values.
* <p>
* We use the following (unbiased) formula to define skewness:
* We use the following (unbiased) formula to define skewness:</p>
* <p>
* skewness = [n / (n -1) (n - 2)] sum[(x_i - mean)^3] / std^3
* skewness = [n / (n -1) (n - 2)] sum[(x_i - mean)^3] / std^3 </p>
* <p>
* where n is the number of values, mean is the {@link Mean} and std is the
* {@link StandardDeviation}
* {@link StandardDeviation} </p>
* <p>
* <strong>Note that this implementation is not synchronized.</strong> If
* multiple threads access an instance of this class concurrently, and at least
* one of the threads invokes the <code>increment()</code> or
* <code>clear()</code> method, it must be synchronized externally.
* <code>clear()</code> method, it must be synchronized externally. </p>
*
* @version $Revision$ $Date$
*/
@ -49,7 +49,7 @@ public class Skewness extends AbstractStorelessUnivariateStatistic implements Se
* Determines whether or not this statistic can be incremented or cleared.
* <p>
* Statistics based on (constructed from) external moments cannot
* be incremented or cleared.
* be incremented or cleared.</p>
*/
protected boolean incMoment;
@ -82,7 +82,7 @@ public class Skewness extends AbstractStorelessUnivariateStatistic implements Se
/**
* Returns the value of the statistic based on the values that have been added.
* <p>
* See {@link Skewness} for the definition used in the computation.
* See {@link Skewness} for the definition used in the computation.</p>
*
* @return the skewness of the available values.
*/
@ -121,9 +121,9 @@ public class Skewness extends AbstractStorelessUnivariateStatistic implements Se
* Returns the Skewness of the entries in the specifed portion of the
* input array.
* <p>
* See {@link Skewness} for the definition used in the computation.
* See {@link Skewness} for the definition used in the computation.</p>
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
*
* @param values the input array
* @param begin the index of the first array element to include

View File

@ -33,7 +33,7 @@ import org.apache.commons.math.stat.descriptive.AbstractStorelessUnivariateStati
* <strong>Note that this implementation is not synchronized.</strong> If
* multiple threads access an instance of this class concurrently, and at least
* one of the threads invokes the <code>increment()</code> or
* <code>clear()</code> method, it must be synchronized externally.
* <code>clear()</code> method, it must be synchronized externally.</p>
*
* @version $Revision$ $Date$
*/
@ -124,11 +124,11 @@ public class StandardDeviation extends AbstractStorelessUnivariateStatistic
* Returns the Standard Deviation of the entries in the input array, or
* <code>Double.NaN</code> if the array is empty.
* <p>
* Returns 0 for a single-value (i.e. length = 1) sample.
* Returns 0 for a single-value (i.e. length = 1) sample.</p>
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
* <p>
* Does not change the internal state of the statistic.
* Does not change the internal state of the statistic.</p>
*
* @param values the input array
* @return the standard deviation of the values or Double.NaN if length = 0
@ -143,11 +143,11 @@ public class StandardDeviation extends AbstractStorelessUnivariateStatistic
* the input array, or <code>Double.NaN</code> if the designated subarray
* is empty.
* <p>
* Returns 0 for a single-value (i.e. length = 1) sample.
* Returns 0 for a single-value (i.e. length = 1) sample. </p>
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
* <p>
* Does not change the internal state of the statistic.
* Does not change the internal state of the statistic.</p>
*
* @param values the input array
* @param begin index of the first array element to include
@ -165,16 +165,16 @@ public class StandardDeviation extends AbstractStorelessUnivariateStatistic
* the input array, using the precomputed mean value. Returns
* <code>Double.NaN</code> if the designated subarray is empty.
* <p>
* Returns 0 for a single-value (i.e. length = 1) sample.
* Returns 0 for a single-value (i.e. length = 1) sample.</p>
* <p>
* 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.
* computed.</p>
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
* <p>
* Does not change the internal state of the statistic.
* Does not change the internal state of the statistic.</p>
*
* @param values the input array
* @param mean the precomputed mean value
@ -194,16 +194,16 @@ public class StandardDeviation extends AbstractStorelessUnivariateStatistic
* the precomputed mean value. Returns
* <code>Double.NaN</code> if the designated subarray is empty.
* <p>
* Returns 0 for a single-value (i.e. length = 1) sample.
* Returns 0 for a single-value (i.e. length = 1) sample.</p>
* <p>
* 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.
* computed.</p>
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
* <p>
* Does not change the internal state of the statistic.
* Does not change the internal state of the statistic.</p>
*
* @param values the input array
* @param mean the precomputed mean value

View File

@ -22,24 +22,24 @@ import java.io.Serializable;
* Computes a statistic related to the Third Central Moment. Specifically,
* what is computed is the sum of cubed deviations from the sample mean.
* <p>
* The following recursive updating formula is used:
* The following recursive updating formula is used:</p>
* <p>
* Let <ul>
* <li> dev = (current obs - previous mean) </li>
* <li> m2 = previous value of {@link SecondMoment} </li>
* <li> n = number of observations (including current obs) </li>
* </ul>
* Then
* Then</p>
* <p>
* new value = old value - 3 * (dev/n) * m2 + (n-1) * (n -2) * (dev^3/n^2)
* new value = old value - 3 * (dev/n) * m2 + (n-1) * (n -2) * (dev^3/n^2)</p>
* <p>
* Returns <code>Double.NaN</code> if no data values have been added and
* returns <code>0</code> if there is just one value in the data set.
* returns <code>0</code> if there is just one value in the data set.</p>
* <p>
* <strong>Note that this implementation is not synchronized.</strong> If
* multiple threads access an instance of this class concurrently, and at least
* one of the threads invokes the <code>increment()</code> or
* <code>clear()</code> method, it must be synchronized externally.
* <code>clear()</code> method, it must be synchronized externally.</p>
*
* @version $Revision$ $Date$
*/

View File

@ -24,10 +24,10 @@ import org.apache.commons.math.stat.descriptive.AbstractStorelessUnivariateStati
* Computes the variance of the available values. By default, the unbiased
* "sample variance" definitional formula is used:
* <p>
* variance = sum((x_i - mean)^2) / (n - 1)
* variance = sum((x_i - mean)^2) / (n - 1) </p>
* <p>
* where mean is the {@link Mean} and <code>n</code> is the number
* of sample observations.
* of sample observations.</p>
* <p>
* The definitional formula does not have good numerical properties, so
* this implementation does not compute the statistic using the definitional
@ -46,13 +46,14 @@ import org.apache.commons.math.stat.descriptive.AbstractStorelessUnivariateStati
* <code>incrementAll</code> and then executing <code>getResult</code> will
* sometimes give a different, less accurate, result than executing
* <code>evaluate</code> with the full array of values. The former approach
* should only be used when the full array of values is not available.
* should only be used when the full array of values is not available.</p>
* <p>
* The "population variance" ( sum((x_i - mean)^2) / n ) can also
* be computed using this statistic. The <code>isBiasCorrected</code>
* property determines whether the "population" or "sample" value is
* returned by the <code>evaluate</code> and <code>getResult</code> methods.
* To compute population variances, set this property to <code>false.</code>
* </p>
* <p>
* <strong>Note that this implementation is not synchronized.</strong> If
* multiple threads access an instance of this class concurrently, and at least
@ -182,13 +183,13 @@ public class Variance extends AbstractStorelessUnivariateStatistic implements Se
* Returns the variance of the entries in the input array, or
* <code>Double.NaN</code> if the array is empty.
* <p>
* See {@link Variance} for details on the computing algorithm.
* See {@link Variance} for details on the computing algorithm.</p>
* <p>
* Returns 0 for a single-value (i.e. length = 1) sample.
* Returns 0 for a single-value (i.e. length = 1) sample.</p>
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
* <p>
* Does not change the internal state of the statistic.
* Does not change the internal state of the statistic.</p>
*
* @param values the input array
* @return the variance of the values or Double.NaN if length = 0
@ -206,13 +207,13 @@ public class Variance extends AbstractStorelessUnivariateStatistic implements Se
* the input array, or <code>Double.NaN</code> if the designated subarray
* is empty.
* <p>
* See {@link Variance} for details on the computing algorithm.
* See {@link Variance} for details on the computing algorithm.</p>
* <p>
* Returns 0 for a single-value (i.e. length = 1) sample.
* Returns 0 for a single-value (i.e. length = 1) sample.</p>
* <p>
* Does not change the internal state of the statistic.
* Does not change the internal state of the statistic.</p>
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
*
* @param values the input array
* @param begin index of the first array element to include
@ -243,18 +244,18 @@ public class Variance extends AbstractStorelessUnivariateStatistic implements Se
* the input array, using the precomputed mean value. Returns
* <code>Double.NaN</code> if the designated subarray is empty.
* <p>
* See {@link Variance} for details on the computing algorithm.
* See {@link Variance} for details on the computing algorithm.</p>
* <p>
* 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.
* computed.</p>
* <p>
* Returns 0 for a single-value (i.e. length = 1) sample.
* Returns 0 for a single-value (i.e. length = 1) sample.</p>
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
* <p>
* Does not change the internal state of the statistic.
* Does not change the internal state of the statistic.</p>
*
* @param values the input array
* @param mean the precomputed mean value
@ -297,20 +298,20 @@ public class Variance extends AbstractStorelessUnivariateStatistic implements Se
* precomputed mean value. Returns <code>Double.NaN</code> if the array
* is empty.
* <p>
* See {@link Variance} for details on the computing algorithm.
* See {@link Variance} for details on the computing algorithm.</p>
* <p>
* If <code>isBiasCorrected</code> is <code>true</code> the formula used
* assumes that the supplied mean value is the arithmetic mean of the
* sample data, not a known population parameter. If the mean is a known
* population parameter, or if the "population" version of the variance is
* desired, set <code>isBiasCorrected</code> to <code>false</code> before
* invoking this method.
* invoking this method.</p>
* <p>
* Returns 0 for a single-value (i.e. length = 1) sample.
* Returns 0 for a single-value (i.e. length = 1) sample.</p>
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
* <p>
* Does not change the internal state of the statistic.
* Does not change the internal state of the statistic.</p>
*
* @param values the input array
* @param mean the precomputed mean value

View File

@ -26,12 +26,12 @@ import org.apache.commons.math.stat.descriptive.AbstractStorelessUnivariateStati
* (i.e. <code>NaN</code> values have no impact on the value of the statistic).</li>
* <li>If any of the values equals <code>Double.POSITIVE_INFINITY</code>,
* the result is <code>Double.POSITIVE_INFINITY.</code></li>
* </ul>
* </ul></p>
* <p>
* <strong>Note that this implementation is not synchronized.</strong> If
* multiple threads access an instance of this class concurrently, and at least
* one of the threads invokes the <code>increment()</code> or
* <code>clear()</code> method, it must be synchronized externally.
* <code>clear()</code> method, it must be synchronized externally.</p>
*
* @version $Revision$ $Date$
*/
@ -65,8 +65,8 @@ public class Max extends AbstractStorelessUnivariateStatistic {
}
/**
* @see org.apache.commons.math.stat.descriptive.StorelessUnivariateStatistic#clear()
*/
* @see org.apache.commons.math.stat.descriptive.StorelessUnivariateStatistic#clear()
*/
public void clear() {
value = Double.NaN;
n = 0;
@ -92,14 +92,14 @@ public class Max extends AbstractStorelessUnivariateStatistic {
* is empty.
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null or
* the array index parameters are not valid.
* the array index parameters are not valid.</p>
* <p>
* <ul>
* <li>The result is <code>NaN</code> iff all values are <code>NaN</code>
* (i.e. <code>NaN</code> values have no impact on the value of the statistic).</li>
* <li>If any of the values equals <code>Double.POSITIVE_INFINITY</code>,
* the result is <code>Double.POSITIVE_INFINITY.</code></li>
* </ul>
* </ul></p>
*
* @param values the input array
* @param begin index of the first array element to include

View File

@ -26,7 +26,7 @@ import java.io.Serializable;
* <strong>Note that this implementation is not synchronized.</strong> If
* multiple threads access an instance of this class concurrently, and at least
* one of the threads invokes the <code>increment()</code> or
* <code>clear()</code> method, it must be synchronized externally.
* <code>clear()</code> method, it must be synchronized externally.</p>
*
* @version $Revision$ $Date$
*/

View File

@ -28,12 +28,12 @@ import org.apache.commons.math.stat.descriptive.AbstractStorelessUnivariateStati
* (i.e. <code>NaN</code> values have no impact on the value of the statistic).</li>
* <li>If any of the values equals <code>Double.NEGATIVE_INFINITY</code>,
* the result is <code>Double.NEGATIVE_INFINITY.</code></li>
* </ul>
* </ul></p>
* <p>
* <strong>Note that this implementation is not synchronized.</strong> If
* multiple threads access an instance of this class concurrently, and at least
* one of the threads invokes the <code>increment()</code> or
* <code>clear()</code> method, it must be synchronized externally.
* <code>clear()</code> method, it must be synchronized externally.</p>
*
* @version $Revision$ $Date$
*/
@ -94,14 +94,14 @@ public class Min extends AbstractStorelessUnivariateStatistic implements Seriali
* is empty.
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null or
* the array index parameters are not valid.
* the array index parameters are not valid.</p>
* <p>
* <ul>
* <li>The result is <code>NaN</code> iff all values are <code>NaN</code>
* (i.e. <code>NaN</code> values have no impact on the value of the statistic).</li>
* <li>If any of the values equals <code>Double.NEGATIVE_INFINITY</code>,
* the result is <code>Double.NEGATIVE_INFINITY.</code></li>
* </ul>
* </ul> </p>
*
* @param values the input array
* @param begin index of the first array element to include

View File

@ -41,7 +41,7 @@ import org.apache.commons.math.stat.descriptive.AbstractUnivariateStatistic;
* <code>floor(pos)</code> in the array and let <code>upper</code> be the
* next element in the array. Return <code>lower + d * (upper - lower)</code>
* </li>
* </ol>
* </ol></p>
* <p>
* To compute percentiles, the data must be (totally) ordered. Input arrays
* are copied and then sorted using {@link java.util.Arrays#sort(double[])}.
@ -50,16 +50,16 @@ import org.apache.commons.math.stat.descriptive.AbstractUnivariateStatistic;
* <code>Double.NaN</code> larger than any other value (including
* <code>Double.POSITIVE_INFINITY</code>). Therefore, for example, the median
* (50th percentile) of
* <code>{0, 1, 2, 3, 4, Double.NaN}</code> evaluates to <code>2.5.</code>
* <code>{0, 1, 2, 3, 4, Double.NaN}</code> evaluates to <code>2.5.</code></p>
* <p>
* Since percentile estimation usually involves interpolation between array
* elements, arrays containing <code>NaN</code> or infinite values will often
* result in <code>NaN<code> or infinite values returned.
* result in <code>NaN<code> or infinite values returned.</p>
* <p>
* <strong>Note that this implementation is not synchronized.</strong> If
* multiple threads access an instance of this class concurrently, and at least
* one of the threads invokes the <code>increment()</code> or
* <code>clear()</code> method, it must be synchronized externally.
* <code>clear()</code> method, it must be synchronized externally.</p>
*
* @version $Revision$ $Date$
*/
@ -95,7 +95,7 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa
* in the <code>values</code> array.
* <p>
* Calls to this method do not modify the internal <code>quantile</code>
* state of this statistic.
* state of this statistic.</p>
* <p>
* <ul>
* <li>Returns <code>Double.NaN</code> if <code>values</code> has length
@ -105,10 +105,10 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa
* <li>Throws <code>IllegalArgumentException</code> if <code>values</code>
* is null or p is not a valid quantile value (p must be greater than 0
* and less than or equal to 100) </li>
* </ul>
* </ul></p>
* <p>
* See {@link Percentile} for a description of the percentile estimation
* algorithm used.
* algorithm used.</p>
*
* @param values input array of values
* @param p the percentile value to compute
@ -133,10 +133,10 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa
* <li>Throws <code>IllegalArgumentException</code> if <code>values</code>
* is null, or <code>start</code> or <code>length</code>
* is invalid</li>
* </ul>
* </ul></p>
* <p>
* See {@link Percentile} for a description of the percentile estimation
* algorithm used.
* algorithm used.</p>
*
* @param values the input array
* @param start index of the first array element to include
@ -156,7 +156,7 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa
* values.
* <p>
* Calls to this method do not modify the internal <code>quantile</code>
* state of this statistic.
* state of this statistic.</p>
* <p>
* <ul>
* <li>Returns <code>Double.NaN</code> if <code>length = 0</code></li>
@ -166,10 +166,10 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa
* is null , <code>begin</code> or <code>length</code> is invalid, or
* <code>p</code> is not a valid quantile value (p must be greater than 0
* and less than or equal to 100)</li>
* </ul>
* </ul></p>
* <p>
* See {@link Percentile} for a description of the percentile estimation
* algorithm used.
* See {@link Percentile} for a description of the percentile estimation
* algorithm used.</p>
*
* @param values array of input values
* @param p the percentile to compute

View File

@ -24,12 +24,12 @@ import org.apache.commons.math.stat.descriptive.AbstractStorelessUnivariateStati
* Returns the product of the available values.
* <p>
* If there are no values in the dataset, or any of the values are
* <code>NaN</code>, then <code>NaN</code> is returned.
* <p>
* <code>NaN</code>, then <code>NaN</code> is returned.</p>
* <p>
* <strong>Note that this implementation is not synchronized.</strong> If
* multiple threads access an instance of this class concurrently, and at least
* one of the threads invokes the <code>increment()</code> or
* <code>clear()</code> method, it must be synchronized externally.
* <code>clear()</code> method, it must be synchronized externally.</p>
*
* @version $Revision$ $Date$
*/
@ -93,7 +93,7 @@ public class Product extends AbstractStorelessUnivariateStatistic implements Ser
* the input array, or <code>Double.NaN</code> if the designated subarray
* is empty.
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
*
* @param values the input array
* @param begin index of the first array element to include

View File

@ -24,12 +24,12 @@ import org.apache.commons.math.stat.descriptive.AbstractStorelessUnivariateStati
* Returns the sum of the available values.
* <p>
* If there are no values in the dataset, or any of the values are
* <code>NaN</code>, then <code>NaN</code> is returned.
* <code>NaN</code>, then <code>NaN</code> is returned.</p>
* <p>
* <strong>Note that this implementation is not synchronized.</strong> If
* multiple threads access an instance of this class concurrently, and at least
* one of the threads invokes the <code>increment()</code> or
* <code>clear()</code> method, it must be synchronized externally.
* <code>clear()</code> method, it must be synchronized externally.</p>
*
* @version $Revision$ $Date$
*/
@ -93,7 +93,7 @@ public class Sum extends AbstractStorelessUnivariateStatistic implements Seriali
* the input array, or <code>Double.NaN</code> if the designated subarray
* is empty.
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
*
* @param values the input array
* @param begin index of the first array element to include

View File

@ -32,12 +32,12 @@ import org.apache.commons.math.stat.descriptive.AbstractStorelessUnivariateStati
* <li>If both <code>Double.POSITIVE_INFINITY</code> and
* <code>Double.NEGATIVE_INFINITY</code> are among the values, the result is
* <code>NaN.</code></li>
* </ul>
* </ul></p>
* <p>
* <strong>Note that this implementation is not synchronized.</strong> If
* multiple threads access an instance of this class concurrently, and at least
* one of the threads invokes the <code>increment()</code> or
* <code>clear()</code> method, it must be synchronized externally.
* <code>clear()</code> method, it must be synchronized externally.</p>
*
* @version $Revision$ $Date$
*/
@ -101,9 +101,9 @@ public class SumOfLogs extends AbstractStorelessUnivariateStatistic implements S
* the input array, or <code>Double.NaN</code> if the designated subarray
* is empty.
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
* <p>
* See {@link SumOfLogs}.
* See {@link SumOfLogs}.</p>
*
* @param values the input array
* @param begin index of the first array element to include

View File

@ -24,12 +24,12 @@ import org.apache.commons.math.stat.descriptive.AbstractStorelessUnivariateStati
* Returns the sum of the squares of the available values.
* <p>
* If there are no values in the dataset, or any of the values are
* <code>NaN</code>, then <code>NaN</code> is returned.
* <code>NaN</code>, then <code>NaN</code> is returned.</p>
* <p>
* <strong>Note that this implementation is not synchronized.</strong> If
* multiple threads access an instance of this class concurrently, and at least
* one of the threads invokes the <code>increment()</code> or
* <code>clear()</code> method, it must be synchronized externally.
* <code>clear()</code> method, it must be synchronized externally.</p>
*
* @version $Revision$ $Date$
*/
@ -93,7 +93,7 @@ public class SumOfSquares extends AbstractStorelessUnivariateStatistic implement
* the input array, or <code>Double.NaN</code> if the designated subarray
* is empty.
* <p>
* Throws <code>IllegalArgumentException</code> if the array is null.
* Throws <code>IllegalArgumentException</code> if the array is null.</p>
*
* @param values the input array
* @param begin index of the first array element to include

View File

@ -33,7 +33,7 @@ public interface ChiSquareTest {
* frequency counts.
* <p>
* This statistic can be used to perform a Chi-Square test evaluating the null hypothesis that
* the observed counts follow the expected distribution.
* the observed counts follow the expected distribution.</p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>Expected counts must all be positive.
@ -42,9 +42,9 @@ public interface ChiSquareTest {
* </li>
* <li>The observed and expected arrays must have the same length and
* their common length must be at least 2.
* </li></ul><p>
* </li></ul></p><p>
* If any of the preconditions are not met, an
* <code>IllegalArgumentException</code> is thrown.
* <code>IllegalArgumentException</code> is thrown.</p>
*
* @param observed array of observed frequency counts
* @param expected array of expected frequency counts
@ -64,7 +64,7 @@ public interface ChiSquareTest {
* <p>
* The number returned is the smallest significance level at which one can reject
* the null hypothesis that the observed counts conform to the frequency distribution
* described by the expected counts.
* described by the expected counts.</p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>Expected counts must all be positive.
@ -73,9 +73,9 @@ public interface ChiSquareTest {
* </li>
* <li>The observed and expected arrays must have the same length and
* their common length must be at least 2.
* </li></ul><p>
* </li></ul></p><p>
* If any of the preconditions are not met, an
* <code>IllegalArgumentException</code> is thrown.
* <code>IllegalArgumentException</code> is thrown.</p>
*
* @param observed array of observed frequency counts
* @param expected array of expected frequency counts
@ -95,8 +95,8 @@ public interface ChiSquareTest {
* <p>
* <strong>Example:</strong><br>
* To test the hypothesis that <code>observed</code> follows
* <code>expected</code> at the 99% level, use <p>
* <code>chiSquareTest(expected, observed, 0.01) </code>
* <code>expected</code> at the 99% level, use </p><p>
* <code>chiSquareTest(expected, observed, 0.01) </code></p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>Expected counts must all be positive.
@ -106,9 +106,9 @@ public interface ChiSquareTest {
* <li>The observed and expected arrays must have the same length and
* their common length must be at least 2.
* <li> <code> 0 < alpha < 0.5 </code>
* </li></ul><p>
* </li></ul></p><p>
* If any of the preconditions are not met, an
* <code>IllegalArgumentException</code> is thrown.
* <code>IllegalArgumentException</code> is thrown.</p>
*
* @param observed array of observed frequency counts
* @param expected array of expected frequency counts
@ -127,19 +127,21 @@ public interface ChiSquareTest {
* chi-square test of independence</a> based on the input <code>counts</code>
* array, viewed as a two-way table.
* <p>
* The rows of the 2-way table are <code>count[0], ... , count[count.length - 1] </code>
* The rows of the 2-way table are
* <code>count[0], ... , count[count.length - 1] </code></p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>All counts must be >= 0.
* </li>
* <li>The count array must be rectangular (i.e. all count[i] subarrays must have the same length).
* <li>The count array must be rectangular (i.e. all count[i] subarrays
* must have the same length).
* </li>
* <li>The 2-way table represented by <code>counts</code> must have at least 2 columns and
* at least 2 rows.
* <li>The 2-way table represented by <code>counts</code> must have at
* least 2 columns and at least 2 rows.
* </li>
* </li></ul><p>
* </li></ul></p><p>
* If any of the preconditions are not met, an
* <code>IllegalArgumentException</code> is thrown.
* <code>IllegalArgumentException</code> is thrown.</p>
*
* @param counts array representation of 2-way table
* @return chiSquare statistic
@ -156,7 +158,8 @@ public interface ChiSquareTest {
* chi-square test of independence</a> based on the input <code>counts</code>
* array, viewed as a two-way table.
* <p>
* The rows of the 2-way table are <code>count[0], ... , count[count.length - 1] </code>
* The rows of the 2-way table are
* <code>count[0], ... , count[count.length - 1] </code></p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>All counts must be >= 0.
@ -166,9 +169,9 @@ public interface ChiSquareTest {
* <li>The 2-way table represented by <code>counts</code> must have at least 2 columns and
* at least 2 rows.
* </li>
* </li></ul><p>
* </li></ul></p><p>
* If any of the preconditions are not met, an
* <code>IllegalArgumentException</code> is thrown.
* <code>IllegalArgumentException</code> is thrown.</p>
*
* @param counts array representation of 2-way table
* @return p-value
@ -185,12 +188,14 @@ public interface ChiSquareTest {
* with significance level <code>alpha</code>. Returns true iff the null hypothesis can be rejected
* with 100 * (1 - alpha) percent confidence.
* <p>
* The rows of the 2-way table are <code>count[0], ... , count[count.length - 1] </code>
* The rows of the 2-way table are
* <code>count[0], ... , count[count.length - 1] </code></p>
* <p>
* <strong>Example:</strong><br>
* To test the null hypothesis that the counts in <code>count[0], ... , count[count.length - 1] </code>
* all correspond to the same underlying probability distribution at the 99% level, use <p>
* <code>chiSquareTest(counts, 0.01) </code>
* To test the null hypothesis that the counts in
* <code>count[0], ... , count[count.length - 1] </code>
* all correspond to the same underlying probability distribution at the 99% level, use </p><p>
* <code>chiSquareTest(counts, 0.01) </code></p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>All counts must be >= 0.
@ -200,9 +205,9 @@ public interface ChiSquareTest {
* <li>The 2-way table represented by <code>counts</code> must have at least 2 columns and
* at least 2 rows.
* </li>
* </li></ul><p>
* </li></ul></p><p>
* If any of the preconditions are not met, an
* <code>IllegalArgumentException</code> is thrown.
* <code>IllegalArgumentException</code> is thrown.</p>
*
* @param counts array representation of 2-way table
* @param alpha significance level of the test

View File

@ -29,17 +29,17 @@ import org.apache.commons.math.stat.descriptive.StatisticalSummary;
* <li>Homoscedastic (equal variance assumption) or heteroscedastic
* (for two sample tests)</li>
* <li>Fixed significance level (boolean-valued) or returning p-values.
* </li></ul>
* </li></ul></p>
* <p>
* Test statistics are available for all tests. Methods including "Test" in
* in their names perform tests, all other methods return t-statistics. Among
* the "Test" methods, <code>double-</code>valued methods return p-values;
* <code>boolean-</code>valued methods perform fixed significance level tests.
* Significance levels are always specified as numbers between 0 and 0.5
* (e.g. tests at the 95% level use <code>alpha=0.05</code>).
* (e.g. tests at the 95% level use <code>alpha=0.05</code>).</p>
* <p>
* Input to tests can be either <code>double[]</code> arrays or
* {@link StatisticalSummary} instances.
* {@link StatisticalSummary} instances.</p>
*
*
* @version $Revision$ $Date$
@ -56,7 +56,7 @@ public interface TTest {
* <strong>Preconditions</strong>: <ul>
* <li>The input arrays must have the same length and their common length
* must be at least 2.
* </li></ul>
* </li></ul></p>
*
* @param sample1 array of sample data values
* @param sample2 array of sample data values
@ -76,23 +76,23 @@ public interface TTest {
* at which one can reject the null hypothesis that the mean of the paired
* differences is 0 in favor of the two-sided alternative that the mean paired
* difference is not equal to 0. For a one-sided test, divide the returned
* value by 2.
* value by 2.</p>
* <p>
* This test is equivalent to a one-sample t-test computed using
* {@link #tTest(double, double[])} with <code>mu = 0</code> and the sample
* array consisting of the signed differences between corresponding elements of
* <code>sample1</code> and <code>sample2.</code>
* <code>sample1</code> and <code>sample2.</code></p>
* <p>
* <strong>Usage Note:</strong><br>
* The validity of the p-value depends on the assumptions of the parametric
* t-test procedure, as discussed
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">
* here</a>
* here</a></p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>The input array lengths must be the same and their common length must
* be at least 2.
* </li></ul>
* </li></ul></p>
*
* @param sample1 array of sample data values
* @param sample2 array of sample data values
@ -111,20 +111,20 @@ public interface TTest {
* <p>
* Returns <code>true</code> iff the null hypothesis can be rejected with
* confidence <code>1 - alpha</code>. To perform a 1-sided test, use
* <code>alpha * 2</code>
* <code>alpha * 2</code></p>
* <p>
* <strong>Usage Note:</strong><br>
* The validity of the test depends on the assumptions of the parametric
* t-test procedure, as discussed
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">
* here</a>
* here</a></p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>The input array lengths must be the same and their common length
* must be at least 2.
* </li>
* <li> <code> 0 < alpha < 0.5 </code>
* </li></ul>
* </li></ul></p>
*
* @param sample1 array of sample data values
* @param sample2 array of sample data values
@ -144,10 +144,10 @@ public interface TTest {
* t statistic </a> given observed values and a comparison constant.
* <p>
* This statistic can be used to perform a one sample t-test for the mean.
* <p>
* </p><p>
* <strong>Preconditions</strong>: <ul>
* <li>The observed array length must be at least 2.
* </li></ul>
* </li></ul></p>
*
* @param mu comparison constant
* @param observed array of values
@ -162,10 +162,10 @@ public interface TTest {
* <code>sampleStats</code> to <code>mu</code>.
* <p>
* This statistic can be used to perform a one sample t-test for the mean.
* <p>
* </p><p>
* <strong>Preconditions</strong>: <ul>
* <li><code>observed.getN() > = 2</code>.
* </li></ul>
* </li></ul></p>
*
* @param mu comparison constant
* @param sampleStats DescriptiveStatistics holding sample summary statitstics
@ -180,27 +180,27 @@ public interface TTest {
* equal variances hypothesis, use {@link #t(double[], double[])}.
* <p>
* This statistic can be used to perform a (homoscedastic) two-sample
* t-test to compare sample means.
* t-test to compare sample means.</p>
* <p>
* The t-statisitc is
* The t-statisitc is</p>
* <p>
* &nbsp;&nbsp;<code> t = (m1 - m2) / (sqrt(1/n1 +1/n2) sqrt(var))</code>
* <p>
* </p><p>
* where <strong><code>n1</code></strong> is the size of first sample;
* <strong><code> n2</code></strong> is the size of second sample;
* <strong><code> m1</code></strong> is the mean of first sample;
* <strong><code> m2</code></strong> is the mean of second sample</li>
* </ul>
* and <strong><code>var</code></strong> is the pooled variance estimate:
* <p>
* </p><p>
* <code>var = sqrt(((n1 - 1)var1 + (n2 - 1)var2) / ((n1-1) + (n2-1)))</code>
* <p>
* </p><p>
* with <strong><code>var1<code></strong> the variance of the first sample and
* <strong><code>var2</code></strong> the variance of the second sample.
* <p>
* </p><p>
* <strong>Preconditions</strong>: <ul>
* <li>The observed array lengths must both be at least 2.
* </li></ul>
* </li></ul></p>
*
* @param sample1 array of sample data values
* @param sample2 array of sample data values
@ -215,22 +215,22 @@ public interface TTest {
* variances, use {@link #homoscedasticT(double[], double[])}.
* <p>
* This statistic can be used to perform a two-sample t-test to compare
* sample means.
* sample means.</p>
* <p>
* The t-statisitc is
* The t-statisitc is</p>
* <p>
* &nbsp;&nbsp; <code> t = (m1 - m2) / sqrt(var1/n1 + var2/n2)</code>
* <p>
* </p><p>
* where <strong><code>n1</code></strong> is the size of the first sample
* <strong><code> n2</code></strong> is the size of the second sample;
* <strong><code> m1</code></strong> is the mean of the first sample;
* <strong><code> m2</code></strong> is the mean of the second sample;
* <strong><code> var1</code></strong> is the variance of the first sample;
* <strong><code> var2</code></strong> is the variance of the second sample;
* <p>
* </p><p>
* <strong>Preconditions</strong>: <ul>
* <li>The observed array lengths must both be at least 2.
* </li></ul>
* </li></ul></p>
*
* @param sample1 array of sample data values
* @param sample2 array of sample data values
@ -247,23 +247,23 @@ public interface TTest {
* compute a t-statistic under the equal variances assumption.
* <p>
* This statistic can be used to perform a two-sample t-test to compare
* sample means.
* sample means.</p>
* <p>
* The returned t-statisitc is
* The returned t-statisitc is</p>
* <p>
* &nbsp;&nbsp; <code> t = (m1 - m2) / sqrt(var1/n1 + var2/n2)</code>
* <p>
* </p><p>
* where <strong><code>n1</code></strong> is the size of the first sample;
* <strong><code> n2</code></strong> is the size of the second sample;
* <strong><code> m1</code></strong> is the mean of the first sample;
* <strong><code> m2</code></strong> is the mean of the second sample
* <strong><code> var1</code></strong> is the variance of the first sample;
* <strong><code> var2</code></strong> is the variance of the second sample
* <p>
* </p><p>
* <strong>Preconditions</strong>: <ul>
* <li>The datasets described by the two Univariates must each contain
* at least 2 observations.
* </li></ul>
* </li></ul></p>
*
* @param sampleStats1 StatisticalSummary describing data from the first sample
* @param sampleStats2 StatisticalSummary describing data from the second sample
@ -282,27 +282,27 @@ public interface TTest {
* {@link #t(StatisticalSummary, StatisticalSummary)}.
* <p>
* This statistic can be used to perform a (homoscedastic) two-sample
* t-test to compare sample means.
* t-test to compare sample means.</p>
* <p>
* The t-statisitc returned is
* The t-statisitc returned is</p>
* <p>
* &nbsp;&nbsp;<code> t = (m1 - m2) / (sqrt(1/n1 +1/n2) sqrt(var))</code>
* <p>
* </p><p>
* where <strong><code>n1</code></strong> is the size of first sample;
* <strong><code> n2</code></strong> is the size of second sample;
* <strong><code> m1</code></strong> is the mean of first sample;
* <strong><code> m2</code></strong> is the mean of second sample
* and <strong><code>var</code></strong> is the pooled variance estimate:
* <p>
* </p><p>
* <code>var = sqrt(((n1 - 1)var1 + (n2 - 1)var2) / ((n1-1) + (n2-1)))</code>
* <p>
* </p><p>
* with <strong><code>var1<code></strong> the variance of the first sample and
* <strong><code>var2</code></strong> the variance of the second sample.
* <p>
* </p><p>
* <strong>Preconditions</strong>: <ul>
* <li>The datasets described by the two Univariates must each contain
* at least 2 observations.
* </li></ul>
* </li></ul></p>
*
* @param sampleStats1 StatisticalSummary describing data from the first sample
* @param sampleStats2 StatisticalSummary describing data from the second sample
@ -322,16 +322,16 @@ public interface TTest {
* at which one can reject the null hypothesis that the mean equals
* <code>mu</code> in favor of the two-sided alternative that the mean
* is different from <code>mu</code>. For a one-sided test, divide the
* returned value by 2.
* returned value by 2.</p>
* <p>
* <strong>Usage Note:</strong><br>
* The validity of the test depends on the assumptions of the parametric
* t-test procedure, as discussed
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">here</a>
* <p>
* </p><p>
* <strong>Preconditions</strong>: <ul>
* <li>The observed array length must be at least 2.
* </li></ul>
* </li></ul></p>
*
* @param mu constant value to compare sample mean against
* @param sample array of sample data values
@ -348,7 +348,7 @@ public interface TTest {
* <p>
* Returns <code>true</code> iff the null hypothesis can be
* rejected with confidence <code>1 - alpha</code>. To
* perform a 1-sided test, use <code>alpha * 2</code>
* perform a 1-sided test, use <code>alpha * 2</code></p>
* <p>
* <strong>Examples:</strong><br><ol>
* <li>To test the (2-sided) hypothesis <code>sample mean = mu </code> at
@ -358,16 +358,16 @@ public interface TTest {
* at the 99% level, first verify that the measured sample mean is less
* than <code>mu</code> and then use
* <br><code>tTest(mu, sample, 0.02) </code>
* </li></ol>
* </li></ol></p>
* <p>
* <strong>Usage Note:</strong><br>
* The validity of the test depends on the assumptions of the one-sample
* parametric t-test procedure, as discussed
* <a href="http://www.basic.nwu.edu/statguidefiles/sg_glos.html#one-sample">here</a>
* <p>
* </p><p>
* <strong>Preconditions</strong>: <ul>
* <li>The observed array length must be at least 2.
* </li></ul>
* </li></ul></p>
*
* @param mu constant value to compare sample mean against
* @param sample array of sample data values
@ -388,17 +388,17 @@ public interface TTest {
* at which one can reject the null hypothesis that the mean equals
* <code>mu</code> in favor of the two-sided alternative that the mean
* is different from <code>mu</code>. For a one-sided test, divide the
* returned value by 2.
* returned value by 2.</p>
* <p>
* <strong>Usage Note:</strong><br>
* The validity of the test depends on the assumptions of the parametric
* t-test procedure, as discussed
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">
* here</a>
* here</a></p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>The sample must contain at least 2 observations.
* </li></ul>
* </li></ul></p>
*
* @param mu constant value to compare sample mean against
* @param sampleStats StatisticalSummary describing sample data
@ -416,7 +416,7 @@ public interface TTest {
* <p>
* Returns <code>true</code> iff the null hypothesis can be rejected with
* confidence <code>1 - alpha</code>. To perform a 1-sided test, use
* <code>alpha * 2.</code>
* <code>alpha * 2.</code></p>
* <p>
* <strong>Examples:</strong><br><ol>
* <li>To test the (2-sided) hypothesis <code>sample mean = mu </code> at
@ -426,16 +426,16 @@ public interface TTest {
* at the 99% level, first verify that the measured sample mean is less
* than <code>mu</code> and then use
* <br><code>tTest(mu, sampleStats, 0.02) </code>
* </li></ol>
* </li></ol></p>
* <p>
* <strong>Usage Note:</strong><br>
* The validity of the test depends on the assumptions of the one-sample
* parametric t-test procedure, as discussed
* <a href="http://www.basic.nwu.edu/statguidefiles/sg_glos.html#one-sample">here</a>
* <p>
* </p><p>
* <strong>Preconditions</strong>: <ul>
* <li>The sample must include at least 2 observations.
* </li></ul>
* </li></ul></p>
*
* @param mu constant value to compare sample mean against
* @param sampleStats StatisticalSummary describing sample data values
@ -457,7 +457,7 @@ public interface TTest {
* The number returned is the smallest significance level
* at which one can reject the null hypothesis that the two means are
* equal in favor of the two-sided alternative that they are different.
* For a one-sided test, divide the returned value by 2.
* For a one-sided test, divide the returned value by 2.</p>
* <p>
* The test does not assume that the underlying popuation variances are
* equal and it uses approximated degrees of freedom computed from the
@ -467,17 +467,17 @@ public interface TTest {
* as described
* <a href="http://www.itl.nist.gov/div898/handbook/prc/section3/prc31.htm">
* here.</a> To perform the test under the assumption of equal subpopulation
* variances, use {@link #homoscedasticTTest(double[], double[])}.
* variances, use {@link #homoscedasticTTest(double[], double[])}.</p>
* <p>
* <strong>Usage Note:</strong><br>
* The validity of the p-value depends on the assumptions of the parametric
* t-test procedure, as discussed
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">
* here</a>
* here</a></p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>The observed array lengths must both be at least 2.
* </li></ul>
* </li></ul></p>
*
* @param sample1 array of sample data values
* @param sample2 array of sample data values
@ -493,26 +493,26 @@ public interface TTest {
* comparing the means of the input arrays, under the assumption that
* the two samples are drawn from subpopulations with equal variances.
* To perform the test without the equal variances assumption, use
* {@link #tTest(double[], double[])}.
* {@link #tTest(double[], double[])}.</p>
* <p>
* The number returned is the smallest significance level
* at which one can reject the null hypothesis that the two means are
* equal in favor of the two-sided alternative that they are different.
* For a one-sided test, divide the returned value by 2.
* For a one-sided test, divide the returned value by 2.</p>
* <p>
* A pooled variance estimate is used to compute the t-statistic. See
* {@link #homoscedasticT(double[], double[])}. The sum of the sample sizes
* minus 2 is used as the degrees of freedom.
* minus 2 is used as the degrees of freedom.</p>
* <p>
* <strong>Usage Note:</strong><br>
* The validity of the p-value depends on the assumptions of the parametric
* t-test procedure, as discussed
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">
* here</a>
* here</a></p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>The observed array lengths must both be at least 2.
* </li></ul>
* </li></ul></p>
*
* @param sample1 array of sample data values
* @param sample2 array of sample data values
@ -536,13 +536,12 @@ public interface TTest {
* <p>
* Returns <code>true</code> iff the null hypothesis that the means are
* equal can be rejected with confidence <code>1 - alpha</code>. To
* perform a 1-sided test, use <code>alpha * 2</code>
* perform a 1-sided test, use <code>alpha * 2</code></p>
* <p>
* See {@link #t(double[], double[])} for the formula used to compute the
* t-statistic. Degrees of freedom are approximated using the
* <a href="http://www.itl.nist.gov/div898/handbook/prc/section3/prc31.htm">
* Welch-Satterthwaite approximation.</a>
* Welch-Satterthwaite approximation.</a></p>
* <p>
* <strong>Examples:</strong><br><ol>
* <li>To test the (2-sided) hypothesis <code>mean 1 = mean 2 </code> at
@ -553,19 +552,19 @@ public interface TTest {
* at the 99% level, first verify that the measured mean of <code>sample 1</code>
* is less than the mean of <code>sample 2</code> and then use
* <br><code>tTest(sample1, sample2, 0.02) </code>
* </li></ol>
* </li></ol></p>
* <p>
* <strong>Usage Note:</strong><br>
* The validity of the test depends on the assumptions of the parametric
* t-test procedure, as discussed
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">
* here</a>
* here</a></p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>The observed array lengths must both be at least 2.
* </li>
* <li> <code> 0 < alpha < 0.5 </code>
* </li></ul>
* </li></ul></p>
*
* @param sample1 array of sample data values
* @param sample2 array of sample data values
@ -594,11 +593,11 @@ public interface TTest {
* equal can be rejected with confidence <code>1 - alpha</code>. To
* perform a 1-sided test, use <code>alpha * 2.</code> To perform the test
* without the assumption of equal subpopulation variances, use
* {@link #tTest(double[], double[], double)}.
* {@link #tTest(double[], double[], double)}.</p>
* <p>
* A pooled variance estimate is used to compute the t-statistic. See
* {@link #t(double[], double[])} for the formula. The sum of the sample
* sizes minus 2 is used as the degrees of freedom.
* sizes minus 2 is used as the degrees of freedom.</p>
* <p>
* <strong>Examples:</strong><br><ol>
* <li>To test the (2-sided) hypothesis <code>mean 1 = mean 2 </code> at
@ -609,19 +608,19 @@ public interface TTest {
* <code>sample 1</code> is less than the mean of <code>sample 2</code>
* and then use
* <br><code>tTest(sample1, sample2, 0.02) </code>
* </li></ol>
* </li></ol></p>
* <p>
* <strong>Usage Note:</strong><br>
* The validity of the test depends on the assumptions of the parametric
* t-test procedure, as discussed
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">
* here</a>
* here</a></p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>The observed array lengths must both be at least 2.
* </li>
* <li> <code> 0 < alpha < 0.5 </code>
* </li></ul>
* </li></ul></p>
*
* @param sample1 array of sample data values
* @param sample2 array of sample data values
@ -645,24 +644,24 @@ public interface TTest {
* The number returned is the smallest significance level
* at which one can reject the null hypothesis that the two means are
* equal in favor of the two-sided alternative that they are different.
* For a one-sided test, divide the returned value by 2.
* For a one-sided test, divide the returned value by 2.</p>
* <p>
* The test does not assume that the underlying popuation variances are
* equal and it uses approximated degrees of freedom computed from the
* sample data to compute the p-value. To perform the test assuming
* equal variances, use
* {@link #homoscedasticTTest(StatisticalSummary, StatisticalSummary)}.
* {@link #homoscedasticTTest(StatisticalSummary, StatisticalSummary)}.</p>
* <p>
* <strong>Usage Note:</strong><br>
* The validity of the p-value depends on the assumptions of the parametric
* t-test procedure, as discussed
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">
* here</a>
* here</a></p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>The datasets described by the two Univariates must each contain
* at least 2 observations.
* </li></ul>
* </li></ul></p>
*
* @param sampleStats1 StatisticalSummary describing data from the first sample
* @param sampleStats2 StatisticalSummary describing data from the second sample
@ -685,21 +684,21 @@ public interface TTest {
* The number returned is the smallest significance level
* at which one can reject the null hypothesis that the two means are
* equal in favor of the two-sided alternative that they are different.
* For a one-sided test, divide the returned value by 2.
* For a one-sided test, divide the returned value by 2.</p>
* <p>
* See {@link #homoscedasticT(double[], double[])} for the formula used to
* compute the t-statistic. The sum of the sample sizes minus 2 is used as
* the degrees of freedom.
* the degrees of freedom.</p>
* <p>
* <strong>Usage Note:</strong><br>
* The validity of the p-value depends on the assumptions of the parametric
* t-test procedure, as discussed
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">here</a>
* <p>
* </p><p>
* <strong>Preconditions</strong>: <ul>
* <li>The datasets described by the two Univariates must each contain
* at least 2 observations.
* </li></ul>
* </li></ul></p>
*
* @param sampleStats1 StatisticalSummary describing data from the first sample
* @param sampleStats2 StatisticalSummary describing data from the second sample
@ -724,12 +723,12 @@ public interface TTest {
* <p>
* Returns <code>true</code> iff the null hypothesis that the means are
* equal can be rejected with confidence <code>1 - alpha</code>. To
* perform a 1-sided test, use <code>alpha * 2</code>
* perform a 1-sided test, use <code>alpha * 2</code></p>
* <p>
* See {@link #t(double[], double[])} for the formula used to compute the
* t-statistic. Degrees of freedom are approximated using the
* <a href="http://www.itl.nist.gov/div898/handbook/prc/section3/prc31.htm">
* Welch-Satterthwaite approximation.</a>
* Welch-Satterthwaite approximation.</a></p>
* <p>
* <strong>Examples:</strong><br><ol>
* <li>To test the (2-sided) hypothesis <code>mean 1 = mean 2 </code> at
@ -741,20 +740,20 @@ public interface TTest {
* <code>sample 1</code> is less than the mean of <code>sample 2</code>
* and then use
* <br><code>tTest(sampleStats1, sampleStats2, 0.02) </code>
* </li></ol>
* </li></ol></p>
* <p>
* <strong>Usage Note:</strong><br>
* The validity of the test depends on the assumptions of the parametric
* t-test procedure, as discussed
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">
* here</a>
* here</a></p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>The datasets described by the two Univariates must each contain
* at least 2 observations.
* </li>
* <li> <code> 0 < alpha < 0.5 </code>
* </li></ul>
* </li></ul></p>
*
* @param sampleStats1 StatisticalSummary describing sample data values
* @param sampleStats2 StatisticalSummary describing sample data values

View File

@ -27,7 +27,7 @@ import org.apache.commons.math.stat.descriptive.StatisticalSummary;
* Implements t-test statistics defined in the {@link TTest} interface.
* <p>
* Uses commons-math {@link org.apache.commons.math.distribution.TDistribution}
* implementation to estimate exact p-values.
* implementation to estimate exact p-values.</p>
*
* @version $Revision$ $Date$
*/
@ -65,7 +65,7 @@ public class TTestImpl implements TTest {
* <strong>Preconditions</strong>: <ul>
* <li>The input arrays must have the same length and their common length
* must be at least 2.
* </li></ul>
* </li></ul></p>
*
* @param sample1 array of sample data values
* @param sample2 array of sample data values
@ -95,23 +95,23 @@ public class TTestImpl implements TTest {
* at which one can reject the null hypothesis that the mean of the paired
* differences is 0 in favor of the two-sided alternative that the mean paired
* difference is not equal to 0. For a one-sided test, divide the returned
* value by 2.
* value by 2.</p>
* <p>
* This test is equivalent to a one-sample t-test computed using
* {@link #tTest(double, double[])} with <code>mu = 0</code> and the sample
* array consisting of the signed differences between corresponding elements of
* <code>sample1</code> and <code>sample2.</code>
* <code>sample1</code> and <code>sample2.</code></p>
* <p>
* <strong>Usage Note:</strong><br>
* The validity of the p-value depends on the assumptions of the parametric
* t-test procedure, as discussed
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">
* here</a>
* here</a></p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>The input array lengths must be the same and their common length must
* be at least 2.
* </li></ul>
* </li></ul></p>
*
* @param sample1 array of sample data values
* @param sample2 array of sample data values
@ -136,20 +136,20 @@ public class TTestImpl implements TTest {
* <p>
* Returns <code>true</code> iff the null hypothesis can be rejected with
* confidence <code>1 - alpha</code>. To perform a 1-sided test, use
* <code>alpha * 2</code>
* <code>alpha * 2</code></p>
* <p>
* <strong>Usage Note:</strong><br>
* The validity of the test depends on the assumptions of the parametric
* t-test procedure, as discussed
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">
* here</a>
* here</a></p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>The input array lengths must be the same and their common length
* must be at least 2.
* </li>
* <li> <code> 0 < alpha < 0.5 </code>
* </li></ul>
* </li></ul></p>
*
* @param sample1 array of sample data values
* @param sample2 array of sample data values
@ -172,10 +172,10 @@ public class TTestImpl implements TTest {
* t statistic </a> given observed values and a comparison constant.
* <p>
* This statistic can be used to perform a one sample t-test for the mean.
* <p>
* </p><p>
* <strong>Preconditions</strong>: <ul>
* <li>The observed array length must be at least 2.
* </li></ul>
* </li></ul></p>
*
* @param mu comparison constant
* @param observed array of values
@ -197,10 +197,10 @@ public class TTestImpl implements TTest {
* <code>sampleStats</code> to <code>mu</code>.
* <p>
* This statistic can be used to perform a one sample t-test for the mean.
* <p>
* </p><p>
* <strong>Preconditions</strong>: <ul>
* <li><code>observed.getN() > = 2</code>.
* </li></ul>
* </li></ul></p>
*
* @param mu comparison constant
* @param sampleStats DescriptiveStatistics holding sample summary statitstics
@ -222,27 +222,27 @@ public class TTestImpl implements TTest {
* equal variances hypothesis, use {@link #t(double[], double[])}.
* <p>
* This statistic can be used to perform a (homoscedastic) two-sample
* t-test to compare sample means.
* t-test to compare sample means.</p>
* <p>
* The t-statisitc is
* The t-statisitc is</p>
* <p>
* &nbsp;&nbsp;<code> t = (m1 - m2) / (sqrt(1/n1 +1/n2) sqrt(var))</code>
* <p>
* </p><p>
* where <strong><code>n1</code></strong> is the size of first sample;
* <strong><code> n2</code></strong> is the size of second sample;
* <strong><code> m1</code></strong> is the mean of first sample;
* <strong><code> m2</code></strong> is the mean of second sample</li>
* </ul>
* and <strong><code>var</code></strong> is the pooled variance estimate:
* <p>
* </p><p>
* <code>var = sqrt(((n1 - 1)var1 + (n2 - 1)var2) / ((n1-1) + (n2-1)))</code>
* <p>
* </p><p>
* with <strong><code>var1<code></strong> the variance of the first sample and
* <strong><code>var2</code></strong> the variance of the second sample.
* <p>
* </p><p>
* <strong>Preconditions</strong>: <ul>
* <li>The observed array lengths must both be at least 2.
* </li></ul>
* </li></ul></p>
*
* @param sample1 array of sample data values
* @param sample2 array of sample data values
@ -266,22 +266,22 @@ public class TTestImpl implements TTest {
* variances, use {@link #homoscedasticT(double[], double[])}.
* <p>
* This statistic can be used to perform a two-sample t-test to compare
* sample means.
* sample means.</p>
* <p>
* The t-statisitc is
* The t-statisitc is</p>
* <p>
* &nbsp;&nbsp; <code> t = (m1 - m2) / sqrt(var1/n1 + var2/n2)</code>
* <p>
* </p><p>
* where <strong><code>n1</code></strong> is the size of the first sample
* <strong><code> n2</code></strong> is the size of the second sample;
* <strong><code> m1</code></strong> is the mean of the first sample;
* <strong><code> m2</code></strong> is the mean of the second sample;
* <strong><code> var1</code></strong> is the variance of the first sample;
* <strong><code> var2</code></strong> is the variance of the second sample;
* <p>
* </p><p>
* <strong>Preconditions</strong>: <ul>
* <li>The observed array lengths must both be at least 2.
* </li></ul>
* </li></ul></p>
*
* @param sample1 array of sample data values
* @param sample2 array of sample data values
@ -307,23 +307,23 @@ public class TTestImpl implements TTest {
* compute a t-statistic under the equal variances assumption.
* <p>
* This statistic can be used to perform a two-sample t-test to compare
* sample means.
* sample means.</p>
* <p>
* The returned t-statisitc is
* The returned t-statisitc is</p>
* <p>
* &nbsp;&nbsp; <code> t = (m1 - m2) / sqrt(var1/n1 + var2/n2)</code>
* <p>
* </p><p>
* where <strong><code>n1</code></strong> is the size of the first sample;
* <strong><code> n2</code></strong> is the size of the second sample;
* <strong><code> m1</code></strong> is the mean of the first sample;
* <strong><code> m2</code></strong> is the mean of the second sample
* <strong><code> var1</code></strong> is the variance of the first sample;
* <strong><code> var2</code></strong> is the variance of the second sample
* <p>
* </p><p>
* <strong>Preconditions</strong>: <ul>
* <li>The datasets described by the two Univariates must each contain
* at least 2 observations.
* </li></ul>
* </li></ul></p>
*
* @param sampleStats1 StatisticalSummary describing data from the first sample
* @param sampleStats2 StatisticalSummary describing data from the second sample
@ -351,27 +351,27 @@ public class TTestImpl implements TTest {
* {@link #t(StatisticalSummary, StatisticalSummary)}.
* <p>
* This statistic can be used to perform a (homoscedastic) two-sample
* t-test to compare sample means.
* t-test to compare sample means.</p>
* <p>
* The t-statisitc returned is
* The t-statisitc returned is</p>
* <p>
* &nbsp;&nbsp;<code> t = (m1 - m2) / (sqrt(1/n1 +1/n2) sqrt(var))</code>
* <p>
* </p><p>
* where <strong><code>n1</code></strong> is the size of first sample;
* <strong><code> n2</code></strong> is the size of second sample;
* <strong><code> m1</code></strong> is the mean of first sample;
* <strong><code> m2</code></strong> is the mean of second sample
* and <strong><code>var</code></strong> is the pooled variance estimate:
* <p>
* </p><p>
* <code>var = sqrt(((n1 - 1)var1 + (n2 - 1)var2) / ((n1-1) + (n2-1)))</code>
* <p>
* with <strong><code>var1<code></strong> the variance of the first sample and
* <strong><code>var2</code></strong> the variance of the second sample.
* <p>
* </p><p>
* <strong>Preconditions</strong>: <ul>
* <li>The datasets described by the two Univariates must each contain
* at least 2 observations.
* </li></ul>
* </li></ul></p>
*
* @param sampleStats1 StatisticalSummary describing data from the first sample
* @param sampleStats2 StatisticalSummary describing data from the second sample
@ -400,16 +400,16 @@ public class TTestImpl implements TTest {
* at which one can reject the null hypothesis that the mean equals
* <code>mu</code> in favor of the two-sided alternative that the mean
* is different from <code>mu</code>. For a one-sided test, divide the
* returned value by 2.
* returned value by 2.</p>
* <p>
* <strong>Usage Note:</strong><br>
* The validity of the test depends on the assumptions of the parametric
* t-test procedure, as discussed
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">here</a>
* <p>
* </p><p>
* <strong>Preconditions</strong>: <ul>
* <li>The observed array length must be at least 2.
* </li></ul>
* </li></ul></p>
*
* @param mu constant value to compare sample mean against
* @param sample array of sample data values
@ -434,7 +434,7 @@ public class TTestImpl implements TTest {
* Returns <code>true</code> iff the null hypothesis can be
* rejected with confidence <code>1 - alpha</code>. To
* perform a 1-sided test, use <code>alpha * 2</code>
* <p>
* </p><p>
* <strong>Examples:</strong><br><ol>
* <li>To test the (2-sided) hypothesis <code>sample mean = mu </code> at
* the 95% level, use <br><code>tTest(mu, sample, 0.05) </code>
@ -443,16 +443,16 @@ public class TTestImpl implements TTest {
* at the 99% level, first verify that the measured sample mean is less
* than <code>mu</code> and then use
* <br><code>tTest(mu, sample, 0.02) </code>
* </li></ol>
* </li></ol></p>
* <p>
* <strong>Usage Note:</strong><br>
* The validity of the test depends on the assumptions of the one-sample
* parametric t-test procedure, as discussed
* <a href="http://www.basic.nwu.edu/statguidefiles/sg_glos.html#one-sample">here</a>
* <p>
* </p><p>
* <strong>Preconditions</strong>: <ul>
* <li>The observed array length must be at least 2.
* </li></ul>
* </li></ul></p>
*
* @param mu constant value to compare sample mean against
* @param sample array of sample data values
@ -479,17 +479,17 @@ public class TTestImpl implements TTest {
* at which one can reject the null hypothesis that the mean equals
* <code>mu</code> in favor of the two-sided alternative that the mean
* is different from <code>mu</code>. For a one-sided test, divide the
* returned value by 2.
* returned value by 2.</p>
* <p>
* <strong>Usage Note:</strong><br>
* The validity of the test depends on the assumptions of the parametric
* t-test procedure, as discussed
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">
* here</a>
* here</a></p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>The sample must contain at least 2 observations.
* </li></ul>
* </li></ul></p>
*
* @param mu constant value to compare sample mean against
* @param sampleStats StatisticalSummary describing sample data
@ -514,7 +514,7 @@ public class TTestImpl implements TTest {
* <p>
* Returns <code>true</code> iff the null hypothesis can be rejected with
* confidence <code>1 - alpha</code>. To perform a 1-sided test, use
* <code>alpha * 2.</code>
* <code>alpha * 2.</code></p>
* <p>
* <strong>Examples:</strong><br><ol>
* <li>To test the (2-sided) hypothesis <code>sample mean = mu </code> at
@ -524,16 +524,16 @@ public class TTestImpl implements TTest {
* at the 99% level, first verify that the measured sample mean is less
* than <code>mu</code> and then use
* <br><code>tTest(mu, sampleStats, 0.02) </code>
* </li></ol>
* </li></ol></p>
* <p>
* <strong>Usage Note:</strong><br>
* The validity of the test depends on the assumptions of the one-sample
* parametric t-test procedure, as discussed
* <a href="http://www.basic.nwu.edu/statguidefiles/sg_glos.html#one-sample">here</a>
* <p>
* </p><p>
* <strong>Preconditions</strong>: <ul>
* <li>The sample must include at least 2 observations.
* </li></ul>
* </li></ul></p>
*
* @param mu constant value to compare sample mean against
* @param sampleStats StatisticalSummary describing sample data values
@ -559,7 +559,7 @@ public class TTestImpl implements TTest {
* The number returned is the smallest significance level
* at which one can reject the null hypothesis that the two means are
* equal in favor of the two-sided alternative that they are different.
* For a one-sided test, divide the returned value by 2.
* For a one-sided test, divide the returned value by 2.</p>
* <p>
* The test does not assume that the underlying popuation variances are
* equal and it uses approximated degrees of freedom computed from the
@ -569,17 +569,17 @@ public class TTestImpl implements TTest {
* as described
* <a href="http://www.itl.nist.gov/div898/handbook/prc/section3/prc31.htm">
* here.</a> To perform the test under the assumption of equal subpopulation
* variances, use {@link #homoscedasticTTest(double[], double[])}.
* variances, use {@link #homoscedasticTTest(double[], double[])}.</p>
* <p>
* <strong>Usage Note:</strong><br>
* The validity of the p-value depends on the assumptions of the parametric
* t-test procedure, as discussed
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">
* here</a>
* here</a></p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>The observed array lengths must both be at least 2.
* </li></ul>
* </li></ul></p>
*
* @param sample1 array of sample data values
* @param sample2 array of sample data values
@ -609,21 +609,21 @@ public class TTestImpl implements TTest {
* The number returned is the smallest significance level
* at which one can reject the null hypothesis that the two means are
* equal in favor of the two-sided alternative that they are different.
* For a one-sided test, divide the returned value by 2.
* For a one-sided test, divide the returned value by 2.</p>
* <p>
* A pooled variance estimate is used to compute the t-statistic. See
* {@link #homoscedasticT(double[], double[])}. The sum of the sample sizes
* minus 2 is used as the degrees of freedom.
* minus 2 is used as the degrees of freedom.</p>
* <p>
* <strong>Usage Note:</strong><br>
* The validity of the p-value depends on the assumptions of the parametric
* t-test procedure, as discussed
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">
* here</a>
* here</a></p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>The observed array lengths must both be at least 2.
* </li></ul>
* </li></ul></p>
*
* @param sample1 array of sample data values
* @param sample2 array of sample data values
@ -656,12 +656,12 @@ public class TTestImpl implements TTest {
* <p>
* Returns <code>true</code> iff the null hypothesis that the means are
* equal can be rejected with confidence <code>1 - alpha</code>. To
* perform a 1-sided test, use <code>alpha / 2</code>
* perform a 1-sided test, use <code>alpha / 2</code></p>
* <p>
* See {@link #t(double[], double[])} for the formula used to compute the
* t-statistic. Degrees of freedom are approximated using the
* <a href="http://www.itl.nist.gov/div898/handbook/prc/section3/prc31.htm">
* Welch-Satterthwaite approximation.</a>
* Welch-Satterthwaite approximation.</a></p>
* <p>
* <strong>Examples:</strong><br><ol>
@ -673,19 +673,19 @@ public class TTestImpl implements TTest {
* the 99% level, first verify that the measured mean of <code>sample 1</code>
* is less than the mean of <code>sample 2</code> and then use
* <br><code>tTest(sample1, sample2, 0.02) </code>
* </li></ol>
* </li></ol></p>
* <p>
* <strong>Usage Note:</strong><br>
* The validity of the test depends on the assumptions of the parametric
* t-test procedure, as discussed
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">
* here</a>
* here</a></p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>The observed array lengths must both be at least 2.
* </li>
* <li> <code> 0 < alpha < 0.5 </code>
* </li></ul>
* </li></ul></p>
*
* @param sample1 array of sample data values
* @param sample2 array of sample data values
@ -718,11 +718,11 @@ public class TTestImpl implements TTest {
* equal can be rejected with confidence <code>1 - alpha</code>. To
* perform a 1-sided test, use <code>alpha * 2.</code> To perform the test
* without the assumption of equal subpopulation variances, use
* {@link #tTest(double[], double[], double)}.
* {@link #tTest(double[], double[], double)}.</p>
* <p>
* A pooled variance estimate is used to compute the t-statistic. See
* {@link #t(double[], double[])} for the formula. The sum of the sample
* sizes minus 2 is used as the degrees of freedom.
* sizes minus 2 is used as the degrees of freedom.</p>
* <p>
* <strong>Examples:</strong><br><ol>
* <li>To test the (2-sided) hypothesis <code>mean 1 = mean 2 </code> at
@ -733,19 +733,19 @@ public class TTestImpl implements TTest {
* <code>sample 1</code> is less than the mean of <code>sample 2</code>
* and then use
* <br><code>tTest(sample1, sample2, 0.02) </code>
* </li></ol>
* </li></ol></p>
* <p>
* <strong>Usage Note:</strong><br>
* The validity of the test depends on the assumptions of the parametric
* t-test procedure, as discussed
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">
* here</a>
* here</a></p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>The observed array lengths must both be at least 2.
* </li>
* <li> <code> 0 < alpha < 0.5 </code>
* </li></ul>
* </li></ul></p>
*
* @param sample1 array of sample data values
* @param sample2 array of sample data values
@ -773,24 +773,24 @@ public class TTestImpl implements TTest {
* The number returned is the smallest significance level
* at which one can reject the null hypothesis that the two means are
* equal in favor of the two-sided alternative that they are different.
* For a one-sided test, divide the returned value by 2.
* For a one-sided test, divide the returned value by 2.</p>
* <p>
* The test does not assume that the underlying popuation variances are
* equal and it uses approximated degrees of freedom computed from the
* sample data to compute the p-value. To perform the test assuming
* equal variances, use
* {@link #homoscedasticTTest(StatisticalSummary, StatisticalSummary)}.
* {@link #homoscedasticTTest(StatisticalSummary, StatisticalSummary)}.</p>
* <p>
* <strong>Usage Note:</strong><br>
* The validity of the p-value depends on the assumptions of the parametric
* t-test procedure, as discussed
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">
* here</a>
* here</a></p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>The datasets described by the two Univariates must each contain
* at least 2 observations.
* </li></ul>
* </li></ul></p>
*
* @param sampleStats1 StatisticalSummary describing data from the first sample
* @param sampleStats2 StatisticalSummary describing data from the second sample
@ -820,21 +820,21 @@ public class TTestImpl implements TTest {
* The number returned is the smallest significance level
* at which one can reject the null hypothesis that the two means are
* equal in favor of the two-sided alternative that they are different.
* For a one-sided test, divide the returned value by 2.
* For a one-sided test, divide the returned value by 2.</p>
* <p>
* See {@link #homoscedasticT(double[], double[])} for the formula used to
* compute the t-statistic. The sum of the sample sizes minus 2 is used as
* the degrees of freedom.
* the degrees of freedom.</p>
* <p>
* <strong>Usage Note:</strong><br>
* The validity of the p-value depends on the assumptions of the parametric
* t-test procedure, as discussed
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">here</a>
* <p>
* </p><p>
* <strong>Preconditions</strong>: <ul>
* <li>The datasets described by the two Univariates must each contain
* at least 2 observations.
* </li></ul>
* </li></ul></p>
*
* @param sampleStats1 StatisticalSummary describing data from the first sample
* @param sampleStats2 StatisticalSummary describing data from the second sample
@ -868,12 +868,12 @@ public class TTestImpl implements TTest {
* <p>
* Returns <code>true</code> iff the null hypothesis that the means are
* equal can be rejected with confidence <code>1 - alpha</code>. To
* perform a 1-sided test, use <code>alpha * 2</code>
* perform a 1-sided test, use <code>alpha * 2</code></p>
* <p>
* See {@link #t(double[], double[])} for the formula used to compute the
* t-statistic. Degrees of freedom are approximated using the
* <a href="http://www.itl.nist.gov/div898/handbook/prc/section3/prc31.htm">
* Welch-Satterthwaite approximation.</a>
* Welch-Satterthwaite approximation.</a></p>
* <p>
* <strong>Examples:</strong><br><ol>
* <li>To test the (2-sided) hypothesis <code>mean 1 = mean 2 </code> at
@ -885,20 +885,20 @@ public class TTestImpl implements TTest {
* <code>sample 1</code> is less than the mean of <code>sample 2</code>
* and then use
* <br><code>tTest(sampleStats1, sampleStats2, 0.02) </code>
* </li></ol>
* </li></ol></p>
* <p>
* <strong>Usage Note:</strong><br>
* The validity of the test depends on the assumptions of the parametric
* t-test procedure, as discussed
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">
* here</a>
* here</a></p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>The datasets described by the two Univariates must each contain
* at least 2 observations.
* </li>
* <li> <code> 0 < alpha < 0.5 </code>
* </li></ul>
* </li></ul></p>
*
* @param sampleStats1 StatisticalSummary describing sample data values
* @param sampleStats2 StatisticalSummary describing sample data values
@ -959,7 +959,7 @@ public class TTestImpl implements TTest {
/**
* Computes t test statistic for 2-sample t-test.
* <p>
* Does not assume that subpopulation variances are equal.
* Does not assume that subpopulation variances are equal.</p>
*
* @param m1 first sample mean
* @param m2 second sample mean
@ -1013,7 +1013,7 @@ public class TTestImpl implements TTest {
* Computes p-value for 2-sided, 2-sample t-test.
* <p>
* Does not assume subpopulation variances are equal. Degrees of freedom
* are estimated from the data.
* are estimated from the data.</p>
*
* @param m1 first sample mean
* @param m2 second sample mean
@ -1038,7 +1038,7 @@ public class TTestImpl implements TTest {
* Computes p-value for 2-sided, 2-sample t-test, under the assumption
* of equal subpopulation variances.
* <p>
* The sum of the sample sizes minus 2 is used as degrees of freedom.
* The sum of the sample sizes minus 2 is used as degrees of freedom.</p>
*
* @param m1 first sample mean
* @param m2 second sample mean

View File

@ -40,7 +40,7 @@ public interface UnknownDistributionChiSquareTest extends ChiSquareTest {
* <br/><code>K = &sqrt;[&sum(observed2 / &sum;(observed1)]</code>
* </p>
* <p>This statistic can be used to perform a Chi-Square test evaluating the null hypothesis that
* both observed counts follow the same distribution.
* both observed counts follow the same distribution.</p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>Observed counts must be non-negative.
@ -51,9 +51,9 @@ public interface UnknownDistributionChiSquareTest extends ChiSquareTest {
* </li>
* <li>The arrays <code>observed1</code> and <code>observed2</code> must have the same length and
* their common length must be at least 2.
* </li></ul><p>
* </li></ul></p><p>
* If any of the preconditions are not met, an
* <code>IllegalArgumentException</code> is thrown.
* <code>IllegalArgumentException</code> is thrown.</p>
*
* @param observed1 array of observed frequency counts of the first data set
* @param observed2 array of observed frequency counts of the second data set
@ -91,7 +91,7 @@ public interface UnknownDistributionChiSquareTest extends ChiSquareTest {
* their common length must be at least 2.
* </li></ul><p>
* If any of the preconditions are not met, an
* <code>IllegalArgumentException</code> is thrown.
* <code>IllegalArgumentException</code> is thrown.</p>
*
* @param observed1 array of observed frequency counts of the first data set
* @param observed2 array of observed frequency counts of the second data set
@ -127,7 +127,7 @@ public interface UnknownDistributionChiSquareTest extends ChiSquareTest {
* <li> <code> 0 < alpha < 0.5 </code>
* </li></ul><p>
* If any of the preconditions are not met, an
* <code>IllegalArgumentException</code> is thrown.
* <code>IllegalArgumentException</code> is thrown.</p>
*
* @param observed1 array of observed frequency counts of the first data set
* @param observed2 array of observed frequency counts of the second data set

View File

@ -26,15 +26,15 @@ import org.apache.commons.math.distribution.TDistributionImpl;
* Estimates an ordinary least squares regression model
* with one independent variable.
* <p>
* <code> y = intercept + slope * x </code>
* <code> y = intercept + slope * x </code></p>
* <p>
* Standard errors for <code>intercept</code> and <code>slope</code> are
* available as well as ANOVA, r-square and Pearson's r statistics.
* available as well as ANOVA, r-square and Pearson's r statistics.</p>
* <p>
* Observations (x,y pairs) can be added to the model one at a time or they
* can be provided in a 2-dimensional array. The observations are not stored
* in memory, so there is no limit to the number of observations that can be
* added to the model.
* added to the model.</p>
* <p>
* <strong>Usage Notes</strong>: <ul>
* <li> When there are fewer than two observations in the model, or when
@ -48,7 +48,7 @@ import org.apache.commons.math.distribution.TDistributionImpl;
* and get updated statistics without using a new instance. There is no
* "compute" method that updates all statistics. Each of the getters performs
* the necessary computations to return the requested statistic.</li>
* </ul>
* </ul></p>
*
* @version $Revision$ $Date$
*/
@ -111,7 +111,7 @@ public class SimpleRegression implements Serializable {
* "Algorithms for Computing the Sample Variance: Analysis and
* Recommendations", Chan, T.F., Golub, G.H., and LeVeque, R.J.
* 1983, American Statistician, vol. 37, pp. 242-247, referenced in
* Weisberg, S. "Applied Linear Regression". 2nd Ed. 1985
* Weisberg, S. "Applied Linear Regression". 2nd Ed. 1985.</p>
*
*
* @param x independent variable value
@ -144,14 +144,14 @@ public class SimpleRegression implements Serializable {
* <code>data</code>.
* <p>
* <code>(data[0][0],data[0][1])</code> will be the first observation, then
* <code>(data[1][0],data[1][1])</code>, etc.
* <code>(data[1][0],data[1][1])</code>, etc.</p>
* <p>
* This method does not replace data that has already been added. The
* observations represented by <code>data</code> are added to the existing
* dataset.
* dataset.</p>
* <p>
* To replace all data, use <code>clear()</code> before adding the new
* data.
* data.</p>
*
* @param data array of observations to be added
*/
@ -187,14 +187,14 @@ public class SimpleRegression implements Serializable {
* supplied <code>x</code> value, based on the data that has been
* added to the model when this method is activated.
* <p>
* <code> predict(x) = intercept + slope * x </code>
* <code> predict(x) = intercept + slope * x </code></p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>At least two observations (with at least two different x values)
* must have been added before invoking this method. If this method is
* invoked before a model can be estimated, <code>Double,NaN</code> is
* returned.
* </li></ul>
* </li></ul></p>
*
* @param x input <code>x</code> value
* @return predicted <code>y</code> value
@ -209,14 +209,14 @@ public class SimpleRegression implements Serializable {
* <p>
* The least squares estimate of the intercept is computed using the
* <a href="http://www.xycoon.com/estimation4.htm">normal equations</a>.
* The intercept is sometimes denoted b0.
* The intercept is sometimes denoted b0.</p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>At least two observations (with at least two different x values)
* must have been added before invoking this method. If this method is
* invoked before a model can be estimated, <code>Double,NaN</code> is
* returned.
* </li></ul>
* </li></ul></p>
*
* @return the intercept of the regression line
*/
@ -229,14 +229,14 @@ public class SimpleRegression implements Serializable {
* <p>
* The least squares estimate of the slope is computed using the
* <a href="http://www.xycoon.com/estimation4.htm">normal equations</a>.
* The slope is sometimes denoted b1.
* The slope is sometimes denoted b1.</p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>At least two observations (with at least two different x values)
* must have been added before invoking this method. If this method is
* invoked before a model can be estimated, <code>Double.NaN</code> is
* returned.
* </li></ul>
* </li></ul></p>
*
* @return the slope of the regression line
*/
@ -255,27 +255,27 @@ public class SimpleRegression implements Serializable {
* sum of squared errors</a> (SSE) associated with the regression
* model.
* <p>
* The sum is computed using the computational formula
* The sum is computed using the computational formula</p>
* <p>
* <code>SSE = SYY - (SXY * SXY / SXX)</code>
* <code>SSE = SYY - (SXY * SXY / SXX)</code></p>
* <p>
* where <code>SYY</code> is the sum of the squared deviations of the y
* values about their mean, <code>SXX</code> is similarly defined and
* <code>SXY</code> is the sum of the products of x and y mean deviations.
* <p>
* </p><p>
* The sums are accumulated using the updating algorithm referenced in
* {@link #addData}.
* {@link #addData}.</p>
* <p>
* The return value is constrained to be non-negative - i.e., if due to
* rounding errors the computational formula returns a negative result,
* 0 is returned.
* 0 is returned.</p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>At least two observations (with at least two different x values)
* must have been added before invoking this method. If this method is
* invoked before a model can be estimated, <code>Double,NaN</code> is
* returned.
* </li></ul>
* </li></ul></p>
*
* @return sum of squared errors associated with the regression model
*/
@ -287,9 +287,9 @@ public class SimpleRegression implements Serializable {
* Returns the sum of squared deviations of the y values about their mean.
* <p>
* This is defined as SSTO
* <a href="http://www.xycoon.com/SumOfSquares.htm">here</a>.
* <a href="http://www.xycoon.com/SumOfSquares.htm">here</a>.</p>
* <p>
* If <code>n < 2</code>, this returns <code>Double.NaN</code>.
* If <code>n < 2</code>, this returns <code>Double.NaN</code>.</p>
*
* @return sum of squared deviations of y values
*/
@ -305,14 +305,14 @@ public class SimpleRegression implements Serializable {
* their mean (which equals the mean of y).
* <p>
* This is usually abbreviated SSR or SSM. It is defined as SSM
* <a href="http://www.xycoon.com/SumOfSquares.htm">here</a>
* <a href="http://www.xycoon.com/SumOfSquares.htm">here</a></p>
* <p>
* <strong>Preconditions</strong>: <ul>
* <li>At least two observations (with at least two different x values)
* must have been added before invoking this method. If this method is
* invoked before a model can be estimated, <code>Double.NaN</code> is
* returned.
* </li></ul>
* </li></ul></p>
*
* @return sum of squared deviations of predicted y values
*/
@ -326,7 +326,7 @@ public class SimpleRegression implements Serializable {
* <p>
* If there are fewer than <strong>three</strong> data pairs in the model,
* or if there is no variation in <code>x</code>, this returns
* <code>Double.NaN</code>.
* <code>Double.NaN</code>.</p>
*
* @return sum of squared deviations of y values
*/
@ -347,7 +347,7 @@ public class SimpleRegression implements Serializable {
* must have been added before invoking this method. If this method is
* invoked before a model can be estimated, <code>Double,NaN</code> is
* returned.
* </li></ul>
* </li></ul></p>
*
* @return Pearson's r
*/
@ -370,7 +370,7 @@ public class SimpleRegression implements Serializable {
* must have been added before invoking this method. If this method is
* invoked before a model can be estimated, <code>Double,NaN</code> is
* returned.
* </li></ul>
* </li></ul></p>
*
* @return r-square
*/
@ -386,7 +386,7 @@ public class SimpleRegression implements Serializable {
* <p>
* If there are fewer that <strong>three</strong> observations in the
* model, or if there is no variation in x, this returns
* <code>Double.NaN</code>.
* <code>Double.NaN</code>.</p>
*
* @return standard error associated with intercept estimate
*/
@ -402,7 +402,8 @@ public class SimpleRegression implements Serializable {
* <p>
* If there are fewer that <strong>three</strong> data pairs in the model,
* or if there is no variation in x, this returns <code>Double.NaN</code>.
*
* </p>
*
* @return standard error associated with slope estimate
*/
public double getSlopeStdErr() {
@ -413,23 +414,22 @@ public class SimpleRegression implements Serializable {
* Returns the half-width of a 95% confidence interval for the slope
* estimate.
* <p>
* The 95% confidence interval is
* The 95% confidence interval is</p>
* <p>
* <code>(getSlope() - getSlopeConfidenceInterval(),
* getSlope() + getSlopeConfidenceInterval())</code>
* getSlope() + getSlopeConfidenceInterval())</code></p>
* <p>
* If there are fewer that <strong>three</strong> observations in the
* model, or if there is no variation in x, this returns
* <code>Double.NaN</code>.
* <code>Double.NaN</code>.</p>
* <p>
* <strong>Usage Note</strong>:<br>
* The validity of this statistic depends on the assumption that the
* observations included in the model are drawn from a
* <a href="http://mathworld.wolfram.com/BivariateNormalDistribution.html">
* Bivariate Normal Distribution</a>.
* Bivariate Normal Distribution</a>.</p>
*
* @return half-width of 95% confidence interval for the slope estimate
*
* @throws MathException if the confidence interval can not be computed.
*/
public double getSlopeConfidenceInterval() throws MathException {
@ -440,28 +440,28 @@ public class SimpleRegression implements Serializable {
* Returns the half-width of a (100-100*alpha)% confidence interval for
* the slope estimate.
* <p>
* The (100-100*alpha)% confidence interval is
* The (100-100*alpha)% confidence interval is </p>
* <p>
* <code>(getSlope() - getSlopeConfidenceInterval(),
* getSlope() + getSlopeConfidenceInterval())</code>
* getSlope() + getSlopeConfidenceInterval())</code></p>
* <p>
* To request, for example, a 99% confidence interval, use
* <code>alpha = .01</code>
* <code>alpha = .01</code></p>
* <p>
* <strong>Usage Note</strong>:<br>
* The validity of this statistic depends on the assumption that the
* observations included in the model are drawn from a
* <a href="http://mathworld.wolfram.com/BivariateNormalDistribution.html">
* Bivariate Normal Distribution</a>.
* Bivariate Normal Distribution</a>.</p>
* <p>
* <strong> Preconditions:</strong><ul>
* <li>If there are fewer that <strong>three</strong> observations in the
* model, or if there is no variation in x, this returns
* <code>Double.NaN</code>.
* <code>Double.NaN</code>.
* </li>
* <li><code>(0 < alpha < 1)</code>; otherwise an
* <code>IllegalArgumentException</code> is thrown.
* </li></ul>
* </li></ul></p>
*
* @param alpha the desired significance level
* @return half-width of 95% confidence interval for the slope estimate
@ -483,16 +483,16 @@ public class SimpleRegression implements Serializable {
* such that the slope confidence interval with significance level
* equal to <code>alpha</code> does not include <code>0</code>.
* On regression output, this is often denoted <code>Prob(|t| > 0)</code>
* <p>
* </p><p>
* <strong>Usage Note</strong>:<br>
* The validity of this statistic depends on the assumption that the
* observations included in the model are drawn from a
* <a href="http://mathworld.wolfram.com/BivariateNormalDistribution.html">
* Bivariate Normal Distribution</a>.
* Bivariate Normal Distribution</a>.</p>
* <p>
* If there are fewer that <strong>three</strong> observations in the
* model, or if there is no variation in x, this returns
* <code>Double.NaN</code>.
* <code>Double.NaN</code>.</p>
*
* @return significance level for slope/correlation
* @throws MathException if the significance level can not be computed.
@ -507,7 +507,7 @@ public class SimpleRegression implements Serializable {
/**
* Returns the intercept of the estimated regression line, given the slope.
* <p>
* Will return <code>NaN</code> if slope is <code>NaN</code>.
* Will return <code>NaN</code> if slope is <code>NaN</code>.</p>
*
* @param slope current slope
* @return the intercept of the regression line

View File

@ -28,11 +28,11 @@ import org.apache.commons.math.MathException;
* <b>Fast Fourier Transforms</b>, ISBN 0849371635, chapter 3.
* <p>
* FCT is its own inverse, up to a multiplier depending on conventions.
* The equations are listed in the comments of the corresponding methods.
* The equations are listed in the comments of the corresponding methods.</p>
* <p>
* Different from FFT and FST, FCT requires the length of data set to be
* power of 2 plus one. Users should especially pay attention to the
* function transformation on how this affects the sampling.
* function transformation on how this affects the sampling.</p>
*
* @version $Revision$ $Date$
*/
@ -53,7 +53,8 @@ public class FastCosineTransformer implements Serializable {
* <p>
* The formula is $ F_n = (1/2) [f_0 + (-1)^n f_N] +
* \Sigma_{k=0}^{N-1} f_k \cos(\pi nk/N) $
*
* </p>
*
* @param f the real data array to be transformed
* @return the real transformed array
* @throws MathException if any math-related errors occur
@ -70,7 +71,8 @@ public class FastCosineTransformer implements Serializable {
* <p>
* The formula is $ F_n = (1/2) [f_0 + (-1)^n f_N] +
* \Sigma_{k=0}^{N-1} f_k \cos(\pi nk/N) $
*
* </p>
*
* @param f the function to be sampled and transformed
* @param min the lower bound for the interval
* @param max the upper bound for the interval
@ -92,7 +94,8 @@ public class FastCosineTransformer implements Serializable {
* <p>
* The formula is $ F_n = \sqrt{1/2N} [f_0 + (-1)^n f_N] +
* \sqrt{2/N} \Sigma_{k=0}^{N-1} f_k \cos(\pi nk/N) $
*
* </p>
*
* @param f the real data array to be transformed
* @return the real transformed array
* @throws MathException if any math-related errors occur
@ -111,6 +114,8 @@ public class FastCosineTransformer implements Serializable {
* The formula is $ F_n = \sqrt{1/2N} [f_0 + (-1)^n f_N] +
* \sqrt{2/N} \Sigma_{k=0}^{N-1} f_k \cos(\pi nk/N) $
*
* </p>
*
* @param f the function to be sampled and transformed
* @param min the lower bound for the interval
* @param max the upper bound for the interval
@ -133,7 +138,8 @@ public class FastCosineTransformer implements Serializable {
* <p>
* The formula is $ f_k = (1/N) [F_0 + (-1)^k F_N] +
* (2/N) \Sigma_{n=0}^{N-1} F_n \cos(\pi nk/N) $
*
* </p>
*
* @param f the real data array to be inversely transformed
* @return the real inversely transformed array
* @throws MathException if any math-related errors occur
@ -151,7 +157,8 @@ public class FastCosineTransformer implements Serializable {
* <p>
* The formula is $ f_k = (1/N) [F_0 + (-1)^k F_N] +
* (2/N) \Sigma_{n=0}^{N-1} F_n \cos(\pi nk/N) $
*
* </p>
*
* @param f the function to be sampled and inversely transformed
* @param min the lower bound for the interval
* @param max the upper bound for the interval
@ -174,7 +181,8 @@ public class FastCosineTransformer implements Serializable {
* <p>
* The formula is $ f_k = \sqrt{1/2N} [F_0 + (-1)^k F_N] +
* \sqrt{2/N} \Sigma_{n=0}^{N-1} F_n \cos(\pi nk/N) $
*
* </p>
*
* @param f the real data array to be inversely transformed
* @return the real inversely transformed array
* @throws MathException if any math-related errors occur
@ -191,7 +199,8 @@ public class FastCosineTransformer implements Serializable {
* <p>
* The formula is $ f_k = \sqrt{1/2N} [F_0 + (-1)^k F_N] +
* \sqrt{2/N} \Sigma_{n=0}^{N-1} F_n \cos(\pi nk/N) $
*
* </p>
*
* @param f the function to be sampled and inversely transformed
* @param min the lower bound for the interval
* @param max the upper bound for the interval

View File

@ -29,13 +29,13 @@ import org.apache.commons.math.MathException;
* <p>
* There are several conventions for the definition of FFT and inverse FFT,
* mainly on different coefficient and exponent. Here the equations are listed
* in the comments of the corresponding methods.
* in the comments of the corresponding methods.</p>
* <p>
* We require the length of data set to be power of 2, this greatly simplifies
* and speeds up the code. Users can pad the data with zeros to meet this
* requirement. There are other flavors of FFT, for reference, see S. Winograd,
* <i>On computing the discrete Fourier transform</i>, Mathematics of Computation,
* 32 (1978), 175 - 199.
* 32 (1978), 175 - 199.</p>
*
* @version $Revision$ $Date$
*/
@ -64,7 +64,8 @@ public class FastFourierTransformer implements Serializable {
* Transform the given real data set.
* <p>
* The formula is $ y_n = \Sigma_{k=0}^{N-1} e^{-2 \pi i nk/N} x_k $
*
* </p>
*
* @param f the real data array to be transformed
* @return the complex transformed array
* @throws MathException if any math-related errors occur
@ -80,7 +81,8 @@ public class FastFourierTransformer implements Serializable {
* Transform the given real function, sampled on the given interval.
* <p>
* The formula is $ y_n = \Sigma_{k=0}^{N-1} e^{-2 \pi i nk/N} x_k $
*
* </p>
*
* @param f the function to be sampled and transformed
* @param min the lower bound for the interval
* @param max the upper bound for the interval
@ -101,7 +103,8 @@ public class FastFourierTransformer implements Serializable {
* Transform the given complex data set.
* <p>
* The formula is $ y_n = \Sigma_{k=0}^{N-1} e^{-2 \pi i nk/N} x_k $
*
* </p>
*
* @param f the complex data array to be transformed
* @return the complex transformed array
* @throws MathException if any math-related errors occur
@ -118,7 +121,8 @@ public class FastFourierTransformer implements Serializable {
* Transform the given real data set.
* <p>
* The formula is $y_n = (1/\sqrt{N}) \Sigma_{k=0}^{N-1} e^{-2 \pi i nk/N} x_k$
*
* </p>
*
* @param f the real data array to be transformed
* @return the complex transformed array
* @throws MathException if any math-related errors occur
@ -135,7 +139,8 @@ public class FastFourierTransformer implements Serializable {
* Transform the given real function, sampled on the given interval.
* <p>
* The formula is $y_n = (1/\sqrt{N}) \Sigma_{k=0}^{N-1} e^{-2 \pi i nk/N} x_k$
*
* </p>
*
* @param f the function to be sampled and transformed
* @param min the lower bound for the interval
* @param max the upper bound for the interval
@ -157,7 +162,8 @@ public class FastFourierTransformer implements Serializable {
* Transform the given complex data set.
* <p>
* The formula is $y_n = (1/\sqrt{N}) \Sigma_{k=0}^{N-1} e^{-2 \pi i nk/N} x_k$
*
* </p>
*
* @param f the complex data array to be transformed
* @return the complex transformed array
* @throws MathException if any math-related errors occur
@ -175,7 +181,8 @@ public class FastFourierTransformer implements Serializable {
* Inversely transform the given real data set.
* <p>
* The formula is $ x_k = (1/N) \Sigma_{n=0}^{N-1} e^{2 \pi i nk/N} y_n $
*
* </p>
*
* @param f the real data array to be inversely transformed
* @return the complex inversely transformed array
* @throws MathException if any math-related errors occur
@ -192,7 +199,8 @@ public class FastFourierTransformer implements Serializable {
* Inversely transform the given real function, sampled on the given interval.
* <p>
* The formula is $ x_k = (1/N) \Sigma_{n=0}^{N-1} e^{2 \pi i nk/N} y_n $
*
* </p>
*
* @param f the function to be sampled and inversely transformed
* @param min the lower bound for the interval
* @param max the upper bound for the interval
@ -214,7 +222,8 @@ public class FastFourierTransformer implements Serializable {
* Inversely transform the given complex data set.
* <p>
* The formula is $ x_k = (1/N) \Sigma_{n=0}^{N-1} e^{2 \pi i nk/N} y_n $
*
* </p>
*
* @param f the complex data array to be inversely transformed
* @return the complex inversely transformed array
* @throws MathException if any math-related errors occur
@ -232,7 +241,8 @@ public class FastFourierTransformer implements Serializable {
* Inversely transform the given real data set.
* <p>
* The formula is $x_k = (1/\sqrt{N}) \Sigma_{n=0}^{N-1} e^{2 \pi i nk/N} y_n$
*
* </p>
*
* @param f the real data array to be inversely transformed
* @return the complex inversely transformed array
* @throws MathException if any math-related errors occur
@ -249,7 +259,8 @@ public class FastFourierTransformer implements Serializable {
* Inversely transform the given real function, sampled on the given interval.
* <p>
* The formula is $x_k = (1/\sqrt{N}) \Sigma_{n=0}^{N-1} e^{2 \pi i nk/N} y_n$
*
* </p>
*
* @param f the function to be sampled and inversely transformed
* @param min the lower bound for the interval
* @param max the upper bound for the interval
@ -271,7 +282,8 @@ public class FastFourierTransformer implements Serializable {
* Inversely transform the given complex data set.
* <p>
* The formula is $x_k = (1/\sqrt{N}) \Sigma_{n=0}^{N-1} e^{2 \pi i nk/N} y_n$
*
* </p>
*
* @param f the complex data array to be inversely transformed
* @return the complex inversely transformed array
* @throws MathException if any math-related errors occur
@ -401,7 +413,7 @@ public class FastFourierTransformer implements Serializable {
* <p>
* The computed omega[] = { 1, w, w^2, ... w^(n-1) } where
* w = exp(-2 \pi i / n), i = sqrt(-1). Note n is positive for
* forward transform and negative for inverse transform.
* forward transform and negative for inverse transform. </p>
*
* @param n the integer passed in
* @throws IllegalArgumentException if n = 0
@ -440,7 +452,7 @@ public class FastFourierTransformer implements Serializable {
* The interval is divided equally into N sections and sample points
* are taken from min to max-(max-min)/N. Usually f(x) is periodic
* such that f(min) = f(max) (note max is not sampled), but we don't
* require that.
* require that.</p>
*
* @param f the function to be sampled
* @param min the lower bound for the interval

View File

@ -28,11 +28,11 @@ import org.apache.commons.math.MathException;
* <b>Fast Fourier Transforms</b>, ISBN 0849371635, chapter 3.
* <p>
* FST is its own inverse, up to a multiplier depending on conventions.
* The equations are listed in the comments of the corresponding methods.
* The equations are listed in the comments of the corresponding methods.</p>
* <p>
* Similar to FFT, we also require the length of data set to be power of 2.
* In addition, the first element must be 0 and it's enforced in function
* transformation after sampling.
* transformation after sampling.</p>
*
* @version $Revision$ $Date$
*/
@ -52,7 +52,8 @@ public class FastSineTransformer implements Serializable {
* Transform the given real data set.
* <p>
* The formula is $ F_n = \Sigma_{k=0}^{N-1} f_k \sin(\pi nk/N) $
*
* </p>
*
* @param f the real data array to be transformed
* @return the real transformed array
* @throws MathException if any math-related errors occur
@ -68,7 +69,8 @@ public class FastSineTransformer implements Serializable {
* Transform the given real function, sampled on the given interval.
* <p>
* The formula is $ F_n = \Sigma_{k=0}^{N-1} f_k \sin(\pi nk/N) $
*
* </p>
*
* @param f the function to be sampled and transformed
* @param min the lower bound for the interval
* @param max the upper bound for the interval
@ -90,7 +92,8 @@ public class FastSineTransformer implements Serializable {
* Transform the given real data set.
* <p>
* The formula is $ F_n = \sqrt{2/N} \Sigma_{k=0}^{N-1} f_k \sin(\pi nk/N) $
*
* </p>
*
* @param f the real data array to be transformed
* @return the real transformed array
* @throws MathException if any math-related errors occur
@ -107,7 +110,8 @@ public class FastSineTransformer implements Serializable {
* Transform the given real function, sampled on the given interval.
* <p>
* The formula is $ F_n = \sqrt{2/N} \Sigma_{k=0}^{N-1} f_k \sin(\pi nk/N) $
*
* </p>
*
* @param f the function to be sampled and transformed
* @param min the lower bound for the interval
* @param max the upper bound for the interval
@ -130,7 +134,8 @@ public class FastSineTransformer implements Serializable {
* Inversely transform the given real data set.
* <p>
* The formula is $ f_k = (2/N) \Sigma_{n=0}^{N-1} F_n \sin(\pi nk/N) $
*
* </p>
*
* @param f the real data array to be inversely transformed
* @return the real inversely transformed array
* @throws MathException if any math-related errors occur
@ -147,7 +152,8 @@ public class FastSineTransformer implements Serializable {
* Inversely transform the given real function, sampled on the given interval.
* <p>
* The formula is $ f_k = (2/N) \Sigma_{n=0}^{N-1} F_n \sin(\pi nk/N) $
*
* </p>
*
* @param f the function to be sampled and inversely transformed
* @param min the lower bound for the interval
* @param max the upper bound for the interval
@ -170,7 +176,8 @@ public class FastSineTransformer implements Serializable {
* Inversely transform the given real data set.
* <p>
* The formula is $ f_k = \sqrt{2/N} \Sigma_{n=0}^{N-1} F_n \sin(\pi nk/N) $
*
* </p>
*
* @param f the real data array to be inversely transformed
* @return the real inversely transformed array
* @throws MathException if any math-related errors occur
@ -186,7 +193,8 @@ public class FastSineTransformer implements Serializable {
* Inversely transform the given real function, sampled on the given interval.
* <p>
* The formula is $ f_k = \sqrt{2/N} \Sigma_{n=0}^{N-1} F_n \sin(\pi nk/N) $
*
* </p>
*
* @param f the function to be sampled and inversely transformed
* @param min the lower bound for the interval
* @param max the upper bound for the interval

View File

@ -119,7 +119,7 @@ public abstract class ContinuedFraction implements Serializable {
* The recurrence relationship defined in those equations can result in
* very large intermediate results which can result in numerical overflow.
* As a means to combat these overflow conditions, the intermediate results
* are scaled whenever they threaten to become numerically unstable.
* are scaled whenever they threaten to become numerically unstable.</p>
*
* @param x the evaluation point.
* @param epsilon maximum error allowed.

View File

@ -145,7 +145,7 @@ public final class MathUtils {
* <code>Long.MAX_VALUE</code> an <code>ArithMeticException
* </code> is
* thrown.</li>
* </ul>
* </ul></p>
*
* @param n the size of the set
* @param k the size of the subsets to be counted
@ -193,7 +193,7 @@ public final class MathUtils {
* largest value of <code>n</code> for which all coefficients are <
* Double.MAX_VALUE is 1029. If the computed value exceeds Double.MAX_VALUE,
* Double.POSITIVE_INFINITY is returned</li>
* </ul>
* </ul></p>
*
* @param n the size of the set
* @param k the size of the subsets to be counted
@ -215,7 +215,7 @@ public final class MathUtils {
* <ul>
* <li> <code>0 <= k <= n </code> (otherwise
* <code>IllegalArgumentException</code> is thrown)</li>
* </ul>
* </ul></p>
*
* @param n the size of the set
* @param k the size of the subsets to be counted
@ -340,7 +340,7 @@ public final class MathUtils {
* <ul>
* <li> <code>n >= 0</code> (otherwise
* <code>IllegalArgumentException</code> is thrown)</li>
* </ul>
* </ul></p>
*
* @param n argument
* @return <code>n!</code>
@ -615,9 +615,9 @@ public final class MathUtils {
* If <code>direction</code> is greater than or equal to<code>d</code>,
* the smallest machine representable number strictly greater than
* <code>d</code> is returned; otherwise the largest representable number
* strictly less than <code>d</code> is returned.
* strictly less than <code>d</code> is returned.</p>
* <p>
* If <code>d</code> is NaN or Infinite, it is returned unchanged.
* If <code>d</code> is NaN or Infinite, it is returned unchanged.</p>
*
* @param d base number
* @param direction (the only important thing is whether
@ -823,7 +823,7 @@ public final class MathUtils {
* for byte value <code>x</code>.
* <p>
* For a byte value x, this method returns (byte)(+1) if x > 0, (byte)(0) if
* x = 0, and (byte)(-1) if x < 0.
* x = 0, and (byte)(-1) if x < 0.</p>
*
* @param x the value, a byte
* @return (byte)(+1), (byte)(0), or (byte)(-1), depending on the sign of x
@ -839,7 +839,7 @@ public final class MathUtils {
* For a double value <code>x</code>, this method returns
* <code>+1.0</code> if <code>x > 0</code>, <code>0.0</code> if
* <code>x = 0.0</code>, and <code>-1.0</code> if <code>x < 0</code>.
* Returns <code>NaN</code> if <code>x</code> is <code>NaN</code>.
* Returns <code>NaN</code> if <code>x</code> is <code>NaN</code>.</p>
*
* @param x the value, a double
* @return +1.0, 0.0, or -1.0, depending on the sign of x
@ -857,7 +857,7 @@ public final class MathUtils {
* <p>
* For a float value x, this method returns +1.0F if x > 0, 0.0F if x =
* 0.0F, and -1.0F if x < 0. Returns <code>NaN</code> if <code>x</code>
* is <code>NaN</code>.
* is <code>NaN</code>.</p>
*
* @param x the value, a float
* @return +1.0F, 0.0F, or -1.0F, depending on the sign of x
@ -874,7 +874,7 @@ public final class MathUtils {
* for int value <code>x</code>.
* <p>
* For an int value x, this method returns +1 if x > 0, 0 if x = 0, and -1
* if x < 0.
* if x < 0.</p>
*
* @param x the value, an int
* @return +1, 0, or -1, depending on the sign of x
@ -888,7 +888,7 @@ public final class MathUtils {
* for long value <code>x</code>.
* <p>
* For a long value x, this method returns +1L if x > 0, 0L if x = 0, and
* -1L if x < 0.
* -1L if x < 0.</p>
*
* @param x the value, a long
* @return +1L, 0L, or -1L, depending on the sign of x
@ -902,7 +902,7 @@ public final class MathUtils {
* for short value <code>x</code>.
* <p>
* For a short value x, this method returns (short)(+1) if x > 0, (short)(0)
* if x = 0, and (short)(-1) if x < 0.
* if x = 0, and (short)(-1) if x < 0.</p>
*
* @param x the value, a short
* @return (short)(+1), (short)(0), or (short)(-1), depending on the sign of

View File

@ -66,7 +66,6 @@ import java.io.Serializable;
* properties enforce this requirement, throwing IllegalArgumentException if it
* is violated.
* </p>
* <p>
* @version $Revision$ $Date$
*/
public class ResizableDoubleArray implements DoubleArray, Serializable {
@ -395,6 +394,7 @@ public class ResizableDoubleArray implements DoubleArray, Serializable {
* the new array size will be <code>internalArray.length * expansionFactor.</code>
* If <code>expansionMode</code> is set to ADDITIVE_MODE, the length
* after expansion will be <code>internalArray.length + expansionFactor</code>
* </p>
*/
protected synchronized void expand() {