# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.descriptive.moment

## Class Kurtosis

• java.lang.Object
• com.numericalmethod.suanshu.stats.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 is kurtosis.

• ### Constructor Summary

Constructors
Constructor and Description
Kurtosis()
Construct an empty Kurtosis calculator.
Kurtosis(double[] data)
Construct a Kurtosis calculator, initialized with a sample.
Kurtosis(Kurtosis that)
Copy constructor.
• ### Method Summary

All Methods
Modifier and Type Method and Description
void addData(double... data)
Recompute the statistic with more data, incrementally if possible.
double mean()
Get the sample mean.
long N()
Get the size of the sample.
double sample()
Get the sample kurtosis (biased estimator).
String toString()
double value()
Get the value of the statistic.
double variance()
Get the (unbiased) variance.
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
• ### Constructor Detail

• #### Kurtosis

public Kurtosis()
Construct an empty Kurtosis calculator.
• #### Kurtosis

public Kurtosis(double[] data)
Construct a Kurtosis calculator, initialized with a sample.
Parameters:
data - a sample
• #### Kurtosis

public Kurtosis(Kurtosis that)
Copy constructor.
Parameters:
that - a Kurtosis calculator
• ### Method Detail

• #### sample

public double sample()
Get the sample kurtosis (biased estimator).
Returns:
the sample kurtosis

public void addData(double... data)
Description copied from interface: Statistic
Recompute the statistic with more data, incrementally if possible.
Specified by:
addData in interface Statistic
Parameters:
data - an array of new items
• #### value

public double value()
Description copied from interface: Statistic
Get the value of the statistic.
Specified by:
value in interface Statistic
Returns:
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: Statistic
Get the size of the sample.
Specified by:
N in interface Statistic
Returns:
the sample size
• #### toString

public String toString()
Overrides:
toString in class Object