[R] Simulation

Greg Snow Greg.Snow at imail.org
Fri May 15 18:02:32 CEST 2009


Another possibility (maybe more readable, gives the option of a list, probably not faster):

Replicate(1000, rexp(15,1) )

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Ben Bolker
> Sent: Friday, May 15, 2009 6:37 AM
> To: r-help at r-project.org
> Subject: Re: [R] Simulation
> 
> 
> 
> On Fri, 15 May 2009 19:17:37 +1000 Kon Knafelman <konk2001 at hotmail.com>
> wrote:
> 
> KK> I hve the same problem as the initial one, except i need 1000
> KK> samples of size 15, and my distribution is Exp(1). I've adjusted
> KK> some of the loop formulas for my n=15, but im unsure how to proceed
> KK> in the quickest way.
> KK> Can someone please help?
> 
> 
>   Taking a guess:
> 
> matrix(rexp(15000,1),ncol=15)
> 
> ?
> 
> --
> View this message in context: http://www.nabble.com/Simulation-
> tp23556274p23558953.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list