Generate the simulations of the expert_matrix

sim_dataset(
  alpha,
  x,
  expert_matrix = NULL,
  comp_dist,
  params_list,
  exposure = rep(1, dim(x)[1])
)

Arguments

alpha

(matrix) A g * P matrix. Logit regression coefficients.

x

(matrix) An N * P covariate matrix, where N is sample size. The first column MUST be 1 for an intercept term.

expert_matrix

(ExpertMatrix) A D*g expert matrix.

comp_dist

(matrix) A D * g string matrix, representing the name of expert functions.

params_list

(matrix) A D * g matrix of lists, representing the parameters of expert functions.

exposure

A N*1 vector that contain the exposure value for each column in expert_matrix

Value

A N*D simulation matrix of expert_matrix.

Examples

#alpha = matrix(runif(20,-1,1), nrow = 4)
#x = matrix(runif(35, -1, 1), nrow = 7)
#params = matrix(list( list(meanlog = 100, sdlog = 2),  list(meanlog = 100, sdlog  = 2),
#                      list(meanlog = 333, sdlog = 1),  list(meanlog = 533, sdlog = 1),
#                      list(meanlog = 1, sdlog = 2),  list(meanlog = 1, sdlog  = 2),
#                      list(meanlog = 3, sdlog = 1),  list(meanlog = 5, sdlog = 1)),
#                      nrow = 2, byrow = T)
# expert_names = matrix( c("lognormal", "lognormal", "lognormal", "lognormal",
#                        "lognormal", "lognormal", "lognormal", "lognormal"), nrow = 2, byrow = T)
#expert_matrix = ExpertMatrix$new(expert_matrix = expert_names, expert_params_matrix = params)
#for(expert in expert_matrix$expert_matrix) {
# expert$set_penalty_params(c(1,1,1))
#  expert$initialize_penalty()
#}
#exposure_list = c(1,2,1,2,2,2,1)
#sim_dataset(alpha, x, expert_matrix, exposure = exposure_list)