예제 #1
0
        /// <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));
        }
예제 #2
0
        /// <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));
        }