Made it clear that NaNs or infinities may yield NaN in moment computations. JIRA: MATH-1146.
This commit is contained in:
parent
d9b951c1fa
commit
26e6114583
|
@ -36,7 +36,9 @@ import org.apache.commons.math3.util.MathUtils;
|
|||
* {@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.</p>
|
||||
* is returned when there is not sufficient data to compute the statistic.
|
||||
* Note that Double.NaN may also be returned if the input includes NaN
|
||||
* and / or infinite values.</p>
|
||||
* <p>
|
||||
* <strong>Note that this implementation is not synchronized.</strong> If
|
||||
* multiple threads access an instance of this class concurrently, and at least
|
||||
|
|
|
@ -50,7 +50,9 @@ import org.apache.commons.math3.util.MathUtils;
|
|||
* Sample Means and Variances," Robert F. Ling, Journal of the American
|
||||
* Statistical Association, Vol. 69, No. 348 (Dec., 1974), pp. 859-866. </p>
|
||||
* <p>
|
||||
* Returns <code>Double.NaN</code> if the dataset is empty.
|
||||
* Returns <code>Double.NaN</code> if the dataset is empty. Note that
|
||||
* Double.NaN may also be returned if the input includes NaN and / or infinite
|
||||
* values.
|
||||
* </p>
|
||||
* <strong>Note that this implementation is not synchronized.</strong> If
|
||||
* multiple threads access an instance of this class concurrently, and at least
|
||||
|
|
|
@ -38,7 +38,9 @@ import org.apache.commons.math3.util.MathUtils;
|
|||
* 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.</p>
|
||||
* returns <code>0</code> if there is just one value in the data set.
|
||||
* Note that Double.NaN may also be returned if the input includes NaN
|
||||
* and / or infinite values.</p>
|
||||
* <p>
|
||||
* <strong>Note that this implementation is not synchronized.</strong> If
|
||||
* multiple threads access an instance of this class concurrently, and at least
|
||||
|
|
|
@ -234,7 +234,8 @@ public class Variance extends AbstractStorelessUnivariateStatistic implements Se
|
|||
/**
|
||||
* Returns the variance of the entries in the specified portion of
|
||||
* the input array, or <code>Double.NaN</code> if the designated subarray
|
||||
* is empty.
|
||||
* is empty. Note that Double.NaN may also be returned if the input
|
||||
* includes NaN and / or infinite values.
|
||||
* <p>
|
||||
* See {@link Variance} for details on the computing algorithm.</p>
|
||||
* <p>
|
||||
|
|
Loading…
Reference in New Issue