clc;
clear;
%% Parameters
n = 5;
lambda = ones (n,1)* 1.5; % lambda is the shape parameter and for now assume equals 1.5 across all components
%a= [0.9:0.1:1.5];
%lambda = datasample(a,n)';
%% Covariats matrix
a=rand(n);
b=triu(a).'+triu(a,1);
B= [];
for i=1:n;
    for j=1:n;
        if i==j
            B(i,j)= 1;
        else
            B(i,j)= b(i,j);
    end
    end
end
% W is is now a symmetric covariate matrix, covariances are just pulled
% from a random univariate distribution

x= [];

for i=1:n;
    for j=1:n;
        if i==j
            x(i,j)= 1;
        else
            x(i,j)= datasample ([0 1],1);
    end
    end
end

W= x .* B; % 

W = [5	5	4	2	0;
    1	5	0	0	1;
    0	0	5	0	0;
    1	1	1	5	0;
    3	1	2	0	5];
W= W ./ 5;

%% Creating eta and theta

eta= sum(W,2); 
theta = exp(eta); %scale parameter
%% creating network groups
%% creating network groups
c= [];

for i=1:n;
    for j=1:n;
        if W(i,j) ~= 0
            c(i,j)= j;    
        else
            c(i,j)= W(i,j);    
    end
    end
end

      
data = [ lambda eta theta W c];
size(data);

dlmwrite('data.txt',data,'delimiter','\t','precision','%.4f');

