Returns a function that draws n independent samples from the beta distribution.

# S3 method for class 'beta_dist'
sampler(x, ...)

Arguments

x

A beta_dist object.

...

Additional arguments (not used).

Value

A function function(n = 1, ...) returning a numeric vector of length n.

Examples

x <- beta_dist(2, 5)
s <- sampler(x)
set.seed(42)
s(5)
#> [1] 0.1849358 0.3647604 0.4308070 0.3744371 0.2647604