if (percentile >= 1.0 || percentile < 0.9)
throw new IllegalArgumentException("percentile (" + percentile + ") out of range [0.9, 1)");
final double m = statistics.mean();
final double std = statistics.standardDeviation();
final InverseCumulativeNormal gInverse = new InverseCumulativeNormal(m, std);
final double var = gInverse.op(1.0 - percentile);
final NormalDistribution g = new NormalDistribution(m, std);
final double result = m - std * std * g.op(var) / (1.0 - percentile);
// expectedShortfall must be a loss
// this means that it has to be MIN(result, 0.0)
// expectedShortfall must also be a positive quantity, so -MIN(*)