BETAI
Updated 2024-03-07 19:47:07.150000
Syntax
SELECT [westclintech].[wct].[BETAI] (
<@A, float,>
,<@B, float,>
,<@X, float,>)
Description
Use the scalar function BETAI to calculate the incomplete beta function. The incomplete beta function is defined by:
I_x(a,b)=\frac{\text{B}_x(a,b)}{\text{B}(a,b)}=\frac{1}{\text{B}(a,b)}\int_0^xt^{a-1}(1-t)^{b-1}dt
Arguments
@A
is any real number greater than or equal to zero. @A is an expression of type float or of a type that can be implicitly converted to float. @A is the lower bound to the distribution. If you enter NULL, @A defaults to zero
@B
is any real number greater than or equal to zero. @B is an expression of type float or of a type that can be implicitly converted to float. @B is the upper bound to the distribution. If you enter NULL @B defaults to to zero.
@X
is any real number greater than or equal to zero and less than or equal to one. @X is an expression of type float or of a type that can be implicitly converted to float.
Return Type
float
Remarks
If @A = 0 or @B = 0, BETAI returns an error.
If @X < 0 or @X > 1, BETAI returns an error.
@X = 0 or @X = 1, BETAI = @X.
BETAI(@A, @B, @X) = BETADIST(@X, @A, @B, 0, 1).
Examples
select wct.BETAI(1, 5, .45);
This produces the following result.
{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"0.9496715625"}]}
select wct.BETADIST(.45, 1, 5, 0, 1);
This produces the following result
{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"0.9496715625"}]}