rv_sample(expr, condition, size) is SymPy's sample(): one realization
of a random expression, or a vector of size of them. The draws follow
the exact law of each distribution: R's own generators for the families
SymPy hands to SciPy (Normal, Exponential, Gamma, Cauchy, Poisson and
others), and inverse transform sampling of the cdf over the whole
support for the rest. Samples use R's random number generator, so they
differ from SciPy's draws for the same seed; call set.seed() (or pass
seed) for reproducible draws.
Arguments
- expr
A random expression.
- condition
An optional condition the draws must satisfy; a number here is taken as
size.- size
Number of draws.
- seed
An optional seed passed to
set.seed().- ...
Ignored.