[R] simulation with "rpois"

Pablo Andres pablo at hpcf.upr.edu
Thu Nov 2 12:59:02 CET 2006


Hi there, I need some helpo with one simulation.
I have a matrix of 4x21
I want ro generate 100 random Chi2 distribution but inly from the first 
row of my matrix.
This is what I try:
Option (a):
 >lambda=1:100
 >f=function(x)chisq(4,0,x)
 >lapply(lambda,f)
It doesn't work!

option(b):
 >m=mean(matrix[1,])
 >x<-rpois(100,lambda=m)
Works, but only generates a row of 25 values.
The point is:
I need a matrix of 100(rows) x 4(columns)

thanks a lot!



More information about the R-help mailing list