NORMINV
Updated 2024-03-13 12:57:23.460000
Syntax
SELECT [westclintech].[wct].[NORMINV] (
<@Probability, float,>
,<@Mean, float,>
,<@Standard_dev, float,>)
Description
Use the scalar function NORMINV to calculate the inverse of the normal cumulative distribution function (cdf). The formula for cumulative distribution function is:
\Phi_{\mu,\sigma^2}(x) = \frac 1 {\sigma\sqrt{2\pi}} \int_{-\infty}^x e^{\frac{-(u-\mu)^2}{2\sigma^2}} \, du
Arguments
@Probability
is a probability corresponding to the normal distribution. @Probability is an expression of type float or of a type that can be implicitly converted to float.
@Mean
is the arithmetic mean of the distribution. @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 the distribution. @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, NORMINV returns an error.
If @Standard_dev = 0, NORMINV returns an error.
If @Mean = 0 and @Standard_dev = 1, NORMINV = NORMSINV(@Probability).
NORMINV uses root-finding algorithms and iteration to solve for NORMDIST(NORMINV(@Probability, @Mean, @Standard_dev), @Mean, @Standard_dev,'True') - @Probability = 0 to eight decimal places.
Examples
Select wct.NORMINV(0.00173238078965338, 10, 5);
This produces the following result.
{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"-4.61589999992911"}]}
Select Round(wct.NORMDIST(wct.NORMINV(0.00173238078965338, 10, 5), 10, 5, 'True')
- 0.00173238078965338, 9);
This produces the following result.
{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"0"}]}
See Also
NORMDIST - Normal distribution
NORMSDIST - standard normal distribution
NORMSINV - Inverse of the standard normal distribution
NORMAL - probability density function of the standard normal distribution
STANDARDIZE - normalized value from a distribution for a specified mean and standard deviation
ZTEST - one-tailed probability-value of a z-test (SQL Server 2008 and 2012 version)
ZTEST - one-tailed probability-value of a z-test (SQL Server 2008 and 2012 version)