SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.descriptive.moment
Class Skewness

java.lang.Object
  extended by com.numericalmethod.suanshu.stats.descriptive.moment.Skewness
All Implemented Interfaces:
Statistic

public class Skewness
extends java.lang.Object
implements Statistic

Skewness is a measure of the asymmetry of the probability distribution.

A distribution may either be positively skewed or negatively skewed.

For positive skew (or right-skewed), the right tail is longer. The mass of the distribution is concentrated on the left.

For negative skew (or left-skewed), the left tail is longer. The mass of the distribution is concentrated on the right.

 γ = E[((X - E(X)) / σ)3]
 

This implementation uses Chan's update formula to incrementally compute the new statistic.

The R equivalent function is skewness.

See Also:

Constructor Summary
Skewness()
          Construct an empty Skewness calculator.
Skewness(double[] data)
          Construct a Skewness calculator, initialized with a sample.
Skewness(Skewness that)
          Copy constructor.
 
Method Summary
 void addData(double... data)
          Recompute the statistic, incrementally if possible.
 long N()
          Get the size of the sample.
 double sample()
          Get the sample skewness (biased estimator).
 java.lang.String toString()
           
 double value()
          Get the value of the statistic.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Skewness

public Skewness()
Construct an empty Skewness calculator.


Skewness

public Skewness(double[] data)
Construct a Skewness calculator, initialized with a sample.

Parameters:
data - a sample

Skewness

public Skewness(Skewness that)
Copy constructor.

Parameters:
that - another Skewness object
Method Detail

addData

public void addData(double... data)
Description copied from interface: Statistic
Recompute the statistic, 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

sample

public double sample()
Get the sample skewness (biased estimator).

Returns:
the sample skewness

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 java.lang.String toString()
Overrides:
toString in class java.lang.Object

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.