Generate samples from m sources and p parameters, n sample per source. Optionally pass the between-source alpha hyperparameter used to generate the source parameters.

fun_rdirichlet_population(
  n,
  m,
  p,
  alpha = NULL,
  name_var = "x",
  name_source = "theta"
)

Arguments

n

number of samples per source

m

number of sources

p

number of variables

alpha

between-source alpha hyperparameter, a numeric vector or 1-row data.frame. If NULL (default), it is generated from the Uniform distribution on the (p-1)-simplex (see fun_rdirichlet_hyperparameter()).

name_var

names for data variables (default: 'x')

name_source

names for source parameters (default: 'theta')

Value

list of samples:

  • alpha: the Dirichlet hyperparameter

  • df_sources: tibble of the Dirichlet population parameters, source column is 'source', variables start with name_source

  • df_pop: the Dirichlet data, source column is 'source', variables start with name_var

  • names_var: names of columns containing data variables

  • names_source: names of columns containing source variables

See also

Other population functions: fun_rnorm_population()