Logo

GEOMETRICINV

Updated 2024-03-08 16:15:12.740000

Syntax

SELECT [westclintech].[wct].[GEOMETRICINV] (
  <@CDF, float,>
 ,<@P, float,>)

Description

Use the scalar function GEOMETRICINV to calculate the inverse of the cumulative distribution function of the geometric distribution.

The formula for the cumulative distribution function is:

Pr(k;p)=1-(1-p)^{{\lfloor{k}\rfloor}+1}

Arguments

@P

is the probability of success. @P is an expression of type float or of a type that implicitly converts to float.

@CDF

is the cumulative distribution function. @CDF is an expression of type float or of a type that implicitly converts to float.

Return Type

float

Remarks

@CDF must be greater than zero and less than or equal to one (0 < @CDF ≤ 1).

@P must be greater than zero and less than or equal to one (0 < @P = 1).

Examples

Calculate the cumulative distribution function:

SELECT wct.GEOMETRICP(3, 0.4);

This produces the following result.

{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"0.8704"}]}

Calculate the inverse:

SELECT wct.GEOMETRICINV(.8704, 0.4);

This produces the following result.

{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"3"}]}