Learn R Programming

distr6 (version 1.5.2)

distrSimulate: Simulate from a Distribution

Description

Helper function to quickly simulate from a distribution with given parameters.

Usage

distrSimulate(
  n = 100,
  distribution = "Normal",
  pars = list(),
  simplify = TRUE,
  seed,
  ...
)

Arguments

n

number of points to simulate.

distribution

distribution to simulate from, corresponds to ClassName of distr6 distribution, abbreviations allowed.

pars

parameters to pass to distribution. If omitted then distribution defaults used.

simplify

if TRUE (default) only the simulations are returned, otherwise the constructed distribution is also returned.

seed

passed to set.seed

...

additional optional arguments for set.seed

Value

If simplify then vector of n simulations, otherwise list of simulations and distribution.

See Also

rand