[R] Odp:  simulation
    Petr PIKAL 
    petr.pikal at precheza.cz
       
    Tue May  1 09:20:20 CEST 2007
    
    
  
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.
    
    
More information about the R-help
mailing list