Re: random numbers from a lognormal distribution
From: Herman Rubin (hrubin_at_stat.purdue.edu)
Date: 02/03/05
- Next message: Bernhard: "Re: random numbers from a lognormal distribution"
- Previous message: Marc Schwartz: "Re: R function RPART methods"
- In reply to: Bob Wheeler: "Re: random numbers from a lognormal distribution"
- Next in thread: Nnik: "Re: random numbers from a lognormal distribution"
- Messages sorted by: [ date ] [ thread ]
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
- Next message: Bernhard: "Re: random numbers from a lognormal distribution"
- Previous message: Marc Schwartz: "Re: R function RPART methods"
- In reply to: Bob Wheeler: "Re: random numbers from a lognormal distribution"
- Next in thread: Nnik: "Re: random numbers from a lognormal distribution"
- Messages sorted by: [ date ] [ thread ]