LOGINV
Updated 2023-11-03 20:59:30.887000
Syntax
SELECT [westclintech].[wct].[LOGINV] (
<@Probability, float,>
,<@Mean, float,>
,<@Standard_dev, float,>)
Description
Use the scalar function LOGINV to calculate the inverse of the lognormal cumulative distribution function of x where ln(x) is normally distributed within the parameters mean and standard deviation.
Arguments
@Probability
is a probability associated with the lognormal distribution. @Probability is an expression of type float or of a type that can be implicitly converted to float.
@Mean
is the mean of ln(x). @Mean is an expression of type float or of a type that can be implicitly converted to float.
@Standard_dev
is the standard deviation of ln(x). @Standard_dev is an expression of type float or of a type that can be implicitly converted to float.
Return Type
float
Remarks
If @Probability < 0 or @Probability > 1, LOGINV returns an error
If @Standard_dev = 0, LOGINV returns an error
LOGNORMDIST(LOGINV(@Probability, @Mean, @Standard_dev), @Mean, @Standard_dev) - @Probability = 0 rounded to 8 decimal places.
Examples
select wct.LOGINV(0.025765031270143, 5, 1.5);
This produces the following result.
{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"8"}]}
Select round(wct.LOGNORMDIST(wct.LOGINV(0.025765031270143, 5, 1.5), 5, 1.5) -
0.025765031270143, 9);
This produces the following result.
{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"0"}]}
Select EXP(5 + 1.5 * wct.NORMSINV(0.025765031270143));
This produces the following result.
{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"8"}]}