public void When_Compute_Beta_Function() { var betaFunction = new BetaFunction(); var result = betaFunction.Evaluate(1.5, 0.2); Assert.True(4.47 < result); }
public IActionResult ComputeBetaFunction([FromBody] GetBetaFunctionRequest request) { var beta = new BetaFunction(); var result = beta.Evaluate(request.A, request.B); return(new OkObjectResult(new FunctionResponse { Value = result })); }
public double ComputeLowerCumulative(double tStat, double degreeOfFreedom) { VariableEntity x = _variableName; VariableEntity v = _degreeOfFreedomName; var betaFunction = new BetaFunction(); var betaResult = betaFunction.Evaluate(0.5, degreeOfFreedom / 2); var firstEntity = MathEntity.Pow(Number.Create(1) + (MathEntity.Pow(x, Number.Create(2)) / v), Number.Create(-1) * ((v + Number.Create(1)) / Number.Create(2))); var secondEntity = MathEntity.Sqrt(v) * Number.Create(betaResult); var result = (firstEntity / secondEntity); result.Assign(v, (NumberEntity)Number.Create(degreeOfFreedom)); var simpsonEstimate = new SimpsonEstimate(); return(simpsonEstimate.Estimate(result, x, _n, _a, tStat)); }