www.pudn.com > RobustSF.zip > RobustSelection.m, change:2013-09-27,size:1544b


function [Z, w] = RobustSelection(V) 
 
 
[n, r] = size(V); 
 
temp = zeros(r, 1); 
 
%% Initialize optimization variables 
w_hat = ones(r, 1)/r; 
c_hat = ones(r, 1)/r; 
Y_hat = zeros(n, n); 
alpha_hat = zeros(r, 1); 
S = V*diag(w_hat)*V'; 
 
%% Parameters setting 
mu = 1e-3; 
max_mu = 1e30; 
rho = 1.3; 
maxIter = 1000; 
tol=1e-7; 
iter=0; 
converged=false; 
 
 
%% Start main loop 
while ~converged 
    iter=iter+1; 
     
    %% update Z_hat 
    tmp = S+Y_hat/mu; 
    Z_hat = max(tmp-1/mu, 0); 
    Z_hat = Z_hat+min(tmp+1/mu, 0); 
     
    %% update w_hat 
    beta = 0; 
    for i = 1:r 
        temp(i) = V(:, i)'*Z_hat*V(:, i)+c_hat(i)-(V(:, i)'*Y_hat*V(:, i)+alpha_hat(i))/mu; 
        beta = beta+temp(i); 
    end 
    beta = mu*(beta-2)/r; 
    for i = 1:r 
        w_hat(i) = (temp(i)-beta/mu)/2; 
    end 
     
    %% update c_hat 
    c_hat = w_hat+alpha_hat/mu; 
    c_hat(c_hat < 0) = 0; 
     
    %% update the multiplier Y_hat 
    S = V*diag(w_hat)*V'; 
    K1=S-Z_hat; 
    Y_hat = Y_hat+mu*K1; 
     
    %% update the multiplier alpha_hat 
    K2=w_hat-c_hat; 
    alpha_hat = alpha_hat+mu*K2; 
     
    %% update mu 
    mu = min(max_mu, rho*mu); 
     
    %% stopCriterion 
    stopCriterion1 = norm(K1, 'inf'); 
    stopCriterion2 = norm(K2, 'inf'); 
    if stopCriterion1 < tol && stopCriterion2 < tol 
        converged = true; 
    end 
     
    if ~converged && iter >= maxIter 
        disp('Maximum iterations reached') ; 
        converged = true ;        
    end  
     
end 
 
Z = Z_hat; 
w = w_hat;