Skip to contents

This function generates random values from the random variable.

Arguments

n

Integer. Number of observations.

a

Numeric. If it is provided and has length n, values will be used in each realization.

b

Numeric. If it is provided and has length n, values will be used in each realization.

k

Numeric. If it is provided and has length n, values will be used in each realization.

even

Boolean. If it is provided and has length n, values will be used in each realization.

Value

A vector of numeric values.

Examples


test <- rand_uniform_d(a = 1, b = 2, k = 2, even = TRUE)
test$gen(10)
#>  [1] 2 1 2 1 2 1 1 2 1 1

test$gen(3, a = c(1,2,3), b = c(2,3,4), k = 1, even = c(TRUE, TRUE, FALSE))
#> [1] 1 2 1