Sampling from a multinomial with sample()
drob dropped this tweet:
sample() takes a prob argument, so you can skip rmultinom entirely!
— David Robinson (@drob) October 27, 2021
sample(n_comp, n, prob = mixture_probs, replace = TRUE)
drob dropped this tweet:
sample() takes a prob argument, so you can skip rmultinom entirely!
— David Robinson (@drob) October 27, 2021
sample(n_comp, n, prob = mixture_probs, replace = TRUE)
Leave a comment