Skip to contents

Sets or replaces the distribution of a random variable declared with rand_var(), for example one declared without a distribution.

Usage

set_distribution(m, v, dist)

Arguments

m

A model().

v

The random variable, as returned by rand_var().

dist

A distribution such as normal(100, 15), or an empirical() sample, of the same length as v.

Value

The model, invisibly.

Examples

m <- model()
demand <- rand_var(m, "demand")
set_distribution(m, demand, normal(100, 15))