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)
)
Run the code above in your browser using DataLab