public class Median extends AbstractUnivariateStatistic implements Serializable
Percentile
for a description of the algorithm used.
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.
Constructor and Description |
---|
Median()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
Median |
copy()
Returns a copy of the statistic with the same internal state.
|
double |
evaluate(double[] values,
int begin,
int length)
Returns the result of evaluating the statistic over the specified entries
in the input array.
|
Percentile.EstimationType |
getEstimationType()
Get the estimation
type used for computation. |
KthSelector |
getKthSelector()
Get the
kthSelector used for computation. |
NaNStrategy |
getNaNStrategy()
Get the
NaN Handling strategy used for computation. |
Median |
withEstimationType(Percentile.EstimationType newEstimationType)
Build a new instance similar to the current one except for the
estimation type . |
Median |
withKthSelector(KthSelector newKthSelector)
Build a new instance similar to the current one except for the
kthSelector instance specifically set. |
Median |
withNaNStrategy(NaNStrategy newNaNStrategy)
Build a new instance similar to the current one except for the
NaN handling strategy. |
evaluate, getData, getDataRef, setData, setData
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
evaluate
public double evaluate(double[] values, int begin, int length) throws MathIllegalArgumentException
evaluate
in interface UnivariateStatistic
evaluate
in interface MathArrays.Function
evaluate
in class AbstractUnivariateStatistic
values
- the input arraybegin
- the index of the first element to includelength
- the number of elements to includeMathIllegalArgumentException
- if values is null or the indices are invalidpublic Median copy()
copy
in interface UnivariateStatistic
copy
in class AbstractUnivariateStatistic
public Percentile.EstimationType getEstimationType()
type
used for computation.estimationType
setpublic Median withEstimationType(Percentile.EstimationType newEstimationType)
estimation type
.newEstimationType
- estimation type for the new instanceNullArgumentException
- when newEstimationType is nullpublic NaNStrategy getNaNStrategy()
NaN Handling
strategy used for computation.NaN Handling
strategy set during constructionpublic Median withNaNStrategy(NaNStrategy newNaNStrategy)
NaN handling
strategy.newNaNStrategy
- NaN strategy for the new instanceNullArgumentException
- when newNaNStrategy is nullpublic KthSelector getKthSelector()
kthSelector
used for computation.kthSelector
setpublic Median withKthSelector(KthSelector newKthSelector)
kthSelector
instance specifically set.newKthSelector
- KthSelector for the new instanceNullArgumentException
- when newKthSelector is nullCopyright © 2016–2020 Hipparchus.org. All rights reserved.