Generate samples from m sources and p parameters, n sample per source. Optionally pass the between-source hyperparameters used to generate the source parameters.
fun_rnorm_population( n, m, list_hyper = NULL, name_var = "x", name_source = list(mu = "mu", sigma = "sigma") )
n | number of samples per source |
---|---|
m | number of sources |
list_hyper | a list containing the hyperparameters:
|
name_var | names for data variables (default: |
name_source | named list or character vector with names for source parameters \(\mu\) and \(\sigma\) (default: |
list of samples:
list_hyper
: a list containing the hyperparameters:
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
The Normal-Normal model:
$$X_{ij} ~ N(\mu_i, \sigma_i^2) i = 1, \ldots, n, j = 1, \ldots, m$$ $$\mu_i ~ N(m_{\mu}, s_{\mu}^2) j = 1, \ldots, m$$ $$\sigma_i ~ N(m_{\sigma}, s_{\sigma}^2) j = 1, \ldots, m$$
Other population functions:
fun_rdirichlet_population()