[R] Odp: simulation

From: Petr PIKAL <petr.pikal_at_precheza.cz>
Date: Tue, 01 May 2007 09:20:20 +0200


Hi

r-help-bounces_at_stat.math.ethz.ch napsal dne 01.05.2007 09:03:46:

>
> Hello
>
> I would like to simulate datasets in the following way:
>
> x <- rpois(999, 2000)
> y <- sum(exp(rgamma(x, scale=2, shape=0.5)))

You computed sum of your 999 values. Regardless of how many values are summed the result is always only one number. Did not you want cumsum?

Regards
Petr

>
> The problem is, that by calling "y" I just get 1 value back and not 999
> values. Can anyone help me? Thanks!
>
> Brigitte
>
>
>
>
>
>
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> 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
> and provide commented, minimal, self-contained, reproducible code.



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 and provide commented, minimal, self-contained, reproducible code. Received on Tue 01 May 2007 - 09:10:53 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 01 May 2007 - 09:31:12 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.