LOGNORM_INV
Updated 2023-11-03 21:06:39.667000
Syntax
SELECT [westclintech].[wct].[LOGNORM_INV](
<@P, float,>
,<@Mean, float,>
,<@Standard_dev, float,>)
Description
Use the scalar function LOGNORM_INV to calculate the inverse of the lognormal distribution function of x, when ln(x) is normally distributed with parameters µ and d.
Arguments
@P
the probability associated with the lognormal distribution. @X must be of a type float or of type that intrinsically converts to float.
@Mean
the average of ln(x). @Mean must be of a type float or of type that intrinsically converts to float.
@Standard_dev
the standard deviation of ln(x). @Standard_dev must be of a type float or of type that intrinsically converts to float.
Return Type
float
Remarks
0 <= @P < 1.
If @P = 0 then 0 is returned.
0 < @Standard_dev.
Examples
Calculate ln(x) with probability = 0.95 with mean of ln(x) = 3.5 and standard deviation of ln(x) = 1.2
SELECT wct.LOGNORM_INV( 0.95, --@P
3.5, --@Mean
1.2 --@Standard_dev
) as LOGNORM_INV;
This produces the following result.
{"columns":[{"field":"LOGNORM_INV","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"LOGNORM_INV":"238.370062928527"}]}
The lognormal distribution is related to the normal distribution.
SELECT wct.LOGNORM_INV(p, mu, sigma) as lognorminv,
EXP(wct.NORMINV(p, mu, sigma)) as expnorminv
FROM
(
VALUES
(0.95, 5, 0.75)
) n (p, mu, sigma);
This produces the following result.
{"columns":[{"field":"lognorminv","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"expnorminv","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"lognorminv":"509.607193541771","expnorminv":"509.607193541771"}]}
See Also
LOGNORM_DIST - Lognormal distribution