Re: random numbers from a lognormal distribution

From: Dave (dave_w_at_yahoo.com)
Date: 02/02/05


Date: Wed, 2 Feb 2005 14:06:04 +0000 (UTC)

On Tue, 01 Feb 2005 20:33:15 -0600, Ray Koopman wrote:
>Bob Wheeler wrote:
>> [...]
>> I think he is asking how to do it himself. If X is a standard
normal variate, then U=(log(X)-m)/s is lognormal with mean
exp(m)sqrt(w), where w=exp(s^2), and variance exp(2m)w(w-1).
>
>Shouldn't that be "If X is a standard normal variate then
U=exp(X*s+m) is lognormal ..."?

This confusion reminds me of a trick I figured out for working with
the lognormal distribution...

I always had trouble working with the formulas for converting the mean
and standard deviation from the normal distribution to the lognormal
distribution, and vice versa, E(x)-->E(lnx), V(x)-->V(lnx) and so
forth. One day it occurred to me that both distributions are
completely characterized by 2 pieces of information, and that the mean
and standard deviation aren't the only 2 pieces of information I could
use. They're the traditional pieces of information, but they're not
the only ones.

I discovered that the median and interquartile range are much easier
to use, so that's what I use now.

The transformation functions exp(x) and ln(x) are non-decreasing
functions, and for any non-decreasing function g(x), the percentiles
of x and g(x) are easy to derive from each other. If x_p is the p-th
percentile of the random variable x, then g(x_p) is the p-th
percentile of the random variable g(x).

In particular, if m is the median of a normal distribution, then ln(m)
is the median of the corresponding lognormal distribution. And if m
is the median of a lognormal distribution, then exp(m) is the median
of the corresponding normal distribution. The same goes for the 25-th
and 75-th percentiles, and that allows me to calculate the
interquartile ranges of both distributions fairly easily.

So now whenever I work with the lognormal distribution, I use the
median and interquartile range as my 2 pieces of information instead
of the mean and standard deviation. Try it. I like it much better.



Relevant Pages

  • Re: Confidence interval
    ... mean will be 0 and standard deviation is 1. ... distribution for tolerance limits and acceptability. ... Your opinion IS the method, whether you call it mathematical or not. ... Bayesian statistics is based on the PERSONAL or SUBJECTIVE ...
    (sci.stat.consult)
  • Re: Thoughts on some stdlib modules
    ... makes no sense to make the Python standard distribution like this. ... not an OS and cannot control all of the little factors that make package management feasible for ... As a side note, with the Numeric/numarray unification, the Numeric ...
    (comp.lang.python)
  • Re: computing on streams of data
    ... you need to be able to keep a running median for the first N values? ... We wanted to be able to show the distribution of values ... What I ended up doing was creating bins that were logarithmically ... a K-bit approximation using significantly fewer bits than for the ...
    (comp.theory)
  • Re: quite an achievement
    ... The discussion was about the overall quality of the players ... but that we look at the standard of the ... I would take bets that the number exceeding the median was ...
    (uk.sport.cricket)
  • Re: question about random generator
    ... >>> uniform distribution. ... >> What I was trying to explain is that pseudo-random does not imply ... >> anything about the distribution of the numbers. ... Well I don't know the standard by hard, ...
    (comp.lang.c)