(x_i - xbar) ^ 4,
where the x_i are the sample observations and xbar is the sample mean.
The following recursive updating formula is used:
Let
SecondMoment ThirdMoment
new value = old value - 4 * (dev/n) * m3 + 6 * (dev/n)^2 * m2 +
[n^2 - 3 * (n-1)] * dev^4 * (n-1) / n^3
Returns Double.NaN if no data values have been added and
returns 0 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.
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 |
|---|---|
| private double | m4
fourth moment of values that have been added |
| private static final long | serialVersionUID
Hides org. |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv | FourthMoment(FourthMoment
the original)FourthMoment instance to copyCopy constructor, creates a new |
| m4 | back to summary |
|---|---|
| private double m4 fourth moment of values that have been added | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides org. Serializable version identifier | |
| FourthMoment | back to summary |
|---|---|
| pack-priv FourthMoment() Create a FourthMoment instance | |
| FourthMoment | back to summary |
|---|---|
| pack-priv FourthMoment(FourthMoment original) throws NullArgumentException Copy constructor, creates a new
| |
| clear | back to summary |
|---|---|
| public void clear() Overrides org. Implements org. Doc from org. Clears the internal state of the Statistic
| |
| copy | back to summary |
|---|---|
| public FourthMoment copy() Overrides 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(FourthMoment source, FourthMoment dest) throws NullArgumentException Copies source to dest. Neither source nor dest can be null.
| |
| getResult | back to summary |
|---|---|
| public double getResult() Overrides org. Implements org. Doc from org. Returns the current value of the Statistic.
| |
| increment | back to summary |
|---|---|
| public void increment(final double d) Overrides org. Implements org. Doc from org. Updates the internal state of the statistic to reflect the addition of the new value.
| |