anthony@stat.sdu.dk
2004-May-01 17:00 UTC
[Rd] Generating Lognormal Random variables (PR#6843)
Full_Name: Anthony Gichangi Version: 1.90 OS: Windows XP Pro Submission from: (NULL) (130.225.131.206) The function rlnorm generates negative values for lognormal distribution. x- rlnorm(1000, meanlog = 0.6931472, sdlog = 1) Regards Anthony
anthony@stat.sdu.dk writes:> Full_Name: Anthony Gichangi > Version: 1.90 > OS: Windows XP Pro > Submission from: (NULL) (130.225.131.206) > > > The function rlnorm generates negative values for lognormal distribution. > > x- rlnorm(1000, meanlog = 0.6931472, sdlog = 1)Eh?> all(rlnorm(1000000, meanlog = 0.6931472, sdlog = 1) >= 0)[1] TRUE Try reproducing with a fixed random seed so that others have a chance to check. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907
dmurdoch@pair.com
2004-May-01 17:08 UTC
[Rd] Generating Lognormal Random variables (PR#6843)
On Sat, 1 May 2004 17:00:28 +0200 (CEST), anthony@stat.sdu.dk wrote:>Full_Name: Anthony Gichangi >Version: 1.90 >OS: Windows XP Pro >Submission from: (NULL) (130.225.131.206) > > >The function rlnorm generates negative values for lognormal distribution. > >x- rlnorm(1000, meanlog = 0.6931472, sdlog = 1)It doesn't for me, and the line you typed above makes it look like you're subtracting lognormals from x. Could you post a reproducible example? For random number generators, you can make them reproducible by using set.seed, e.g.> set.seed(1) > range(rlnorm(1000, meanlog = 0.6931472, sdlog = 1))[1] 0.09877592 90.32586746 Duncan Murdoch