sampler.edist: Method for obtaining the sampler of an 'edist' object.

View source: R/edist.R

sampler.edistR Documentation

Method for obtaining the sampler of an edist object.

Description

Method for obtaining the sampler of an edist object.

Usage

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

Arguments

x

The edist object to obtain the sampler of.

...

Additional arguments to pass into each of the sampler function generators.

Value

A function that takes a number of samples n, ... which is passed into the expression x$e and returns the result of applying the expression x$e to the sampled values.

Examples


set.seed(1)
z <- normal(0, 1) * exponential(2)
s <- sampler(z)
samples <- s(100)
head(samples)


algebraic.dist documentation built on Feb. 27, 2026, 5:06 p.m.