Simulate observations from a multinomial distribution #' A wrapper function around `rmultinom` that generates a single vector of observations from a multinomial distribution where each of the `K` multinomial classes has probability `pred`. This function will automatically handle generating multinomial draws across multiple sexes. Aging error can be optionally applied.

simulate_multinomial_obs(
  pred,
  samp_size,
  aggregate_sex = FALSE,
  as_integers = FALSE,
  age_err = NA
)

Arguments

pred

the probability associated with each class

samp_size

multinomical sample size

age_err

whether to automaticaly apply ageing error

Examples

if (FALSE) {
simulate_multinomial_obs(c(0.25, 0.50, 0.25), 100)
}