Method for sampling from a gamma_dist object.

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

Arguments

x

The gamma_dist object to sample from

...

Additional arguments (not used)

Value

A function that generates n samples from the gamma distribution

Examples

x <- gamma_dist(shape = 2, rate = 1)
s <- sampler(x)
set.seed(42)
s(5)
#> [1] 3.6489561 0.8881098 1.5592198 0.4521825 1.3728401