Class: RV::Erlang
Overview
Erlang generator - Weibull restricted to integer k
- Arguments
rate-> the scale parameter (+rate+ > 0; default: 1).k-> the shape parameter (+k+ > 0; default: 1).rng-> the (+Enumerable+) source of U(0, 1)'s (default: U_GENERATOR)
Instance Attribute Summary
Attributes inherited from Weibull
Instance Method Summary collapse
-
#initialize(rate: 1.0, k: 1, rng: U_GENERATOR) ⇒ Erlang
constructor
A new instance of Erlang.
Methods inherited from Weibull
Methods included from RV_Generator
Constructor Details
#initialize(rate: 1.0, k: 1, rng: U_GENERATOR) ⇒ Erlang
Returns a new instance of Erlang.
357 358 359 360 361 |
# File 'lib/random_variates.rb', line 357 def initialize(rate: 1.0, k: 1, rng: U_GENERATOR) raise 'K must be integer.' unless k.integer? super(rate: rate, k: k, rng: rng) end |