class CornishFisherDeltaGammaVaRCalculator implements VaRCalculator<NormalVaRParameters, T> {

  @SuppressWarnings("unchecked")
  @Override
  public VaRCalculationResult evaluate(final NormalVaRParameters parameters, final T... data) {
    ArgumentChecker.notNull(parameters, "parameters");
    ArgumentChecker.notNull(data, "data");
    final double z = parameters.getZ();
    final double mult = parameters.getTimeScaling();
    final double zSq = z * z;
    final double mean = _meanCalculator.evaluate(data);
    final double std = _stdCalculator.evaluate(data);
    final double skew = _skewCalculator.evaluate(data);
    final double kurtosis = _kurtosisCalculator.evaluate(data);
    final double x = z + skew * (zSq - 1) / 6. + kurtosis * z * (zSq - 3) / 24. - skew * skew * z * (2 * zSq - 5) / 36.;
    final double value = x * std * mult + mean * mult * mult;
    // REVIEW kirk 2012-06-22 -- Can we use "std" as the standard deviation?
    return new VaRCalculationResult(value, null);
  }

  public  CornishFisherDeltaGammaVaRCalculator(final Function<T, Double> meanCalculator, final Function<T, Double> stdCalculator,
      final Function<T, Double> skewCalculator, final Function<T, Double> kurtosisCalculator);

}