UNIFORMINV
Updated 2024-03-13 14:29:27.973000
Syntax
SELECT [westclintech].[wct].[UNIFORMINV] (
<@P, float,>
,<@Min, float,>
,<@Max, float,>)
Description
Use the scalar function UNIFORMINV to calculate the inverse of the lower cumulative distribution of the uniform distribution.
The formula for the lower cumulative distribution function is:
F(x) = \begin{cases} 0 & \text{for } x < a, \\[8pt] \frac{x-a}{b-a} & \text{for } a \le x \le b, \\[8pt] 1 & \text{for } x > b. \end{cases}
Arguments
@P
is the value of the lower cumulative distribution function. @P is an expression of type float or of a type that implicitly converts to float.
@Max
is the maximum value of the distribution. @Max is an expression of type float or of a type that implicitly converts to float.
@Min
is the minimum value of the distribution. @Min is an expression of type float or of a type that implicitly converts to float.
Return Type
float
Remarks
@P must be greater than or equal to zero and less than or equal to one (0 <= @P <= 1).
@Max must be greater than or equal to @Min (@Max >= @Min).
Examples
Calculate the lower cumulative distribution function:
SELECT wct.UNIFORM(6, 1, 9, 'True');
This produces the following result.
{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"0.625"}]}
Calculate the inverse of the lower cumulative distribution function:
SELECT wct.UNIFORMINV(0.625, 1, 9);
This produces the following result.
{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"6"}]}