vector - Drawing from different distributions without looping in R -


The way I am attracted, I want to vector it. Suppose I have a vector of parameter values ​​for Possession, and for each parameter, I want to make 1 sample. Is there any way to do this without looping?

You must specify the vector for each function argument to get vector results:

  & gt; About the first argument, see:    

Blockquote>

The length of the result is determined by n for rpois, and There is a maximum length of numerical standards for other tasks.

The length of the recycled result for numerical parameters other than n only the first elements of logical parameters are used.

If you need multiple draws at each level, then you mapply (or Vectorize ) function: < pre> & gt; Maplei (Ruppes, Representative (4,4), Lambda = C (1,10,100,1000)) [, 1] [, 2] [, 3] [, 4] [1,] 0 8 78 1016 [2,] 0 10 106 1044 [3,] 1 14 97 1004 [4,] 0 13 94 983

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -