Message-ID: <1138347621.43d9ce6533e8e@imp5-g19.free.fr>
Date: 2006-01-27T07:40:21Z
From: Romain Francois
Subject: generating random numbers from the logit-normal distribution ?
In-Reply-To: <BAY110-F5FB33B4BA5F87F3F3DFA4C7140@phx.gbl>
Selon Taka Matzmoto <sell_mirage_ne at hotmail.com>:
> Hi R users
>
> I like to generate random numbers from the logit-normal distribution.
>
> Are there available simple commands I can use?
>
> I used to generate using
>
> exp(rnorm(1000,0,1))/(1+exp(rnorm(1000,0,1)))
> I am looking for a simple command such as rnorm().
>
> Thanks in advance
>
> TM
Hi,
Consider writing a function, you can even learn how to use ...
rlogitnormal <- function(...){
x <- exp(rnorm(...))
x / (1+x)
}
then
rlogitnormal(1000, 0, 1)
Romain