Package dev.nm.stat.descriptive.moment
Class Kurtosis
- java.lang.Object
-
- dev.nm.stat.descriptive.moment.Kurtosis
-
- All Implemented Interfaces:
Statistic
public class Kurtosis extends Object implements Statistic
Kurtosis measures the "peakedness" of the probability distribution of a real-valued random variable. Higher kurtosis means that there are more infrequent extreme deviations than frequent modestly sized deviations, hence a fatter tail. This implementation computes the excess kurtosis. That is,γ = E[((X - E(X)) / σ)4]
This implementation uses Chan's update formula to incrementally compute the new statistic. The R equivalent function iskurtosis.- See Also:
- Wikipedia: Kurtosis
- Wikipedia: Algorithms for calculating variance
- "Tony F, Chan, Gene H, Golub, Randall J, LeVeque, "Updating Formulae and a Pairwise Algorithm for Computing Sample Variances," Technical Report STAN-CS-79-773, Department of Computer Science, Stanford University, 1979."
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddData(double... data)Recompute the statistic with more data, incrementally if possible.doublemean()Get the sample mean.longN()Get the size of the sample.doublesample()Get the sample kurtosis (biased estimator).StringtoString()doublevalue()Get the value of the statistic.doublevariance()Get the (unbiased) variance.
-
-
-
Constructor Detail
-
Kurtosis
public Kurtosis()
Construct an emptyKurtosiscalculator.
-
Kurtosis
public Kurtosis(double[] data)
Construct aKurtosiscalculator, initialized with a sample.- Parameters:
data- a sample
-
Kurtosis
public Kurtosis(Kurtosis that)
Copy constructor.- Parameters:
that- aKurtosiscalculator
-
-
Method Detail
-
sample
public double sample()
Get the sample kurtosis (biased estimator).- Returns:
- the sample kurtosis
-
addData
public void addData(double... data)
Description copied from interface:StatisticRecompute the statistic with more data, incrementally if possible.
-
value
public double value()
Description copied from interface:StatisticGet the value of the statistic.
-
mean
public double mean()
Get the sample mean.- Returns:
- the mean
-
variance
public double variance()
Get the (unbiased) variance.- Returns:
- the (unbiased) variance
-
N
public long N()
Description copied from interface:StatisticGet the size of the sample.
-
-