Method for sampling from a chi_squared object.

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

Arguments

x

The chi_squared object to sample from

...

Additional arguments (not used)

Value

A function that generates n samples from the chi-squared distribution

Examples

x <- chi_squared(5)
s <- sampler(x)
set.seed(42)
s(5)
#> [1] 8.817420 2.562234 4.136585 1.485791 3.705466