| org.apache.commons.math.stat.descriptive.AbstractStorelessUnivariateStatistic org.apache.commons.math.stat.descriptive.moment.StandardDeviation
StandardDeviation | public class StandardDeviation extends AbstractStorelessUnivariateStatistic implements Serializable(Code) | | Computes the sample standard deviation. The standard deviation
is the positive square root of the variance. This implementation wraps a
Variance instance. The isBiasCorrected property of the
wrapped Variance instance is exposed, so that this class can be used to
compute both the "sample standard deviation" (the square root of the
bias-corrected "sample variance") or the "population standard deviation"
(the square root of the non-bias-corrected "population variance"). See
Variance for more information.
Note that this implementation is not synchronized. If
multiple threads access an instance of this class concurrently, and at least
one of the threads invokes the increment() or
clear() method, it must be synchronized externally.
version: $Revision: 348519 $ $Date: 2005-11-23 12:12:18 -0700 (Wed, 23 Nov 2005) $ |
Constructor Summary | |
public | StandardDeviation() Constructs a StandardDeviation. | public | StandardDeviation(SecondMoment m2) Constructs a StandardDeviation from an external second moment. | public | StandardDeviation(boolean isBiasCorrected) Contructs a StandardDeviation with the specified value for the
isBiasCorrected property. | public | StandardDeviation(boolean isBiasCorrected, SecondMoment m2) Contructs a StandardDeviation with the specified value for the
isBiasCorrected property and the supplied external moment.
If isBiasCorrected is set to true , the
Variance used in computing results will use the bias-corrected,
or "sample" formula. |
Method Summary | |
public void | clear() | public double | evaluate(double[] values) Returns the Standard Deviation of the entries in the input array, or
Double.NaN if the array is empty.
Returns 0 for a single-value (i.e. | public double | evaluate(double[] values, int begin, int length) Returns the Standard Deviation of the entries in the specified portion of
the input array, or Double.NaN if the designated subarray
is empty.
Returns 0 for a single-value (i.e. | public double | evaluate(double[] values, double mean, int begin, int length) Returns the Standard Deviation of the entries in the specified portion of
the input array, using the precomputed mean value. | public double | evaluate(double[] values, double mean) Returns the Standard Deviation of the entries in the input array, using
the precomputed mean value. | public long | getN() | public double | getResult() | public void | increment(double d) | public boolean | isBiasCorrected() | public void | setBiasCorrected(boolean isBiasCorrected) |
StandardDeviation | public StandardDeviation()(Code) | | Constructs a StandardDeviation. Sets the underlying
Variance instance's isBiasCorrected property to true.
|
StandardDeviation | public StandardDeviation(SecondMoment m2)(Code) | | Constructs a StandardDeviation from an external second moment.
Parameters: m2 - the external moment |
StandardDeviation | public StandardDeviation(boolean isBiasCorrected)(Code) | | Contructs a StandardDeviation with the specified value for the
isBiasCorrected property. If this property is set to
true , the
Variance used in computing results will
use the bias-corrected, or "sample" formula. See
Variance for
details.
Parameters: isBiasCorrected - whether or not the variance computation will usethe bias-corrected formula |
StandardDeviation | public StandardDeviation(boolean isBiasCorrected, SecondMoment m2)(Code) | | Contructs a StandardDeviation with the specified value for the
isBiasCorrected property and the supplied external moment.
If isBiasCorrected is set to true , the
Variance used in computing results will use the bias-corrected,
or "sample" formula. See
Variance for details.
Parameters: isBiasCorrected - whether or not the variance computation will usethe bias-corrected formula Parameters: m2 - the external moment |
evaluate | public double evaluate(double[] values)(Code) | | Returns the Standard Deviation of the entries in the input array, or
Double.NaN if the array is empty.
Returns 0 for a single-value (i.e. length = 1) sample.
Throws IllegalArgumentException if the array is null.
Does not change the internal state of the statistic.
Parameters: values - the input array the standard deviation of the values or Double.NaN if length = 0 throws: IllegalArgumentException - if the array is null |
evaluate | public double evaluate(double[] values, int begin, int length)(Code) | | Returns the Standard Deviation of the entries in the specified portion of
the input array, or Double.NaN if the designated subarray
is empty.
Returns 0 for a single-value (i.e. length = 1) sample.
Throws IllegalArgumentException if the array is null.
Does not change the internal state of the statistic.
Parameters: values - the input array Parameters: begin - index of the first array element to include Parameters: length - the number of elements to include the standard deviation of the values or Double.NaN if length = 0 throws: IllegalArgumentException - if the array is null or the array indexparameters are not valid |
evaluate | public double evaluate(double[] values, double mean, int begin, int length)(Code) | | Returns the Standard Deviation of the entries in the specified portion of
the input array, using the precomputed mean value. Returns
Double.NaN if the designated subarray is empty.
Returns 0 for a single-value (i.e. length = 1) sample.
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.
Throws IllegalArgumentException if the array is null.
Does not change the internal state of the statistic.
Parameters: values - the input array Parameters: mean - the precomputed mean value Parameters: begin - index of the first array element to include Parameters: length - the number of elements to include the standard deviation of the values or Double.NaN if length = 0 throws: IllegalArgumentException - if the array is null or the array indexparameters are not valid |
evaluate | public double evaluate(double[] values, double mean)(Code) | | Returns the Standard Deviation of the entries in the input array, using
the precomputed mean value. Returns
Double.NaN if the designated subarray is empty.
Returns 0 for a single-value (i.e. length = 1) sample.
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.
Throws IllegalArgumentException if the array is null.
Does not change the internal state of the statistic.
Parameters: values - the input array Parameters: mean - the precomputed mean value the standard deviation of the values or Double.NaN if length = 0 throws: IllegalArgumentException - if the array is null |
isBiasCorrected | public boolean isBiasCorrected()(Code) | | Returns the isBiasCorrected. |
setBiasCorrected | public void setBiasCorrected(boolean isBiasCorrected)(Code) | | Parameters: isBiasCorrected - The isBiasCorrected to set. |
|
|