X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=R%2Fmain.R;h=9817b001dec83d4481e38e5df823b9542db48cde;hb=f2a9120810d7e1e423c7b5c2c4320f4e27221f50;hp=00b1be9b60aac9b41fa7709d51245b79a11d2ae3;hpb=39046da6016f15d625bd99cf0303ea8beb838c79;p=valse.git diff --git a/R/main.R b/R/main.R index 00b1be9..9817b00 100644 --- a/R/main.R +++ b/R/main.R @@ -39,7 +39,7 @@ SelMix = setRefClass( # initialisation for the allocations probabilities in each component tauInit, # values for the regularization parameter grid - gridLambda = []; + gridLambda = c(), # je ne crois pas vraiment qu'il faille les mettre en sortie, d'autant plus qu'on construit # une matrice A1 et A2 pour chaque k, et elles sont grandes, donc ca coute un peu cher ... A1, @@ -52,7 +52,7 @@ SelMix = setRefClass( Pi, #immutable - seuil = 1e-15; + seuil = 1e-15 ), methods = list( @@ -100,7 +100,7 @@ SelMix = setRefClass( "computation of the regularization grid" #(according to explicit formula given by EM algorithm) - gridLambda <<- grillelambda(sx.phiInit,sx.rhoInit,sx.piInit,sx.tauInit,sx.X,sx.Y, + gridLambda <<- gridLambda(sx.phiInit,sx.rhoInit,sx.piInit,sx.tauInit,sx.X,sx.Y, sx.gamma,sx.mini,sx.maxi,sx.eps); }, @@ -163,19 +163,19 @@ SelMix = setRefClass( p = ncol(X) m = ncol(Y) if size(Phi2) == 0 #TODO: continue translation MATLAB --> R - sx.Phi(:,:,1:k,:) = r1$phi; - sx.Rho(:,:,1:k,:) = r1$rho; - sx.Pi(1:k,:) = r1$pi; + Phi(:,:,1:k,:) = r1$phi; + Rho(:,:,1:k,:) = r1$rho; + Pi(1:k,:) = r1$pi; else - sx.Phi = zeros(p,m,sx.kmax,size(Phi2,4)+size(r1$phi,4)); - sx.Phi(:,:,1:size(Phi2,3),1:size(Phi2,4)) = Phi2; - sx.Phi(:,:,1:k,size(Phi2,4)+1:end) = r1$phi; - sx.Rho = zeros(m,m,sx.kmax,size(Rho2,4)+size(r1$rho,4)); - sx.Rho(:,:,1:size(Rho2,3),1:size(Rho2,4)) = Rho2; - sx.Rho(:,:,1:k,size(Rho2,4)+1:end) = r1$rho; - sx.Pi = zeros(sx.kmax,size(Pi2,2)+size(r1$pi,2)); - sx.Pi(1:size(Pi2,1),1:size(Pi2,2)) = Pi2; - sx.Pi(1:k,size(Pi2,2)+1:end) = r1$pi; + Phi = zeros(p,m,sx.kmax,size(Phi2,4)+size(r1$phi,4)); + Phi(:,:,1:size(Phi2,3),1:size(Phi2,4)) = Phi2; + Phi(:,:,1:k,size(Phi2,4)+1:end) = r1$phi; + Rho = zeros(m,m,sx.kmax,size(Rho2,4)+size(r1$rho,4)); + Rho(:,:,1:size(Rho2,3),1:size(Rho2,4)) = Rho2; + Rho(:,:,1:k,size(Rho2,4)+1:end) = r1$rho; + Pi = zeros(sx.kmax,size(Pi2,2)+size(r1$pi,2)); + Pi(1:size(Pi2,1),1:size(Pi2,2)) = Pi2; + Pi(1:k,size(Pi2,2)+1:end) = r1$pi; end else [phi] = runProcedure2(sx);