function [d,a ] =  generate(a)

if( a.seed>0) RandStream.setDefaultStream(RandStream('mcg16807', 'Seed',a.seed));   end;

Z=unifrnd(-a.cov_r,a.cov_r,a.n,a.dim);
for i=1:a.corrdim
    Z(:,i)=a.coef(i).*Z(:,i);
end

temp=0;
for i=1:(a.corrdim-1)
    temp=temp+Z(:,i).*Z(:,i+1)./(1+Z(:,i).^2);
end;
Y=temp;
d=data(Z,Y);
