1 function[] = generateRunSaveTest_constructionModelesLassoMLE(n, p, m, k, mini, maxi, gamma, glambda, varargin)
3 %set defaults for optional inputs
4 optargs = {200 15 10 3 5 10 1.0 [0.0,0.01,0.02,0.03,0.05,0.1,0.2,0.3,0.5,0.7,0.85,0.99]};
5 %replace defaults by user parameters
6 optargs(1:length(varargin)) = varargin;
7 [n, p, m, k, mini, maxi, gamma, glambda] = optargs{:};
14 %Generate phiInit,piInit,...
15 [phiInit,rhoInit,piInit,gamInit] = basicInitParameters(n, p, m, k);
18 [X, Y, ~] = generateIOdefault(n, p, m, k);
20 A2 = zeros(p,m+1,L,'int64');
25 A1 = zeros(p,m+1,L,'int64');
31 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38 dlmwrite(strcat(testFolder,'phiInit'), reshape(phiInit,1,[]), delimiter);
39 dlmwrite(strcat(testFolder,'rhoInit'), reshape(rhoInit,1,[]), delimiter);
40 dlmwrite(strcat(testFolder,'piInit'), piInit, delimiter);
41 dlmwrite(strcat(testFolder,'gamInit'), reshape(gamInit,1,[]), delimiter);
42 dlmwrite(strcat(testFolder,'mini'), mini, delimiter);
43 dlmwrite(strcat(testFolder,'maxi'), maxi, delimiter);
44 dlmwrite(strcat(testFolder,'gamma'), gamma, delimiter);
45 dlmwrite(strcat(testFolder,'glambda'), glambda, delimiter);
46 dlmwrite(strcat(testFolder,'X'), reshape(X,1,[]), delimiter);
47 dlmwrite(strcat(testFolder,'Y'), reshape(Y,1,[]), delimiter);
48 dlmwrite(strcat(testFolder,'seuil'), seuil, delimiter);
49 dlmwrite(strcat(testFolder,'tau'), tau, delimiter);
50 dlmwrite(strcat(testFolder,'A1'), reshape(A1,1,[]), delimiter);
51 dlmwrite(strcat(testFolder,'A2'), reshape(A2,1,[]), delimiter);
52 dlmwrite(strcat(testFolder,'dimensions'), [n,p,m,k,L], delimiter);
54 [phi,rho,pi,lvraisemblance] = constructionModelesLassoMLE(phiInit,rhoInit,piInit,gamInit,mini,maxi,gamma,glambda,X,Y,seuil,tau,A1,A2);
57 dlmwrite(strcat(testFolder,'phi'), reshape(phi,1,[]), delimiter);
58 dlmwrite(strcat(testFolder,'rho'), reshape(rho,1,[]), delimiter);
59 dlmwrite(strcat(testFolder,'pi'), reshape(pi,1,[]), delimiter);
60 dlmwrite(strcat(testFolder,'lvraisemblance'), reshape(lvraisemblance,1,[]), delimiter);