public double skewness()
{
if (skewness_ == null) {
int N = samples();
if (!(N > 2)) throw new ApplicationException("sample number <=2, unsufficient");
double x = expectationValue(y => Math.Pow(y.Key * y.Value - mean(), 3), y => true).Key;
double sigma = standardDeviation();
skewness_ = (x / Math.Pow(sigma, 3)) * (N / (N - 1.0)) * (N / (N - 2.0));
}
return skewness_.GetValueOrDefault();
}