Skip to contents

Erlang Mixture distribution

Usage

dist_erlangmix(shapes, scale = NULL, probs = NULL)

Arguments

shapes

Shape parameters, a trunc_erlangmix fit, or NULL as a placeholder.

scale

Common scale parameter, or NULL as a placeholder.

probs

Mixing probabilities, or NULL as a placeholder.

Value

An ErlangMixtureDistribution object.

Examples

params <- list(scale = 1.0, probs = list(0.5, 0.3, 0.2), shapes = list(1L, 2L, 3L))
dist <- dist_erlangmix(vector("list", 3L))
x <- dist$sample(20, with_params = params)
d_emp <- dist_empirical(x, positive = TRUE)

plot_distributions(
  empirical = d_emp,
  theoretical = dist,
  with_params = list(
    theoretical = params
  ),
  .x = seq(1e-4, 5, length.out = 100)
)