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 = NULL
)

Arguments

pred

the probability associated with each class

samp_size

multinomial sample size

aggregate_sex

combine or separate? default: FALSE

as_integers

integer or proportions, default: FALSE

age_err

whether to automatically apply ageing error

Examples

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