/// <summary> /// Shortfall. /// </summary> /// <param name="target"></param> /// <param name="mean"></param> /// <param name="std"></param> /// <returns></returns> public static double Shortfall(double target, double mean, double std) { var gIntegral = new CumulativeNormalDistribution(mean, std); return(gIntegral.Value(target)); }
/// <summary> /// Average shortfall. /// </summary> /// <param name="target"></param> /// <param name="mean"></param> /// <param name="std"></param> /// <returns></returns> public static double AverageShortfall(double target, double mean, double std) { var gIntegral = new CumulativeNormalDistribution(mean, std); var g = new NormalDistribution(mean, std); return((target - mean) * gIntegral.Value(target) + std * std * g.Value(target)); }