Skip to contents

A single representation for a probability distribution: a name plus its parameters, resolved to the corresponding base-R d/p/q/r functions. All distribution operations in this module accept such an object, so the distribution is a parameter rather than being hard-wired.

Usage

morie_distribution(name, ...)

Arguments

name

One of "normal", "exponential", "gamma", "poisson", "binomial".

...

Named distribution parameters (e.g. mean, sd for normal; rate for exponential; shape, rate for gamma; lambda for poisson; size, prob for binomial).

Value

A morie_distribution object.

Examples

morie_distribution("normal", mean = 0, sd = 1)
#> <morie_distribution: normal(mean=0, sd=1)>