Login     Register

        Contact Us     Search

XLeratorDB/statistics Documentation

SQL Server LOGNORM.DIST function


LOGNORM_DIST

Updated: 31 July 2015

Use LOGNORM_DIST to calculate the probability density function or the cumulative distributive function of the normal distribution of x, when ln(x) is normally distributed with parameters µ and d.
Syntax
SELECT [wct].[LOGNORM_DIST](
  <@X, float,>
 ,<@Mean, float,>
 ,<@Standard_dev, float,>
 ,<@Cumulative, bit,>)
Arguments
@X
the value of interest. @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.
@Cumulative
a bit value identifying whether the probability density function ('False') or the cumulative distribution function ('True') is to be returned. @Cumulative is of a type bit or a type that implicitly converts to bit.
Return Type
float
Remarks
·         0 < @X
·         0 < @Standard_dev
Examples
Calculate the lognormal distribution with x = 4 and the mean of ln(x) = 3.5 and the standard deviation of ln(x) = 1.2
SELECT
       wct.LOGNORM_DIST(
               4            --@X
              ,3.5          --@Mean
              ,1.2          --@Standard_dev
              ,'False'      --@Cumulative
              ) as pdf
 
This produces the following result
 


In this example we calculate the cumulative distribution function.
SELECT
       wct.LOGNORM_DIST(
               4            --@X
              ,3.5          --@Mean
              ,1.2          --@Standard_dev
              ,'True'       --@Cumulative
              ) as cdf

This produces the following result.


The lognormal distribution is related to the standard normal distribution.
SELECT
        wct.LOGNORM_DIST(x,mu,sigma,'True') as cdf
       ,wct.NORM_S_DIST((log(x)-mu)/sigma,'True') as cdf
FROM (VALUES(4,3.5,1.2))n(x,mu,sigma)

This produces the following result.

 

See Also

 



Copyright 2008-2024 Westclintech LLC         Privacy Policy        Terms of Service