Commit | Line | Data |
---|---|---|
7b272073 BA |
1 | %call generateIO with default parameters (random means, covariances = identity, equirepartition) |
2 | function[X,Y,Z] = generateIOdefault(n, p, m, k) | |
3 | ||
4 | rangeX = 100; | |
5 | meanX = rangeX * (1 - 2*rand(k, p)); | |
6 | covX = zeros(p,p,k); | |
7 | covY = zeros(m,m,k); | |
8 | for r=1:k | |
9 | covX(:,:,r) = eye(p); | |
10 | covY(:,:,r) = eye(m); | |
11 | end | |
12 | pi = (1/k) * ones(1,k); | |
13 | ||
14 | %initialize beta to a random number of non-zero random value | |
15 | beta = zeros(p,m,k); | |
16 | for j=1:p | |
17 | nonZeroCount = ceil(m*rand(1)); | |
18 | beta(j,1:nonZeroCount,:) = rand(nonZeroCount, k); | |
19 | end | |
20 | ||
21 | [X,Y,Z] = generateIO(meanX, covX, covY, pi, beta, n); | |
22 | ||
23 | end |