Пример #1
0
        public void When_Compute_Probabiliy_NormalLaw()
        {
            var normalLaw         = new NormalLaw();
            var firstProbability  = normalLaw.ComputeLowerCumulative(0, 1, 1.56); // <= 1.56
            var secondProbability = normalLaw.ComputeLowerCumulative(0, 1, 0.5);  // <= 0.5

            Assert.Equal(0.94064850654741039, firstProbability);
            Assert.Equal(0.691662613143159, secondProbability);
        }
Пример #2
0
        public IActionResult LowerNormalLaw([FromBody] GetNormalLawRequest request)
        {
            var normalLaw = new NormalLaw();
            var result    = normalLaw.ComputeLowerCumulative(request.Average, request.StandardDeviation, request.Value);

            return(new OkObjectResult(new ProbabilityResponse {
                Probability = result
            }));
        }