Exemple #1
0
        public static double VWithinMargin(double teamPerformanceDifference, double drawMargin)
        {
            double teamPerformanceDifferenceAbsoluteValue = Math.Abs(teamPerformanceDifference);
            double denominator =
                GaussianDistribution.CumulativeTo(drawMargin - teamPerformanceDifferenceAbsoluteValue) -
                GaussianDistribution.CumulativeTo(-drawMargin - teamPerformanceDifferenceAbsoluteValue);

            if (denominator < 2.222758749e-162)
            {
                if (teamPerformanceDifference < 0.0)
                {
                    return(-teamPerformanceDifference - drawMargin);
                }

                return(-teamPerformanceDifference + drawMargin);
            }

            double numerator = GaussianDistribution.At(-drawMargin - teamPerformanceDifferenceAbsoluteValue) -
                               GaussianDistribution.At(drawMargin - teamPerformanceDifferenceAbsoluteValue);

            if (teamPerformanceDifference < 0.0)
            {
                return(-numerator / denominator);
            }

            return(numerator / denominator);
        }
Exemple #2
0
        public static double VExceedsMargin(double teamPerformanceDifference, double drawMargin)
        {
            double denominator = GaussianDistribution.CumulativeTo(teamPerformanceDifference - drawMargin);

            if (denominator < 2.222758749e-162)
            {
                return(-teamPerformanceDifference + drawMargin);
            }

            return(GaussianDistribution.At(teamPerformanceDifference - drawMargin) / denominator);
        }
Exemple #3
0
        public static double WWithinMargin(double teamPerformanceDifference, double drawMargin)
        {
            double teamPerformanceDifferenceAbsoluteValue = Math.Abs(teamPerformanceDifference);
            double denominator = GaussianDistribution.CumulativeTo(drawMargin - teamPerformanceDifferenceAbsoluteValue) -
                                 GaussianDistribution.CumulativeTo(-drawMargin - teamPerformanceDifferenceAbsoluteValue);

            if (denominator < 2.222758749e-162)
            {
                return(1.0);
            }

            double vt = VWithinMargin(teamPerformanceDifferenceAbsoluteValue, drawMargin);

            return(vt * vt + ((drawMargin - teamPerformanceDifferenceAbsoluteValue) *
                              GaussianDistribution.At(drawMargin - teamPerformanceDifferenceAbsoluteValue) -
                              (-drawMargin - teamPerformanceDifferenceAbsoluteValue) *
                              GaussianDistribution.At(-drawMargin - teamPerformanceDifferenceAbsoluteValue)) / denominator);
        }