# 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.

### Support Copyright 2008-2023 Westclintech LLC         Privacy Policy        Terms of Service
{"ft_lang_label":"__label__en","ft_lang_prob":0.6780481,"math_prob":0.9811581,"size":1696,"snap":"2023-14-2023-23","text_gpt3_token_len":477,"char_repetition_ratio":0.13652483,"word_repetition_ratio":0.1632653,"special_character_ratio":0.26474056,"punctuation_ratio":0.16463415,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99872696,"pos_list":[0,1,2,3,4,5,6],"im_url_duplicate_count":[null,null,null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-05-29T19:40:14Z\",\"WARC-Record-ID\":\"<urn:uuid:d0b1a59e-f7a2-4f7c-a7e8-dd78d9e920c2>\",\"Content-Length\":\"658700\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:d585303e-900a-4e7c-8a42-dbd77128cf55>\",\"WARC-Concurrent-To\":\"<urn:uuid:02cc4469-b923-4348-8fe2-320120e5c858>\",\"WARC-IP-Address\":\"52.87.130.198\",\"WARC-Target-URI\":\"https://westclintech.com/SQL-Server-Statistics-Functions/SQL-Server-LOGNORM-DIST-function\",\"WARC-Payload-Digest\":\"sha1:GXFYBFF6EDUWEC4ERN6JNXIO42IKW5TD\",\"WARC-Block-Digest\":\"sha1:3LNNCI4HBQKNZ327GARZRVMEAFZ555JD\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-23/CC-MAIN-2023-23_segments_1685224644907.31_warc_CC-MAIN-20230529173312-20230529203312-00275.warc.gz\"}"}