示例#1
0
        private static double PValue(double tStatistic, int n, int k)
        {
            int degreeOfFreedom = n - k - 1;
            var studentLaw      = new StudentLaw();

            return(studentLaw.ComputeUpperCumulative(tStatistic, degreeOfFreedom) * 2);
        }
        public void When_Compute_Upper_Cumulative()
        {
            var studentLaw = new StudentLaw();
            var result     = studentLaw.ComputeUpperCumulative(2.29, 99);

            Assert.Equal(0.012133616433972372, result);
        }
示例#3
0
        public IActionResult UpperStudentLaw([FromBody] GetStudentLawRequest request)
        {
            var studentLaw = new StudentLaw();
            var result     = studentLaw.ComputeUpperCumulative(request.TStat, request.DegreeOfFreedom);

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