[R] montecarlo simulation

Christian Schulz ozric at web.de
Mon Sep 20 15:00:39 CEST 2004


imho one easy example:

n <- 50
reps  <- 1000
ms  <- single(reps)
set.seed(378216)
for(i in 1:reps) {
x <- exp(rnorm(n))
ms[i] <- median(x)
}

hist(ms)

regards, christian


Am Montag, 20. September 2004 14:30 schrieb francesca.mata at excite.it:
> Hy!
> I would like to know how run a montecarlo simulation with R.
> Thank you!!!!
> Francesca Matalucci
>
> __________________________________________________________________
> Accesso Internet Gratis per utenti Excite! Attivalo subito!
> http://www.excite.it/hitech/accesso
>
> Il Mio Excite. Personalizza la tua Home page Excite come vuoi tu!
> http://www.excite.it
>
> AAA/Relazioni. Sfoglia gli annunci e trova la tua anima gemella
> http://www.excite.it/relazioni
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html




More information about the R-help mailing list