Skip to contents

Simulates data for multi-task learning.

Usage

sim.data.multiple(
  prob.common = 0.05,
  prob.separate = 0.05,
  q = 3,
  n0 = 100,
  n1 = 10000,
  p = 200,
  rho = 0.5,
  family = "gaussian"
)

Arguments

prob.common

probability of common effect

prob.separate

probability of separate effect

q

number of datasets: integer

n0

number of training samples: integer vector of length q

n1

number of testing samples for all datasets: integer

p

number of features: integer

rho

correlation (for decreasing structure)

family

character "gaussian" or "binomial"

Value

Returns list with slots y_train (n0 x q matrix), X_train (n0 x p matrix), y_test (n1 x q matrix), X_test (n1 x p matrix), and beta (p x q matrix).

Examples

data <- sim.data.multiple()
sapply(X=data,FUN=dim)
#>      y_train X_train y_test X_test beta
#> [1,]     100     100  10000  10000  200
#> [2,]       3     200      3    200    3