Re: random numbers from a lognormal distribution

From: Herman Rubin (hrubin_at_stat.purdue.edu)
Date: 02/03/05


Date: Thu, 03 Feb 2005 12:19:40 -0600

In article <af88$41ffe89b$97c573c4$13409@nf1.news-service.com>,
Bob Wheeler <bwheeler@echip.com> wrote:
>clemenr@wmin.ac.uk wrote:
>> danad...@hagios.us wrote:

>>>Hello,
>>>I'm a grad student working on a thesis where I have to do a
>>>simulation. My problem is that I need to generate random numbers from

>> a

>>>lognormal distribution given a mean and stddev. I wrote the

>> simulation

>> [....]

>> The torch library (in C++) includes code to generate lognormally
>> distributed random numbers. Shouldn't be too hard to adapt the code to
>> Java. (Though, I haven't looked into the code myself).
>> http://www.torch.ch/

>> Cheers,

>> Ross-c

>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). So he should generate some
>normal X's and transform them.

It is the other way around. If X is standard normal, exp(m+s*X)
has the lognormal distribution cited.

-- 
This address is for information only.  I do not claim that these views
are those of the Statistics Department or of Purdue University.
Herman Rubin, Department of Statistics, Purdue University
hrubin@stat.purdue.edu         Phone: (765)494-6054   FAX: (765)494-0558

Quantcast