Commit | Line | Data |
---|---|---|
35b42a4b B |
1 | generateIOdefault = function(n, p, m, k){ |
2 | rangeX = 100 | |
3 | meanX = rangeX*(1-matrix(runif(k*p),ncol = p)) | |
4 | ||
5 | covX = array(0, dim=c(p,p,k)) | |
6 | covY = array(0, dim=c(m,m,k)) | |
7 | ||
8 | for(r in 1:k){ | |
9 | covX[,,r] = diag(p) | |
10 | covY[,,r] = diag(m) | |
11 | } | |
12 | ||
13 | pi = (1/k) * rep(1,k) | |
14 | ||
15 | beta = array(0, dim=c(p,m,k)) | |
16 | ||
17 | for(j in 1:p){ | |
18 | nonZeroCount = ceiling(m * runif(1)) | |
19 | beta[j,1:nonZeroCount,] = matrix(runif(nonZeroCount*k),ncol = k) | |
20 | } | |
21 | ||
22 | generate = generateIO(meanX, covX, covY, pi, beta, n) | |
23 | ||
24 | return(list(generate[[1]],generate[[2]])) | |
25 | } |