Produces a sample_size
number of values Using the random generation
function for the given distribution
. Only the Normal, Binomial
or Poisson distribution are currently accepted.
simulate_values(sample_size, distribution, ...)
sample_size | A integer value larger than zero |
---|---|
distribution | A character value specifying the probability distribution |
... | parameters of the probability distribution |
A numeric vector
For the Normal distribution no parameters are necessary, this defaults to the Standard Normal distribution. However, the Poisson and Binomial distribution do require parameters and an error is thrown if these are not provided.
rnorm
, rpois
, rbinom
simulate_values(10, 'Normal')#> [1] -1.400043517 0.255317055 -2.437263611 -0.005571287 0.621552721 #> [6] 1.148411606 -1.821817661 -0.247325302 -0.244199607 -0.282705449simulate_values(100, 'Binomial', size=10, prob=0.5)#> [1] 4 6 6 4 8 6 2 5 6 6 2 4 4 6 5 5 6 8 4 4 6 5 6 6 3 6 6 9 8 5 5 4 4 5 5 6 4 #> [38] 6 3 4 6 4 5 4 5 4 8 5 5 4 5 4 2 5 5 2 5 5 7 5 5 5 4 4 5 7 5 4 6 3 9 3 5 7 #> [75] 6 4 5 7 2 5 6 6 5 4 5 6 5 6 5 7 6 7 2 7 9 5 4 6 5 6