Login     Register

        Contact Us     Search

XLeratorDB/statistics Documentation

SQL Server LOGINV function


 
Updated: 9 August 2010

Use 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.
 
Syntax
SELECT [wctStatistics].[wct].[LOGINV] (
   <@Probability, float,>
 ,<@Mean, float,>
 ,<@Standard_dev, float,>)
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 Types
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
----------------------
7.9999999741917
 
(1 row(s) affected))
 

Select
round(wct.LOGNORMDIST(wct.LOGINV(0.025765031270143, 5, 1.5),5,1.5)-0.025765031270143, 9)

This produces the following result
 
----------------------
0
 
(1 row(s) affected)
 

Select
EXP(5+1.5*wct.NORMSINV(0.025765031270143))

This produces the following result
 
----------------------
7.9999999741917
 
(1 row(s) affected)


Copyright 2008-2017 Westclintech LLC         Privacy Policy        Terms of Service