The Lognormal Distribution

The lognormal distribution is a commonly used distribution for modelling asymmetric data.  It’s just the log of a Normal distribution right?  Well no, it’s actually the other way around.  You take the log of a lognormal distribution to arrive at a normal distribution.  Is it just me, but I always have a bit of a mental block about this, it always feels a bit back to front.

In this post I will explore the relationship between a lognormal distribution and a normal distribution.

Generating Distribution Data

JMP has a collection of functions for generating random data sampled from a specific distribution:

fml-editor

So it’s easy for me to generate data for both a normal and lognormal distribution, and to compare them:

distsx2

Distribution Parameters

Now that I can look at the lognormal distribution let me take a closer look at its parameters.  To generate random data from a lognormal distribution I use the following function:

random-lognormal-def

Here is the distribution using mu=4.6 and sigma=0.35:

lognormal-fit

What I find confusing is that sigma is not the standard deviation of the data and mu is not the mean.  Presumably then, they relate to the parameters of the associated normal distribution.  Let’s see.  I can create a new variable Z which is the log transform of the data:

Z

Hey presto – the mean and standard deviation match the parameters I used for the Random Lognormal function.

But What If . . .

. . .  I want to generate a lognormal distribution and I want to specify the values for the mean and standard deviation?  Let me take a specific example:

X

I want to generate a lognormal distribution with the same mean and standard deviation as the above data.

The calculation is more complex than you might expect.  If  \overline x and s represent the mean and standard deviation of the normal distribution then the parameters for the lognormal distribution are given by:

\mu = log \Bigg(  \dfrac  {  \overline x  }  {  \sqrt{  1 + {\Big(  \dfrac  {  s  }  {  \overline x  }  \Big)}^2  }  }  \Bigg)

\sigma = log\bigg(  1 + {  \Big(  \dfrac  {s}  {\overline x}  \Big)  }^2  \bigg)

Applying these equations to the above data yields values of -0.005 and 0.1 respectively.

Finally, I can verify these numbers by using them with the Random Lognormal function to generate some sample data.  If I have the correct parameters then the data will have a mean of 1.0 and a standard deviation of 0.1:

reverse-lognormal

Share the joy:
facebooktwittergoogle_pluslinkedinmailfacebooktwittergoogle_pluslinkedinmail

2 thoughts on “The Lognormal Distribution”

Leave a Reply