function [data] = test_sts_data(Ngenes, Nclusters, Ndimensions)
%------------------------------------------------------------------------ %
% This function construct an artificial data set which simulating
% genes expressions time-series. These data determines Nc optimal clusters 
% with the same properties of an optimal gene-expression cluster(with same 
% slopes across the time point) 
%------------------------------------------------------------------------ %

n_t   = Ndimensions;      % number of time points
n_g   = Ngenes;           % number of genes per cluster
Nc    = Nclusters;        % number of clusters
max_a = 10;               % range of initial values (Default: 10)
mm    = 0.97;             % mean for the slope (Default: 0.97)
msd   = 0.18;              % standard deviation for the slope (Default: 0.18)
bm    = 0.5;              % mean for the offset (Default: 0.5)
bsd   = 3.5;              % standard deviation for the offset (Default: 3.5)


    for c = 1:Nc
        a = (rand(1)-0.5)*max_a;           % initial value
        m = random('norm',mm,msd,1,n_t);   % slope
        b = random('norm',bm,bsd,1,n_t);   % offset
        da = rand(1, n_g);
        da = max_a*(da./sum(da));          % sum(da) = 10;
        ioff = (c-1)*n_g;
        for i=1:n_g;                       % creat the n_t series for cluster 1
            x(i+ioff,1)=a;
            for count=2:n_t
                x(i+ioff,count)=m(count)*x(i+ioff,count-1)+b(count);
            end;
            a=a+da(i);
        end;
    end;
    data = x;
end

