dist_mixture(
dist_normal(-2, 1),
dist_normal(2, 1),
weights = c(1 / 3, 2 / 3)
) |>
gg_density() +
gg_density_layer(dist_normal(-2, 1), linetype = "dashed", scale = 1 / 3) +
gg_density_layer(dist_normal(2, 1), linetype = "dashed", scale = 2 / 3)
Run the code above in your browser using DataLab