We use the following (unbiased) formula to define skewness:
skewness = [n / (n -1) (n - 2)] sum[(x_i - mean)^3] / std^3
where n is the number of values, mean is the Mean and std is the
StandardDeviation
Note that this statistic is undefined for n < 3. Double.Nan
is returned when there is not sufficient data to compute the statistic.
Double.NaN may also be returned if the input includes NaN and / or
infinite values.
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.
| Modifier and Type | Field and Description |
|---|---|
| protected boolean | incMoment
Determines whether or not this statistic can be incremented or cleared. |
| protected ThirdMoment | moment
Third moment on which this statistic is based |
| private static final long | serialVersionUID
Serializable version identifier |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | clear()
Implements abstract org. Implements org. Clears the internal state of the Statistic |
| public Skewness | copy()
Implements abstract org. Implements org. Returns a copy of the statistic with the same internal state. |
| public static void | |
| public double | Returns: the skewness of the values or Double.NaN if length is less than 3the input array values, final int the index of the first array element to include begin, final int the number of elements to include length)Overrides org. Implements org. Returns the Skewness of the entries in the specifed portion of the input array. |
| public long | getN()
Implements org. Returns the number of values that have been added. |
| public double | Returns: the skewness of the available values.Implements abstract org. Implements org. Returns the value of the statistic based on the values that have been added. |
| public void | increment(final double
the new value. d)Implements abstract org. Implements org. Updates the internal state of the statistic to reflect the addition of the new value. |
| incMoment | back to summary |
|---|---|
| protected boolean incMoment Determines whether or not this statistic can be incremented or cleared. Statistics based on (constructed from) external moments cannot be incremented or cleared. | |
| moment | back to summary |
|---|---|
| protected ThirdMoment moment Third moment on which this statistic is based | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Serializable version identifier | |
| Skewness | back to summary |
|---|---|
| public Skewness() Constructs a Skewness | |
| Skewness | back to summary |
|---|---|
| public Skewness(final ThirdMoment m3) Constructs a Skewness with an external moment
| |
| Skewness | back to summary |
|---|---|
| public Skewness(Skewness original) throws NullArgumentException Copy constructor, creates a new
| |
| clear | back to summary |
|---|---|
| public void clear() Implements abstract org. Implements org. Doc from org. Clears the internal state of the Statistic
| |
| copy | back to summary |
|---|---|
| public Skewness copy() Implements abstract org. Implements org. Doc from org. Returns a copy of the statistic with the same internal state.
| |
| copy | back to summary |
|---|---|
| public static void copy(Skewness source, Skewness dest) throws NullArgumentException Copies source to dest. Neither source nor dest can be null.
| |
| evaluate | back to summary |
|---|---|
| public double evaluate(final double[] values, final int begin, final int length) throws MathIllegalArgumentException Overrides org. Implements org. Returns the Skewness of the entries in the specifed portion of the input array.
See
Throws
| |
| getN | back to summary |
|---|---|
| public long getN() Implements org. Doc from org. Returns the number of values that have been added.
| |
| getResult | back to summary |
|---|---|
| public double getResult() Implements abstract org. Implements org. Returns the value of the statistic based on the values that have been added.
See
| |
| increment | back to summary |
|---|---|
| public void increment(final double d) Implements abstract org. Implements org. Doc from org. Updates the internal state of the statistic to reflect the addition of the new value. Note that when
| |