({{, (RefLink[LogNormalDistribution, paclet:ref/LogNormalDistribution])[μ,σ] 
represents a lognormal distribution derived from a normal distribution with mean μ and standard deviation σ.}})

OpenersNotesSection(Spacer1)Details

(RefLink[LogNormalDistribution, paclet:ref/LogNormalDistribution]) is also known as the Galton distribution.

(RefLink[LogNormalDistribution, paclet:ref/LogNormalDistribution])[0,1] is also known as Gibrat distribution.

The lognormal distribution (RefLink[LogNormalDistribution, paclet:ref/LogNormalDistribution])[μ,σ] is equivalent to (RefLink[TransformedDistribution, paclet:ref/TransformedDistribution])[(RefLink[Exp, paclet:ref/Exp])[x],x\[Distributed](RefLink[NormalDistribution, paclet:ref/NormalDistribution])[μ,σ]].

(RefLink[LogNormalDistribution, paclet:ref/LogNormalDistribution]) allows μ to be any real number and σ to be any positive real number.

(RefLink[LogNormalDistribution, paclet:ref/LogNormalDistribution]) allows μ and σ to be dimensionless quantities.

(RefLink[LogNormalDistribution, paclet:ref/LogNormalDistribution]) can be used with such functions as (RefLink[Mean, paclet:ref/Mean]), (RefLink[CDF, paclet:ref/CDF]), and (RefLink[RandomVariate, paclet:ref/RandomVariate]). »

OpenersPrimaryExamplesSection(Spacer1)Examples  (28)

OpenersExampleSection0(Spacer1)Basic Examples  (4)

Probability density function:

Plot[Table[PDF[LogNormalDistribution[μ,2],x],{μ,{-1,2,3}}]//Evaluate,{x,0,4},Filling->Axis,PlotRange->{0,0.4}]

Plot[Table[PDF[LogNormalDistribution[1,σ],x],{σ,{0.5,0.75,1.5}}]//Evaluate,{x,0,4},Filling->Axis]

PDF[LogNormalDistribution[μ,σ],x]

Cumulative distribution function:

Plot[Table[CDF[LogNormalDistribution[μ,2],x],{μ,{-1,2,3}}]//Evaluate,{x,0,4},Filling->Axis,PlotRange->{0,1}]

Plot[Table[CDF[LogNormalDistribution[1,σ],x],{σ,{0.5,0.75,1.5}}]//Evaluate,{x,0,4},Filling->Axis,PlotRange->{0,1}]

CDF[LogNormalDistribution[μ,σ],x]

Mean and variance:

Mean[LogNormalDistribution[μ,σ]]

Variance[LogNormalDistribution[μ,σ]]

Median:

Median[LogNormalDistribution[μ,σ]]

OpenersExampleSection1(Spacer1)Scope  (7)

Generate a sample of pseudorandom numbers from a log-normal distribution:

data=RandomVariate[LogNormalDistribution[2,.3],10^4];

Compare the histogram to the PDF:

Show[Histogram[data,{0,15,0.5},"PDF"],Plot[PDF[LogNormalDistribution[2,.3],x],{x,0,15},PlotStyle->Thick]]

Distribution parameters estimation:

sample=RandomVariate[LogNormalDistribution[1,1/2],10^3];

Estimate the distribution parameters from sample data:

edist=EstimatedDistribution[sample, LogNormalDistribution[μ,σ]]

Compare the density histogram of the sample with the PDF of the estimated distribution:

Show[Histogram[sample,Automatic,"PDF"],Plot[PDF[edist,x],{x,0,10},PlotStyle->Thick]]

Skewness grows exponentially with standard deviation σ:

Plot[Skewness[LogNormalDistribution[μ,σ]],{σ,0,2}]

Skewness[LogNormalDistribution[μ,σ]]

Limiting values:

Limit[Skewness[LogNormalDistribution[μ,σ]],σ->0]

Limit[Skewness[LogNormalDistribution[μ,σ]],σ->∞]

Kurtosis grows exponentially with standard deviation σ:

Plot[Kurtosis[LogNormalDistribution[μ,σ]],{σ,0,1}]

Kurtosis[LogNormalDistribution[μ,σ]]

Limiting values:

Limit[Kurtosis[LogNormalDistribution[μ,σ]],σ->0]

Limit[Kurtosis[LogNormalDistribution[μ,σ]],σ->∞]

Different moments with closed forms as functions of parameters:

FormulaGrid[list_,type_]:=Grid[Transpose[{list}],Alignment->{Left,Automatic},Background->{None,{{Lighter[Blend[Switch[type,M,{Blue,Green},CM,{Red,Orange},FM,{Magenta,Cyan},C,{Purple,Red}]],.8],White}}},Dividers->{None,{Darker[Gray,.6],{False},Darker[Gray,.6]}},ItemSize->30]

(RefLink[Moment, paclet:ref/Moment]):

FormulaGrid[Table[Moment[LogNormalDistribution[μ,σ],k]//Factor,{k,5}],M]

Closed form for symbolic order:

Moment[LogNormalDistribution[μ,σ],r]

(RefLink[CentralMoment, paclet:ref/CentralMoment]):

FormulaGrid[Table[CentralMoment[LogNormalDistribution[μ,σ],k]//Factor,{k,5}],CM]

(RefLink[FactorialMoment, paclet:ref/FactorialMoment]):

FormulaGrid[Table[FactorialMoment[LogNormalDistribution[μ,σ],k]//Factor,{k,5}],FM]

(RefLink[Cumulant, paclet:ref/Cumulant]):

FormulaGrid[Table[Cumulant[LogNormalDistribution[μ,σ],k]//Factor,{k,5}],C]

Hazard function:

Plot[Table[HazardFunction[LogNormalDistribution[μ,1.5],x],{μ,{-1,0,1}}]//Evaluate,{x,0,0.7},Filling->Axis]

Plot[Table[HazardFunction[LogNormalDistribution[1,σ],x],{σ,{0.5,0.6,0.8}}]//Evaluate,{x,0,4},Filling->Axis]

HazardFunction[LogNormalDistribution[μ,σ],x]

Quantile function:

Plot[Table[Quantile[LogNormalDistribution[2,σ],q],{σ,{0.5,1,2}}]//Evaluate,{q,0,1},Filling->Axis]

Plot[Table[Quantile[LogNormalDistribution[μ,2],q],{μ,{1,3,5}}]//Evaluate,{q,0,1},Filling->Axis]

Quantile[LogNormalDistribution[μ,σ],q]

OpenersExampleSection2(Spacer1)Applications  (4)

Lognormal distribution can be used to model stock prices:

googleStock=FinancialData["GOOGL",{{2006,3,10},{2010,3,15},"Day"},"Value"]

Fit the distribution to the data:

edist=EstimatedDistribution[googleStock,LogNormalDistribution[μ,σ]]

Compare the histogram to the PDF:

Show[Histogram[googleStock,20,"PDF",AxesLabel->Automatic],Plot[PDF[edist,(QuantityPrefix[x, "$" , US dollars, "USDollars"])],{x,0,750},PlotStyle->Thick]]

Find the probability that the price is above $500:

Probability[x>Quantity[500,"$"],x\[Distributed]edist]

Find the mean price:

Mean[edist]

Simulate the price for the consecutive 30 days:

ListPlot[RandomVariate[edist,30],Joined->True,AxesLabel->Automatic]

Lognormal distribution can be used to approximate wind speeds:

wind=WeatherData["Chicago", "WindSpeed", 
{{2006, 1, 1}, {2009, 12,31}, "Day"}];

Find the estimated distribution:

windEstimate=EstimatedDistribution[wind,LogNormalDistribution[μ,σ]]

Compare the PDF to the histogram of the wind data:

Show[Histogram[wind["Values"],Automatic,"PDF",AxesLabel->Automatic],Plot[PDF[windEstimate,Quantity[x,"kmph"]],{x,0,50},PlotStyle->Thick]]

Find the probability of a day with wind speed greater than 30 km/h:

NProbability[x>Quantity[30,"kmph"],x\[Distributed]windEstimate]

Find the mean wind speed:

Mean[windEstimate]

Simulate wind speeds for a month:

ListPlot[{RandomVariate[windEstimate,30],{{0,Mean[windEstimate]},{30,Mean[windEstimate]}}},Joined->{False,True},Filling->Axis,AxesOrigin->{0,0},AxesLabel->Automatic]

The fractional change of stock price (Subscript[S, t])/(Subscript[S, 0]) at time t (in years) is assumed to be lognormally distributed with parameters μ t and σ (Sqrt[t]):

f𝒟[μ_,σ_,t_]=LogNormalDistribution[μ t,σ (Sqrt[t])];

Compute expected stock price at epoch t:

PriceAtEpoch[S0_,μ_,σ_,t_]=S0 Mean[f𝒟[μ,σ,t]]

Assuming an investor can invest money for a year at a continuously compounded yearly rate r risk-free, the risk-neutral pricing condition requires:

PriceAtEpoch[(Subscript[S, 0]),μ,σ,t+1]==PriceAtEpoch[(Subscript[S, 0]),μ,σ,t] Exp[r]

Solve for parameter μ:

{sol}=Solve[ForAll[{t,(Subscript[S, 0])},%],μ,Reals]

Consider an option to buy this stock a year from now, at a fixed price 𝒦. The value of such an option is:

optVal[s_,𝒦_]=Max[s-𝒦,0];

The risk-neutral price of the option is determined as the present value of the expected option value:

BlackScholesOptionPrice=Assuming[(Subscript[S, 0])>0&&r>0&&σ>0&&t>0&&𝒦>0,Exp[-r t]Expectation[optVal[𝒻 (Subscript[S, 0]),𝒦],𝒻\[Distributed]f𝒟[μ/.sol,σ,t]]//FullSimplify]

Assuming rate r of 5%, volatility parameter σ of 0.087, an initial price of $200 per share of stock, and a strike price of $190 per share, the Black–Scholes option price is:

BlackScholesOptionPrice/.{r->0.05,σ->0.087,t->1,(Subscript[S, 0])->200,𝒦->190}

(RefLink[GammaDistribution, paclet:ref/GammaDistribution]) data can be approximated by a lognormal distribution:

sample=RandomVariate[GammaDistribution[4,.5],10^4];

edist1=EstimatedDistribution[sample,LogNormalDistribution[μ,σ]]

Show[Histogram[sample,20,"PDF"],Plot[PDF[edist1,x],{x,0,6},PlotStyle->Thick]]

Comparing log-likelihoods with estimation by gamma distribution:

edist2=EstimatedDistribution[sample,GammaDistribution[α,β]]

{LogLikelihood[edist1,sample],LogLikelihood[edist2,sample]}

OpenersExampleSection3(Spacer1)Properties & Relations  (9)

Lognormal distribution is closed under scaling by a positive factor:

TransformedDistribution[c u,u\[Distributed]LogNormalDistribution[μ,σ]]

Power of a (RefLink[LogNormalDistribution, paclet:ref/LogNormalDistribution]) follows a lognormal distribution:

TransformedDistribution[u^k,u\[Distributed]LogNormalDistribution[μ,σ]]

In particular, a reciprocal of a lognormal distribution follows a lognormal distribution:

TransformedDistribution[1/u,u\[Distributed]LogNormalDistribution[μ,ν]]

The product of two independent lognormally distributed variates follows lognormal distribution:

TransformedDistribution[u v,{u\[Distributed] LogNormalDistribution[μ1,σ1],v\[Distributed]LogNormalDistribution[μ2,σ2]}]

Quotient of two independent lognormally distributed variates follows lognormal distribution:

TransformedDistribution[u/v, {u\[Distributed]LogNormalDistribution[μ1,σ1],v\[Distributed]LogNormalDistribution[μ2,σ2]}]

Geometric mean of independent identically lognormally distributed variates follows lognormal distribution:

𝒟=TransformedDistribution[(u v w)^(1/3),{u,v,w}\[Distributed]ProductDistribution[{LogNormalDistribution[μ,σ (Sqrt[3])],3}]];

Block[{μ=0.5,σ=0.3},Show[Histogram[RandomVariate[𝒟,10^4],20,"PDF"],Plot[PDF[LogNormalDistribution[μ,σ],x],{x,0,4},PlotStyle->Thick]]]

Relationships to other distributions:

(RefLink[NormalDistribution, paclet:ref/NormalDistribution]) is exponentially related to (RefLink[LogNormalDistribution, paclet:ref/LogNormalDistribution]):

TransformedDistribution[Log[u],u\[Distributed]LogNormalDistribution[μ,σ]]

Reverse transformation:

TransformedDistribution[Exp[u],u\[Distributed]NormalDistribution[μ,σ]]

Lognormal distribution is a special case of SL (RefLink[JohnsonDistribution, paclet:ref/JohnsonDistribution]):

PDF[LogNormalDistribution[-γ/δ,1/δ],x]

PDF[JohnsonDistribution["SL",γ,δ,0,1],x]

%-%%//FullSimplify[#,δ>0&&x>0]&

(RefLink[SuzukiDistribution, paclet:ref/SuzukiDistribution]) can be obtained from lognormal distribution and (RefLink[RayleighDistribution, paclet:ref/RayleighDistribution]):

𝒟=TransformedDistribution[u v,{u\[Distributed]RayleighDistribution[1],v\[Distributed]LogNormalDistribution[μ,ν]}];

Block[{μ=-1,ν=.2},Show[Histogram[RandomVariate[𝒟,10^4],20,"PDF"],Plot[PDF[SuzukiDistribution[μ,ν],x],{x,0,2},PlotStyle->Thick]]]

OpenersExampleSection4(Spacer1)Possible Issues  (2)

(RefLink[LogNormalDistribution, paclet:ref/LogNormalDistribution]) is not defined when μ is not a real number:

Mean[LogNormalDistribution[3+I,6]]

(RefLink[LogNormalDistribution, paclet:ref/LogNormalDistribution]) is not defined when σ is not a positive real number:

Mean[LogNormalDistribution[3,-6]]

Substitution of invalid parameters into symbolic outputs gives results that are not meaningful:

Mean[LogNormalDistribution[μ,σ]]/.{μ->I,σ->-1}

OpenersExampleSection5(Spacer1)Neat Examples  (2)

(RefLink[LogNormalDistribution, paclet:ref/LogNormalDistribution]) is not uniquely determined by its sequence of moments:

log𝒩[μ_,σ_,k_,ϵ_]=ProbabilityDistribution[Refine[PDF[LogNormalDistribution[μ,σ],x],x>0](1+ϵ Sin[2 π k(Log[x]-μ)/(σ^2)]),{x,0,∞},Assumptions->σ>0&&k>0&&μ∈Reals&&0<ϵ<1]

Compute the sequence of moments:

Assuming[r≥0&&r∈Integers,Expectation[x^r,x\[Distributed]log𝒩[μ,σ,1,1/2]]//FullSimplify]

Compare it to the sequence of moments of the (RefLink[LogNormalDistribution, paclet:ref/LogNormalDistribution]):

%==Moment[LogNormalDistribution[μ,σ],r]

Plot distribution densities:

Plot[{PDF[LogNormalDistribution[0,1],r],PDF[log𝒩[0,1,1,1/2],r]}//Evaluate,{r,0,5},Filling->{1->{2}}]

PDFs for different σ values with CDF contours:

cdf=Function[{x,σ},Evaluate[CDF[LogNormalDistribution[1,σ],x]]];
ql={0.025,0.10,0.25,0.5,0.75,0.90,0.975};
cl=Table[ColorData["Rainbow"][q],{q,Join[{0.0},ql]}];

Legended[Plot3D[PDF[LogNormalDistribution[1,σ],x],{x,0,10},{σ,0.5,1.5},PlotTheme->"Marketing",MeshFunctions->{cdf},Mesh->{ql},MeshStyle->GrayLevel[0.8],MeshShading->cl,AxesLabel->Automatic,PlotPoints->80,BaseStyle->Opacity[0.9],ImageSize->400],BarLegend["Rainbow",ql,LegendLabel->"prob"]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[NormalDistribution, paclet:ref/NormalDistribution])  ▪  (RefLink[JohnsonDistribution, paclet:ref/JohnsonDistribution])  ▪  (RefLink[Erf, paclet:ref/Erf])  ▪  (RefLink[InverseErf, paclet:ref/InverseErf])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Continuous Distributions, paclet:tutorial/ContinuousDistributions])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Normal and Related Distributions, paclet:guide/NormalRelatedDistributions])}, {▪(RefLinkPlain[Distributions in Reliability Analysis, paclet:guide/DistributionsUsedInReliabilityAnalysis])}, {▪(RefLinkPlain[Functions Used in Statistics, paclet:guide/FunctionsUsedInStatistics])}, {▪(RefLinkPlain[Heavy Tail Distributions, paclet:guide/HeavyTailDistributions])}, {▪(RefLinkPlain[Parametric Statistical Distributions, paclet:guide/ParametricStatisticalDistributions])}, {▪(RefLinkPlain[Survival Analysis, paclet:guide/SurvivalAnalysis])}, {▪(RefLinkPlain[Actuarial Computation, paclet:guide/ActuarialComputation])}, {▪(RefLinkPlain[Distributions in Communication Systems, paclet:guide/DistributionsInCommunicationSystems])}})}})