


% Shrinkage parameters selection Selects target weights for the next homotopy step such that the weights shrink at a faster rate on the active set than the inactive set.


0001 %% Shrinkage parameters selection 0002 % Selects target weights for the next homotopy step such that the weights 0003 % shrink at a faster rate on the active set than the inactive set. 0004 0005 switch shrinkage_mode 0006 case 'Tsteps' 0007 % active weights are reduced to tau/ewt 0008 tau_vec = ones(N,1)*tau; 0009 tau_vec(gamma_xh) = tau/ewt; 0010 case 'frac' 0011 % acitve weights are reduced to a fraction of their present value 0012 tau_vec = ones(N,1)*min(epsilon/ewt,max(epsilon_vec)); 0013 tau_vec(gamma_xh) = epsilon_vec(gamma_xh)/ewt; 0014 case 'Trwt' 0015 % active weights are modified based on current signal estimate 0016 [alpha beta epsilon] = weight_param(5,1,xk_1,M); 0017 ewt_b = beta; % M*(norm(xk_1,2)/norm(xk_1,1))^2; 0018 tau_vec = ones(N,1)*tau; 0019 % tau_vec(gamma_xh) = min([tau_vec(gamma_xh) tau./abs(xk_1(gamma_xh))/ewt_b],[],2); 0020 tau_vec(gamma_xh) = min([tau_vec(gamma_xh) tau./(beta*abs(xk_1(gamma_xh))+epsilon)],[],2); 0021 % alpha = 0.75; 0022 % tau_vec = alpha*tau_vec+(1-alpha)*epsilon_vec; 0023 case 'rwt' 0024 % hybrid scheme... 0025 % first stage: reduce active weights by a fraction to same values 0026 % second stage: reduce active weights according to signal estimate 0027 % 0028 0029 % this two-step procedure is often slower, but more stable, than Trwt 0030 if epsilon <= tau*ewt; 0031 rwt_step2 = 1; 0032 end 0033 if rwt_step2 0034 [alpha beta epsilon] = weight_param(5,1,xk_1,M); 0035 ewt_b = beta; % M*(norm(xk_1,2)/norm(xk_1,1))^2; 0036 0037 tau_vec = ones(N,1)*tau; 0038 % tau_vec(gamma_xh) = min([tau_vec(gamma_xh) norm(xk_1,2)/sqrt(N*M)*tau./abs(xk_1(gamma_xh)*ewt)],[],2); 0039 % how about the following selection for which w_i = \tau/beta, where beta = sqrt(M)/\|x\|_1*\|x\|_2 which implies that sqrt(M)> beta > sqrt(M/K) 0040 % tau_vec(gamma_xh) = min([tau_vec(gamma_xh) norm(xk_1,1)/M*tau./abs(xk_1(gamma_xh)*ewt)],[],2); 0041 % tau_vec(gamma_xh) = min([tau_vec(gamma_xh) (norm(xk_1,1)/norm(xk_1,2)/sqrt(M))^1*tau./abs(xk_1(gamma_xh)*ewt)],[],2); 0042 tau_vec(gamma_xh) = min([tau_vec(gamma_xh) tau./abs(xk_1(gamma_xh))/ewt_b],[],2); 0043 else 0044 tau_vec = ones(N,1)*min(epsilon/ewt,max(epsilon_vec)); 0045 % tau_vec(gamma_xh) = ones(length(gamma_xh),1)*epsilon_old; 0046 tau_vec(gamma_xh) = min([epsilon_vec(gamma_xh) epsilon/ewt*ones(length(gamma_xh),1)],[],2); 0047 % tau_vec(gamma_xh) = epsilon/ewt*ones(length(gamma_xh),1); 0048 end 0049 case 'OLS' 0050 % set according to LS solution on the active support 0051 % such as w_gamma = 1./abs((A_gamma'*A_gamma)^-1*A_gamma'*y); 0052 % xols = (A_gamma'*A_gamma)^-1*A_gamma'*y; 0053 xols = zeros(N,1); 0054 % switch delx_mode 0055 % case 'mil' 0056 % xols(gamma_xh) = iAtA*(A(:,gamma_xh)'*y); 0057 % case 'qr' 0058 % xols(gamma_xh) = R\(R'\(A(:,gamma_xh)'*y)); 0059 % end 0060 xols(gamma_xh) = A(:,gamma_xh)\y; 0061 [alpha beta epsilon] = weight_param(5,1,xols,M); 0062 % alpha =1; epsilon = 1; beta = M*(norm(xk_1,2)/norm(xk_1,1))^2; 0063 tau_vec = ones(N,1)*tau; 0064 % tau_vec(gamma_xh) = min([tau_vec(gamma_xh) tau./(beta*abs(xols(gamma_xh))+epsilon)],[],2); 0065 tau_vec(gamma_xh) = max([tau_vec(gamma_xh)./(beta*abs(xols(gamma_xh))+epsilon) epsilon_vec(gamma_xh)./(beta*abs(xols(gamma_xh))+epsilon)],[],2); 0066 figure(107); plot([x_orig xols xk_1]); pause(1/60); 0067 end