Javadoc. Fixed broken / malformed links.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@141165 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ff14c24084
commit
b6d8e5669e
|
@ -20,7 +20,7 @@ package org.apache.commons.math.linear;
|
|||
|
||||
/**
|
||||
* Interface defining a real-valued matrix with basic algebraic operations
|
||||
* @version $Revision: 1.14 $ $Date: 2004/04/08 07:02:55 $
|
||||
* @version $Revision: 1.15 $ $Date: 2004/04/11 19:00:45 $
|
||||
*/
|
||||
public interface RealMatrix {
|
||||
|
||||
|
@ -107,9 +107,8 @@ public interface RealMatrix {
|
|||
void setData(double[][] data);
|
||||
|
||||
/**
|
||||
* Returns the <a href="http://mathworld.wolfram.com/
|
||||
* MaximumAbsoluteRowSumNorm.html">maximum absolute row sum norm</a>
|
||||
* of the matrix.
|
||||
* Returns the <a href="http://mathworld.wolfram.com/MaximumAbsoluteRowSumNorm.html">
|
||||
* maximum absolute row sum norm</a> of the matrix.
|
||||
*
|
||||
* @return norm
|
||||
*/
|
||||
|
|
|
@ -21,13 +21,11 @@ import java.io.Serializable;
|
|||
|
||||
/**
|
||||
* Implementation for RealMatrix using a double[][] array to store entries
|
||||
* and <a href="http://www.math.gatech.edu/~bourbaki/
|
||||
* math2601/Web-notes/2num.pdf">LU decompostion</a> to support linear system
|
||||
* and <a href="http://www.math.gatech.edu/~bourbaki/math2601/Web-notes/2num.pdf">
|
||||
* LU decompostion</a> to support linear system
|
||||
* solution and inverse.
|
||||
* <p>
|
||||
* The <a href="http://www.math.gatech.edu/~bourbaki/math2601/Web-notes
|
||||
* /2num.pdf">LU decompostion</a> is performed as needed, to support the
|
||||
* following operations: <ul>
|
||||
* The LU decompostion is performed as needed, to support the following operations: <ul>
|
||||
* <li>solve</li>
|
||||
* <li>isSingular</li>
|
||||
* <li>getDeterminant</li>
|
||||
|
@ -42,7 +40,7 @@ import java.io.Serializable;
|
|||
* explicitly invoke <code>LUDecompose()</code> to recompute the decomposition
|
||||
* before using any of the methods above.
|
||||
*
|
||||
* @version $Revision: 1.17 $ $Date: 2004/04/08 20:46:01 $
|
||||
* @version $Revision: 1.18 $ $Date: 2004/04/11 19:00:45 $
|
||||
*/
|
||||
public class RealMatrixImpl implements RealMatrix, Serializable {
|
||||
|
||||
|
@ -617,14 +615,13 @@ public class RealMatrixImpl implements RealMatrix, Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
* Computes a new <a href="http://www.math.gatech.edu/~bourbaki/
|
||||
* math2601/Web-notes/2num.pdf">LU decompostion</a> for this matrix,
|
||||
* storing the result for use by other methods.
|
||||
* Computes a new
|
||||
* <a href="http://www.math.gatech.edu/~bourbaki/math2601/Web-notes/2num.pdf">
|
||||
* LU decompostion</a> for this matrix, storing the result for use by other methods.
|
||||
* <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.
|
||||
* Uses <a href="http://www.damtp.cam.ac.uk/user/fdl/people/sd/lectures/nummeth98/linear.htm">
|
||||
* Crout's algortithm</a>, with partial pivoting.
|
||||
* <p>
|
||||
* <strong>Usage Note</strong>:<br>
|
||||
* This method should rarely be invoked directly. Its only use is
|
||||
|
|
|
@ -19,7 +19,7 @@ import java.util.Collection;
|
|||
|
||||
/**
|
||||
* Random data generation utilities
|
||||
* @version $Revision: 1.8 $ $Date: 2004/02/21 21:35:15 $
|
||||
* @version $Revision: 1.9 $ $Date: 2004/04/11 19:00:45 $
|
||||
*/
|
||||
public interface RandomData {
|
||||
/**
|
||||
|
@ -107,8 +107,7 @@ public interface RandomData {
|
|||
* <code>nextInt</code> should be used instead of this method.
|
||||
* <p>
|
||||
* <strong>Definition</strong>:
|
||||
* <a href="http://www.wikipedia.org/wiki/
|
||||
* Cryptographically_secure_pseudo-random_number_generator">
|
||||
* <a href="http://en.wikipedia.org/wiki/Cryptographically_secure_pseudo-random_number_generator">
|
||||
* Secure Random Sequence</a>
|
||||
* <p>
|
||||
* <strong>Preconditions</strong>:<ul>
|
||||
|
@ -131,8 +130,7 @@ public interface RandomData {
|
|||
* <code>nextLong</code> should be used instead of this method.
|
||||
* <p>
|
||||
* <strong>Definition</strong>:
|
||||
* <a href="http://www.wikipedia.org/wiki/
|
||||
* Cryptographically_secure_pseudo-random_number_generator">
|
||||
* <a href="http://en.wikipedia.org/wiki/Cryptographically_secure_pseudo-random_number_generator">
|
||||
* Secure Random Sequence</a>
|
||||
* <p>
|
||||
* <strong>Preconditions</strong>:<ul>
|
||||
|
@ -152,8 +150,7 @@ public interface RandomData {
|
|||
* the given mean.
|
||||
* <p>
|
||||
* <strong>Definition</strong>:
|
||||
* <a href="http://www.itl.nist.gov/div898/handbook/
|
||||
* eda/section3/eda366j.htm">
|
||||
* <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda366j.htm">
|
||||
* Poisson Distribution</a>
|
||||
* <p>
|
||||
* <strong>Preconditions</strong>: <ul>
|
||||
|
@ -171,8 +168,7 @@ public interface RandomData {
|
|||
* and standard deviation.
|
||||
* <p>
|
||||
* <strong>Definition</strong>:
|
||||
* <a href="http://www.itl.nist.gov/div898/handbook/
|
||||
* eda/section3/eda3661.htm">
|
||||
* <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda3661.htm">
|
||||
* Normal Distribution</a>
|
||||
* <p>
|
||||
* <strong>Preconditions</strong>: <ul>
|
||||
|
@ -191,8 +187,7 @@ public interface RandomData {
|
|||
* with expected value = <code>mean</code>.
|
||||
* <p>
|
||||
* <strong>Definition</strong>:
|
||||
* <a href="http://www.itl.nist.gov/div898/handbook/
|
||||
* eda/section3/eda3667.htm">
|
||||
* <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda3667.htm">
|
||||
* Exponential Distribution</a>
|
||||
* <p>
|
||||
* <strong>Preconditions</strong>: <ul>
|
||||
|
@ -209,12 +204,10 @@ public interface RandomData {
|
|||
* (<code>lower</code>,<code>upper</code>) (i.e., endpoints excluded).
|
||||
* <p>
|
||||
* <strong>Definition</strong>:
|
||||
* <a href="http://www.itl.nist.gov/div898/handbook/
|
||||
* eda/section3/eda3662.htm">
|
||||
* <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda3662.htm">
|
||||
* Uniform Distribution</a> <code>lower</code> and
|
||||
* <code>upper - lower</code> are the
|
||||
* <a href = "http://www.itl.nist.gov/div898/handbook/eda/
|
||||
* section3/eda364.htm">
|
||||
* <a href = "http://www.itl.nist.gov/div898/handbook/eda/section3/eda364.htm">
|
||||
* location and scale parameters</a>, respectively.
|
||||
* <p>
|
||||
* <strong>Preconditions</strong>:<ul>
|
||||
|
@ -258,8 +251,7 @@ public interface RandomData {
|
|||
* is without replacement; but if <code>c</code> contains identical
|
||||
* objects, the sample may include repeats. If all elements of <code>
|
||||
* c</code> are distinct, the resulting object array represents a
|
||||
* <a href="http://rkb.home.cern.ch/rkb/AN16pp/
|
||||
* node250.html#SECTION0002500000000000000000">
|
||||
* <a href="http://rkb.home.cern.ch/rkb/AN16pp/node250.html#SECTION0002500000000000000000">
|
||||
* Simple Random Sample</a> of size
|
||||
* <code>k</code> from the elements of <code>c</code>.
|
||||
* <p>
|
||||
|
|
|
@ -30,7 +30,7 @@ import java.util.Collection;
|
|||
* <code>java.util.Random.SecureRandom</code> instances to generate data.
|
||||
* <p>
|
||||
* Supports reseeding the underlying
|
||||
* <a href="http://www.wikipedia.org/wiki/Pseudo-random_number_generator">
|
||||
* <a href="http://en.wikipedia.org/wiki/Pseudorandom_number_generator">
|
||||
* PRNG</a>. The <code>SecurityProvider</code> and <code>Algorithm</code>
|
||||
* used by the <code>SecureRandom</code> instance can also be reset.
|
||||
* <p>
|
||||
|
@ -46,9 +46,8 @@ import java.util.Collection;
|
|||
* <strong>one</strong> <code>RandomDataImpl</code> instance repeatedly.</li>
|
||||
* <li>
|
||||
* The "secure" methods are *much* slower. These should be used only when
|
||||
* a <a href="http://www.wikipedia.org/wiki/
|
||||
* Cryptographically_secure_pseudo-random_number_generator"> Secure Random
|
||||
* Sequence</a> is required.</li>
|
||||
* a <a href="http://en.wikipedia.org/wiki/Cryptographically_secure_pseudo-random_number_generator">
|
||||
* Secure Random Sequence</a> is required.</li>
|
||||
* <li>
|
||||
* When a new <code>RandomDataImpl</code> is created, the underlying random
|
||||
* number generators are <strong>not</strong> intialized. The first call to a
|
||||
|
@ -67,7 +66,7 @@ import java.util.Collection;
|
|||
* (so secure sequences started with calls to reseedSecure(long) won't be
|
||||
* identical).</li></ul>
|
||||
*
|
||||
* @version $Revision: 1.12 $ $Date: 2004/02/21 21:35:15 $
|
||||
* @version $Revision: 1.13 $ $Date: 2004/04/11 19:00:45 $
|
||||
*/
|
||||
public class RandomDataImpl implements RandomData, Serializable {
|
||||
|
||||
|
@ -462,7 +461,7 @@ public class RandomDataImpl implements RandomData, Serializable {
|
|||
/**
|
||||
* Uses a 2-cycle permutation shuffle to generate a random permutation.
|
||||
* The shuffling process is described
|
||||
* <a href=http://www.maths.abdn.ac.uk/~igc/tch/mx4002/notes/node83.html>
|
||||
* <a href="http://www.maths.abdn.ac.uk/~igc/tch/mx4002/notes/node83.html">
|
||||
* here</a>.
|
||||
* @param n the population size.
|
||||
* @param k the number to choose.
|
||||
|
|
|
@ -49,7 +49,7 @@ import org.apache.commons.math.distribution.TDistribution;
|
|||
* the necessary computations to return the requested statistic.</li>
|
||||
* </ul>
|
||||
*
|
||||
* @version $Revision: 1.15 $ $Date: 2004/03/21 22:39:56 $
|
||||
* @version $Revision: 1.16 $ $Date: 2004/04/11 19:00:45 $
|
||||
*/
|
||||
public class BivariateRegression implements Serializable {
|
||||
|
||||
|
@ -382,8 +382,8 @@ public class BivariateRegression implements Serializable {
|
|||
* <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>.
|
||||
* <a href="http://mathworld.wolfram.com/BivariateNormalDistribution.html">
|
||||
* Bivariate Normal Distribution</a>.
|
||||
*
|
||||
* @return half-width of 95% confidence interval for the slope estimate
|
||||
*/
|
||||
|
@ -406,8 +406,8 @@ public class BivariateRegression implements Serializable {
|
|||
* <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>.
|
||||
* <a href="http://mathworld.wolfram.com/BivariateNormalDistribution.html">
|
||||
* Bivariate Normal Distribution</a>.
|
||||
* <p>
|
||||
* <strong> Preconditions:</strong><ul>
|
||||
* <li>If there are fewer that <strong>three</strong> observations in the
|
||||
|
@ -441,8 +441,8 @@ public class BivariateRegression implements Serializable {
|
|||
* <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>.
|
||||
* <a href="http://mathworld.wolfram.com/BivariateNormalDistribution.html">
|
||||
* Bivariate Normal Distribution</a>.
|
||||
* <p>
|
||||
* If there are fewer that <strong>three</strong> observations in the
|
||||
* model, or if there is no variation in x, this returns
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.apache.commons.math.stat.univariate.UnivariateStatistic;
|
|||
/**
|
||||
* Abstract factory class for univariate statistical summaries.
|
||||
*
|
||||
* @version $Revision: 1.5 $ $Date: 2004/02/21 21:35:15 $
|
||||
* @version $Revision: 1.6 $ $Date: 2004/04/11 19:00:45 $
|
||||
*/
|
||||
public abstract class DescriptiveStatistics implements Serializable, StatisticalSummary {
|
||||
|
||||
|
@ -228,9 +228,10 @@ public abstract class DescriptiveStatistics implements Serializable, Statistical
|
|||
|
||||
/**
|
||||
* Returns an estimate for the pth percentile of the stored values.
|
||||
* This estimate follows the interpolation-adjusted defintion presented
|
||||
* <a href="http://www.utdallas.edu/~ammann/stat5311/node8.html">here</a>
|
||||
* <p/>
|
||||
* <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>
|
||||
* <strong>Preconditions</strong>:<ul>
|
||||
* <li><code>0 < p < 100</code> (otherwise an
|
||||
* <code>IllegalArgumentException</code> is thrown)</li>
|
||||
|
|
|
@ -27,10 +27,10 @@ import org.apache.commons.math.stat.univariate.summary.SumOfLogs;
|
|||
import org.apache.commons.math.stat.univariate.summary.SumOfSquares;
|
||||
|
||||
/**
|
||||
* StatUtils provides easy static implementations of common double[] based
|
||||
* StatUtils provides static implementations of common double[] based
|
||||
* statistical methods. These return a single result value or in some cases, as
|
||||
* identified in the javadoc for each method, Double.NaN.
|
||||
* @version $Revision: 1.25 $ $Date: 2004/03/04 04:25:09 $
|
||||
* identified in the javadoc for each method, <code>Double.NaN.</code>
|
||||
* @version $Revision: 1.26 $ $Date: 2004/04/11 19:00:45 $
|
||||
*/
|
||||
public final class StatUtils {
|
||||
|
||||
|
@ -70,7 +70,7 @@ public final class StatUtils {
|
|||
/**
|
||||
* The sum of the values that have been added to Univariate.
|
||||
* @param values Is a double[] containing the values
|
||||
* @return the sum of the values or Double.NaN if the array is empty
|
||||
* @return the sum of the values or <code>Double.NaN</code> if the array is empty
|
||||
*/
|
||||
public static double sum(final double[] values) {
|
||||
return sum.evaluate(values);
|
||||
|
@ -81,7 +81,7 @@ public final class StatUtils {
|
|||
* @param values Is a double[] containing the values
|
||||
* @param begin processing at this point in the array
|
||||
* @param length the number of elements to include
|
||||
* @return the sum of the values or Double.NaN if the array is empty
|
||||
* @return the sum of the values or <code>Double.NaN</code> if the array is empty
|
||||
*/
|
||||
public static double sum(
|
||||
final double[] values,
|
||||
|
@ -93,7 +93,7 @@ public final class StatUtils {
|
|||
/**
|
||||
* Returns the sum of the squares of the available values.
|
||||
* @param values Is a double[] containing the values
|
||||
* @return the sum of the squared values or Double.NaN if the array is empty
|
||||
* @return the sum of the squared values or <code>Double.NaN</code> if the array is empty
|
||||
*/
|
||||
public static double sumSq(final double[] values) {
|
||||
return sumSq.evaluate(values);
|
||||
|
@ -104,7 +104,7 @@ public final class StatUtils {
|
|||
* @param values Is a double[] containing the values
|
||||
* @param begin processing at this point in the array
|
||||
* @param length the number of elements to include
|
||||
* @return the sum of the squared values or Double.NaN if the array is empty
|
||||
* @return the sum of the squared values or <code>Double.NaN</code> if the array is empty
|
||||
*/
|
||||
public static double sumSq(
|
||||
final double[] values,
|
||||
|
@ -116,7 +116,7 @@ public final class StatUtils {
|
|||
/**
|
||||
* Returns the product for this collection of values
|
||||
* @param values Is a double[] containing the values
|
||||
* @return the product values or Double.NaN if the array is empty
|
||||
* @return the product values or <code>Double.NaN</code> if the array is empty
|
||||
*/
|
||||
public static double product(final double[] values) {
|
||||
return prod.evaluate(values);
|
||||
|
@ -127,7 +127,7 @@ public final class StatUtils {
|
|||
* @param values Is a double[] containing the values
|
||||
* @param begin processing at this point in the array
|
||||
* @param length the number of elements to include
|
||||
* @return the product values or Double.NaN if the array is empty
|
||||
* @return the product values or <code>Double.NaN</code> if the array is empty
|
||||
*/
|
||||
public static double product(
|
||||
final double[] values,
|
||||
|
@ -139,7 +139,7 @@ public final class StatUtils {
|
|||
/**
|
||||
* Returns the sum of the natural logs for this collection of values
|
||||
* @param values Is a double[] containing the values
|
||||
* @return the sumLog value or Double.NaN if the array is empty
|
||||
* @return the sumLog value or <code>Double.NaN</code> if the array is empty
|
||||
*/
|
||||
public static double sumLog(final double[] values) {
|
||||
return sumLog.evaluate(values);
|
||||
|
@ -150,7 +150,7 @@ public final class StatUtils {
|
|||
* @param values Is a double[] containing the values
|
||||
* @param begin processing at this point in the array
|
||||
* @param length the number of elements to include
|
||||
* @return the sumLog value or Double.NaN if the array is empty
|
||||
* @return the sumLog value or <code>Double.NaN</code> if the array is empty
|
||||
*/
|
||||
public static double sumLog(
|
||||
final double[] values,
|
||||
|
@ -160,22 +160,22 @@ public final class StatUtils {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the <a href=http://www.xycoon.com/arithmetic_mean.htm>
|
||||
* Returns the <a href="http://www.xycoon.com/arithmetic_mean.htm">
|
||||
* arithmetic mean </a> of the available values
|
||||
* @param values Is a double[] containing the values
|
||||
* @return the mean of the values or Double.NaN if the array is empty
|
||||
* @return the mean of the values or <code>Double.NaN</code> if the array is empty
|
||||
*/
|
||||
public static double mean(final double[] values) {
|
||||
return mean.evaluate(values);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the <a href=http://www.xycoon.com/arithmetic_mean.htm>
|
||||
* Returns the <a href="http://www.xycoon.com/arithmetic_mean.htm">
|
||||
* arithmetic mean </a> of the available values
|
||||
* @param values Is a double[] containing the values
|
||||
* @param begin processing at this point in the array
|
||||
* @param length the number of elements to include
|
||||
* @return the mean of the values or Double.NaN if the array is empty
|
||||
* @return the mean of the values or <code>Double.NaN</code> if the array is empty
|
||||
*/
|
||||
public static double mean(
|
||||
final double[] values,
|
||||
|
@ -186,15 +186,14 @@ public final class StatUtils {
|
|||
|
||||
/**
|
||||
* Returns the variance of the available values. This uses a corrected
|
||||
* two pass algorithm of the following
|
||||
* <a href="http://lib-www.lanl.gov/numerical/bookcpdf/c14-1.pdf">
|
||||
* corrected two pass formula (14.1.8)</a>, and also referenced in:<p/>
|
||||
* two pass algorithm as described in:
|
||||
* <p>
|
||||
* "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.
|
||||
* 1983, American Statistician, vol. 37, pp. 242-247.
|
||||
*
|
||||
* @param values Is a double[] containing the values
|
||||
* @return the result, Double.NaN if no values for an empty array
|
||||
* @return the result, <code>Double.NaN</code> for an empty array
|
||||
* or 0.0 for a single value set.
|
||||
*/
|
||||
public static double variance(final double[] values) {
|
||||
|
@ -203,17 +202,16 @@ public final class StatUtils {
|
|||
|
||||
/**
|
||||
* Returns the variance of the available values. This uses a corrected
|
||||
* two pass algorithm of the following
|
||||
* <a href="http://lib-www.lanl.gov/numerical/bookcpdf/c14-1.pdf">
|
||||
* corrected two pass formula (14.1.8)</a>, and also referenced in:<p/>
|
||||
* two pass algorithm as described in:
|
||||
* <p>
|
||||
* "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.
|
||||
* 1983, American Statistician, vol. 37, pp. 242-247.
|
||||
*
|
||||
* @param values Is a double[] containing the values
|
||||
* @param begin processing at this point in the array
|
||||
* @param length the number of elements to include
|
||||
* @return the result, Double.NaN if no values for an empty array
|
||||
* @return the result, <code>Double.NaN</code> for an empty array
|
||||
* or 0.0 for a single value set.
|
||||
*/
|
||||
public static double variance(
|
||||
|
@ -226,7 +224,7 @@ public final class StatUtils {
|
|||
/**
|
||||
* Returns the maximum of the available values
|
||||
* @param values Is a double[] containing the values
|
||||
* @return the maximum of the values or Double.NaN if the array is empty
|
||||
* @return the maximum of the values or <code>Double.NaN</code> if the array is empty
|
||||
*/
|
||||
public static double max(final double[] values) {
|
||||
return max.evaluate(values);
|
||||
|
@ -237,7 +235,7 @@ public final class StatUtils {
|
|||
* @param values Is a double[] containing the values
|
||||
* @param begin processing at this point in the array
|
||||
* @param length the number of elements to include
|
||||
* @return the maximum of the values or Double.NaN if the array is empty
|
||||
* @return the maximum of the values or <code>Double.NaN</code> if the array is empty
|
||||
*/
|
||||
public static double max(
|
||||
final double[] values,
|
||||
|
@ -249,7 +247,7 @@ public final class StatUtils {
|
|||
/**
|
||||
* Returns the minimum of the available values
|
||||
* @param values Is a double[] containing the values
|
||||
* @return the minimum of the values or Double.NaN if the array is empty
|
||||
* @return the minimum of the values or <code>Double.NaN</code> if the array is empty
|
||||
*/
|
||||
public static double min(final double[] values) {
|
||||
return min.evaluate(values);
|
||||
|
@ -260,7 +258,7 @@ public final class StatUtils {
|
|||
* @param values Is a double[] containing the values
|
||||
* @param begin processing at this point in the array
|
||||
* @param length the number of elements to include
|
||||
* @return the minimum of the values or Double.NaN if the array is empty
|
||||
* @return the minimum of the values or <code>Double.NaN</code> if the array is empty
|
||||
*/
|
||||
public static double min(
|
||||
final double[] values,
|
||||
|
@ -271,9 +269,10 @@ public final class StatUtils {
|
|||
|
||||
/**
|
||||
* Returns an estimate for the pth percentile of the stored values.
|
||||
* This estimate follows the interpolation-adjusted defintion presented
|
||||
* <a href="http://www.utdallas.edu/~ammann/stat5311/node8.html">here</a>
|
||||
* <p/>
|
||||
* <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>
|
||||
* <strong>Preconditions</strong>:<ul>
|
||||
* <li><code>0 < p < 100</code> (otherwise an
|
||||
* <code>IllegalArgumentException</code> is thrown)</li>
|
||||
|
@ -291,9 +290,10 @@ public final class StatUtils {
|
|||
|
||||
/**
|
||||
* Returns an estimate for the pth percentile of the stored values.
|
||||
* This estimate follows the interpolation-adjusted defintion presented
|
||||
* <a href="http://www.utdallas.edu/~ammann/stat5311/node8.html">here</a>
|
||||
* <p/>
|
||||
*<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>
|
||||
* <strong>Preconditions</strong>:<ul>
|
||||
* <li><code>0 < p < 100</code> (otherwise an
|
||||
* <code>IllegalArgumentException</code> is thrown)</li>
|
||||
|
@ -313,7 +313,5 @@ public final class StatUtils {
|
|||
final int length,
|
||||
final double p) {
|
||||
return percentile.evaluate(values, begin, length, p);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -20,14 +20,14 @@ import org.apache.commons.math.MathException;
|
|||
/**
|
||||
* A collection of commonly used test statistics and statistical tests.
|
||||
*
|
||||
* @version $Revision: 1.14 $ $Date: 2004/04/08 20:46:00 $
|
||||
* @version $Revision: 1.15 $ $Date: 2004/04/11 19:00:45 $
|
||||
*/
|
||||
public interface TestStatistic {
|
||||
|
||||
/**
|
||||
* Computes the <a href="http://www.itl.nist.gov/div898/handbook/eda
|
||||
* /section3/eda35f.htm">Chi-Square statistic</a> comparing
|
||||
* <code>observed</code> and <code>expected</code> freqeuncy counts.
|
||||
* Computes the <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda35f.htm">
|
||||
* Chi-Square statistic</a> comparing <code>observed</code> and <code>expected</code>
|
||||
* freqeuncy counts.
|
||||
* <p>
|
||||
* This statistic can be used to perform Chi-Square tests.
|
||||
* <p>
|
||||
|
@ -53,14 +53,14 @@ public interface TestStatistic {
|
|||
/**
|
||||
* Returns the <i>observed significance level</i>, or <a href=
|
||||
* "http://www.cas.lancs.ac.uk/glossary_v1.1/hyptest.html#pvalue">
|
||||
* p-value</a>, associated with a <a href="http://www.itl.nist.gov/div898/
|
||||
* handbook/eda/section3/eda35f.htm">Chi-square goodness of fit test</a>
|
||||
* comparing the <code>observed</code> frequency counts to those in the
|
||||
* <code>expected</code> array.
|
||||
* p-value</a>, associated with a
|
||||
* <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda35f.htm">
|
||||
* Chi-square goodness of fit test</a> comparing the <code>observed</code>
|
||||
* frequency counts to those in the <code>expected</code> array.
|
||||
* <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.
|
||||
* 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.
|
||||
* <p>
|
||||
* <strong>Preconditions</strong>: <ul>
|
||||
* <li>Expected counts must all be positive.
|
||||
|
@ -83,11 +83,10 @@ public interface TestStatistic {
|
|||
throws IllegalArgumentException, MathException;
|
||||
|
||||
/**
|
||||
* Performs a <a href="http://www.itl.nist.gov/div898/handbook/eda/
|
||||
* section3/eda35f.htm">Chi-square goodness of fit test</a> evaluating the
|
||||
* null hypothesis that the observed counts conform to the frequency
|
||||
* distribution described by the expected counts, with significance level
|
||||
* <code>alpha</code>.
|
||||
* Performs a <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda35f.htm">
|
||||
* Chi-square goodness of fit test</a> evaluating the null hypothesis that the observed counts
|
||||
* conform to the frequency distribution described by the expected counts, with
|
||||
* significance level <code>alpha</code>.
|
||||
* <p>
|
||||
* <strong>Example:</strong><br>
|
||||
* To test the hypothesis that <code>observed</code> follows
|
||||
|
@ -118,9 +117,8 @@ public interface TestStatistic {
|
|||
throws IllegalArgumentException, MathException;
|
||||
|
||||
/**
|
||||
* Computes a <a href="http://www.itl.nist.gov/div898/handbook/prc/
|
||||
* section2/prc22.htm#formula"> t statistic </a> given observed values and
|
||||
* a comparison constant.
|
||||
* Computes a <a href="http://www.itl.nist.gov/div898/handbook/prc/section2/prc22.htm#formula">
|
||||
* 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>
|
||||
|
@ -137,9 +135,8 @@ public interface TestStatistic {
|
|||
throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Computes a <a href="http://www.itl.nist.gov/div898/handbook/prc/section3
|
||||
* /prc31.htm">2-sample t statistic </a>, without the assumption of equal
|
||||
* sample variances.
|
||||
* Computes a <a href="http://www.itl.nist.gov/div898/handbook/prc/section3/prc31.htm">
|
||||
* 2-sample t statistic </a>, without the assumption of equal sample variances.
|
||||
* <p>
|
||||
* This statistic can be used to perform a two-sample t-test to compare
|
||||
* sample means.
|
||||
|
@ -159,8 +156,8 @@ public interface TestStatistic {
|
|||
throws IllegalArgumentException, MathException;
|
||||
|
||||
/**
|
||||
* Returns the <i>observed significance level</i>, or <a href=
|
||||
* "http://www.cas.lancs.ac.uk/glossary_v1.1/hyptest.html#pvalue">
|
||||
* Returns the <i>observed significance level</i>, or
|
||||
* <a href="http://www.cas.lancs.ac.uk/glossary_v1.1/hyptest.html#pvalue">
|
||||
* p-value</a>, associated with a two-sample, two-tailed t-test
|
||||
* comparing the means of the input arrays.
|
||||
* <p>
|
||||
|
@ -171,13 +168,13 @@ public interface TestStatistic {
|
|||
* <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 as described <a href="http://www.itl.nist.gov/div898/
|
||||
* handbook/prc/section3/prc31.htm">here</a>
|
||||
* sample data as described
|
||||
* <a href="http://www.itl.nist.gov/div898/handbook/prc/section3/prc31.htm">here</a>
|
||||
* <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>
|
||||
* t-test procedure, as discussed
|
||||
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">here</a>
|
||||
* <p>
|
||||
* <strong>Preconditions</strong>: <ul>
|
||||
* <li>The observed array lengths must both be at least 5.
|
||||
|
@ -193,11 +190,10 @@ public interface TestStatistic {
|
|||
throws IllegalArgumentException, MathException;
|
||||
|
||||
/**
|
||||
* Performs a <a href="http://www.itl.nist.gov/div898/handbook/eda/
|
||||
* section3/eda353.htm">two-sided t-test</a> evaluating the null
|
||||
* hypothesis that <code>sample1</code> and <code>sample2</code> are drawn
|
||||
* from populations with the same mean, with significance level
|
||||
* <code>alpha</code>.
|
||||
* Performs a <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda353.htm">
|
||||
* two-sided t-test</a> evaluating the null hypothesis that <code>sample1</code>
|
||||
* and <code>sample2</code> are drawn from populations with the same mean,
|
||||
* with significance level <code>alpha</code>.
|
||||
* <p>
|
||||
* Returns <code>true</code> iff the null hypothesis that the means are
|
||||
* equal can be rejected with confidence <code>1 - alpha</code>. To
|
||||
|
@ -215,13 +211,13 @@ public interface TestStatistic {
|
|||
* <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 as described <a href="http://www.itl.nist.gov/div898/
|
||||
* handbook/prc/section3/prc31.htm">here</a>
|
||||
* sample data as described
|
||||
* <a href="http://www.itl.nist.gov/div898/handbook/prc/section3/prc31.htm">here</a>
|
||||
* <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>
|
||||
* t-test procedure, as discussed
|
||||
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">here</a>
|
||||
* <p>
|
||||
* <strong>Preconditions</strong>: <ul>
|
||||
* <li>The observed array lengths must both be at least 5.
|
||||
|
@ -241,10 +237,9 @@ public interface TestStatistic {
|
|||
throws IllegalArgumentException, MathException;
|
||||
|
||||
/**
|
||||
* Performs a <a href="http://www.itl.nist.gov/div898/handbook/eda/
|
||||
* section3/eda353.htm">two-sided t-test</a> evaluating the null
|
||||
* hypothesis that the mean of the population from which
|
||||
* <code>sample</code> is drawn equals <code>mu</code>.
|
||||
* Performs a <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda353.htm">
|
||||
* two-sided t-test</a> evaluating the null hypothesis that the mean of the population from
|
||||
* which <code>sample</code> is drawn equals <code>mu</code>.
|
||||
* <p>
|
||||
* Returns <code>true</code> iff the null hypothesis can be
|
||||
* rejected with confidence <code>1 - alpha</code>. To
|
||||
|
@ -263,8 +258,7 @@ public interface TestStatistic {
|
|||
* <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>
|
||||
* <a href="http://www.basic.nwu.edu/statguidefiles/sg_glos.html#one-sample">here</a>
|
||||
* <p>
|
||||
* <strong>Preconditions</strong>: <ul>
|
||||
* <li>The observed array length must be at least 5.
|
||||
|
@ -281,8 +275,8 @@ public interface TestStatistic {
|
|||
throws IllegalArgumentException, MathException;
|
||||
|
||||
/**
|
||||
* Returns the <i>observed significance level</i>, or <a href=
|
||||
* "http://www.cas.lancs.ac.uk/glossary_v1.1/hyptest.html#pvalue">
|
||||
* Returns the <i>observed significance level</i>, or
|
||||
* <a href="http://www.cas.lancs.ac.uk/glossary_v1.1/hyptest.html#pvalue">
|
||||
* p-value</a>, associated with a one-sample, two-tailed t-test
|
||||
* comparing the mean of the input array with the constant <code>mu</code>.
|
||||
* <p>
|
||||
|
@ -294,8 +288,8 @@ public interface TestStatistic {
|
|||
* <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>
|
||||
* t-test procedure, as discussed
|
||||
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">here</a>
|
||||
* <p>
|
||||
* <strong>Preconditions</strong>: <ul>
|
||||
* <li>The observed array length must be at least 5.
|
||||
|
@ -311,9 +305,9 @@ public interface TestStatistic {
|
|||
throws IllegalArgumentException, MathException;
|
||||
|
||||
/**
|
||||
* Computes a <a href="http://www.itl.nist.gov/div898/handbook/prc/
|
||||
* section2/prc22.htm#formula"> t statistic </a> to use in comparing
|
||||
* the dataset described by <code>sampleStats</code> to <code>mu</code>.
|
||||
* Computes a <a href="http://www.itl.nist.gov/div898/handbook/prc/section2/prc22.htm#formula">
|
||||
* t statistic </a> to use in comparing the dataset described by <code>sampleStats</code>
|
||||
* to <code>mu</code>.
|
||||
* <p>
|
||||
* This statistic can be used to perform a one sample t-test for the mean.
|
||||
* <p>
|
||||
|
@ -330,9 +324,9 @@ public interface TestStatistic {
|
|||
throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Computes a <a href="http://www.itl.nist.gov/div898/handbook/prc/section3
|
||||
* /prc31.htm">2-sample t statistic </a>, comparing the datasets described
|
||||
* by two Univariates without the assumption of equal sample variances.
|
||||
* Computes a <a href="http://www.itl.nist.gov/div898/handbook/prc/section3/prc31.htm">
|
||||
* 2-sample t statistic </a>, comparing the means of the datasets described
|
||||
* by two {@link StatisticalSummary} instances without the assumption of equal sample variances.
|
||||
* <p>
|
||||
* This statistic can be used to perform a two-sample t-test to compare
|
||||
* sample means.
|
||||
|
@ -342,8 +336,8 @@ public interface TestStatistic {
|
|||
* at least 5 observations.
|
||||
* </li></ul>
|
||||
*
|
||||
* @param sampleStats1 DescriptiveStatistics describing data from the first sample
|
||||
* @param sampleStats2 DescriptiveStatistics describing data from the second sample
|
||||
* @param sampleStats1 StatisticalSummary describing data from the first sample
|
||||
* @param sampleStats2 StatisticalSummary describing data from the second sample
|
||||
* @return t statistic
|
||||
* @throws IllegalArgumentException if the precondition is not met
|
||||
*/
|
||||
|
@ -351,8 +345,8 @@ public interface TestStatistic {
|
|||
throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Returns the <i>observed significance level</i>, or <a href=
|
||||
* "http://www.cas.lancs.ac.uk/glossary_v1.1/hyptest.html#pvalue">
|
||||
* Returns the <i>observed significance level</i>, or
|
||||
* <a href="http://www.cas.lancs.ac.uk/glossary_v1.1/hyptest.html#pvalue">
|
||||
* p-value</a>, associated with a two-sample, two-tailed t-test
|
||||
* comparing the means of the datasets described by two Univariates.
|
||||
* <p>
|
||||
|
@ -363,13 +357,13 @@ public interface TestStatistic {
|
|||
* <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 as described <a href="http://www.itl.nist.gov/div898/
|
||||
* handbook/prc/section3/prc31.htm">here</a>
|
||||
* sample data as described
|
||||
* <a href="http://www.itl.nist.gov/div898/handbook/prc/section3/prc31.htm">here</a>
|
||||
* <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>
|
||||
* t-test procedure, as discussed
|
||||
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">here</a>
|
||||
* <p>
|
||||
* <strong>Preconditions</strong>: <ul>
|
||||
* <li>The datasets described by the two Univariates must each contain
|
||||
|
@ -386,11 +380,10 @@ public interface TestStatistic {
|
|||
throws IllegalArgumentException, MathException;
|
||||
|
||||
/**
|
||||
* Performs a <a href="http://www.itl.nist.gov/div898/handbook/eda/
|
||||
* section3/eda353.htm">two-sided t-test</a> evaluating the null
|
||||
* hypothesis that <code>sampleStats1</code> and <code>sampleStats2</code>
|
||||
* describe datasets drawn from populations with the same mean, with
|
||||
* significance level <code>alpha</code>.
|
||||
* Performs a <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda353.htm">
|
||||
* two-sided t-test</a> evaluating the null hypothesis that <code>sampleStats1</code>
|
||||
* and <code>sampleStats2</code> describe datasets drawn from populations with the
|
||||
* same mean, with significance level <code>alpha</code>.
|
||||
* <p>
|
||||
* Returns <code>true</code> iff the null hypothesis that the means are
|
||||
* equal can be rejected with confidence <code>1 - alpha</code>. To
|
||||
|
@ -409,13 +402,13 @@ public interface TestStatistic {
|
|||
* <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 as described <a href="http://www.itl.nist.gov/div898/
|
||||
* handbook/prc/section3/prc31.htm">here</a>
|
||||
* sample data as described
|
||||
* <a href="http://www.itl.nist.gov/div898/handbook/prc/section3/prc31.htm">here</a>
|
||||
* <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>
|
||||
* t-test procedure, as discussed
|
||||
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">here</a>
|
||||
* <p>
|
||||
* <strong>Preconditions</strong>: <ul>
|
||||
* <li>The datasets described by the two Univariates must each contain
|
||||
|
@ -437,10 +430,9 @@ public interface TestStatistic {
|
|||
throws IllegalArgumentException, MathException;
|
||||
|
||||
/**
|
||||
* Performs a <a href="http://www.itl.nist.gov/div898/handbook/eda/
|
||||
* section3/eda353.htm">two-sided t-test</a> evaluating the null
|
||||
* hypothesis that the mean of the population from which the dataset
|
||||
* described by <code>stats</code> is drawn equals <code>mu</code>.
|
||||
* Performs a <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda353.htm">
|
||||
* two-sided t-test</a> evaluating the null hypothesis that the mean of the population from
|
||||
* which the dataset described by <code>stats</code> is drawn equals <code>mu</code>.
|
||||
* <p>
|
||||
* Returns <code>true</code> iff the null hypothesis can be
|
||||
* rejected with confidence <code>1 - alpha</code>. To
|
||||
|
@ -459,8 +451,7 @@ public interface TestStatistic {
|
|||
* <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>
|
||||
* <a href="http://www.basic.nwu.edu/statguidefiles/sg_glos.html#one-sample">here</a>
|
||||
* <p>
|
||||
* <strong>Preconditions</strong>: <ul>
|
||||
* <li>The sample must include at least 5 observations.
|
||||
|
@ -477,8 +468,8 @@ public interface TestStatistic {
|
|||
throws IllegalArgumentException, MathException;
|
||||
|
||||
/**
|
||||
* Returns the <i>observed significance level</i>, or <a href=
|
||||
* "http://www.cas.lancs.ac.uk/glossary_v1.1/hyptest.html#pvalue">
|
||||
* Returns the <i>observed significance level</i>, or
|
||||
* <a href="http://www.cas.lancs.ac.uk/glossary_v1.1/hyptest.html#pvalue">
|
||||
* p-value</a>, associated with a one-sample, two-tailed t-test
|
||||
* comparing the mean of the dataset described by <code>sampleStats</code>
|
||||
* with the constant <code>mu</code>.
|
||||
|
@ -491,8 +482,8 @@ public interface TestStatistic {
|
|||
* <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>
|
||||
* t-test procedure, as discussed
|
||||
* <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html">here</a>
|
||||
* <p>
|
||||
* <strong>Preconditions</strong>: <ul>
|
||||
* <li>The sample must contain at least 5 observations.
|
||||
|
|
Loading…
Reference in New Issue