Files
FAR_CS/basic/debiased_LASSO_FISTA.m
2024-07-16 15:55:00 +08:00

36 lines
1.1 KiB
Matlab
Executable File

function [x_hat, sigma_w_2, threshold] = debiased_LASSO_FISTA(A, y_noise, P_fa, noise_sigma_2, LASSO_lambda)
if nargin < 5
LASSO_lambda = 1e-1;
end
sz = size(A);
N = sz(2);
gamma = sz(1) / sz(2);
x_LASSO = FISTA(y_noise, A, LASSO_lambda, 1e-5);
rho_active = sum(abs(x_LASSO) > 1e-3) / N;
Q_hat = (gamma - rho_active) / (1 - rho_active);
Rho = sum((abs(x_LASSO) > 1e-3) .* (2 - LASSO_lambda ./ (Q_hat * abs(x_LASSO) + LASSO_lambda))) / 2 / N;
diff = 1;
while (diff > 1e-4)
Rho_pre = Rho;
Rho = sum((abs(x_LASSO) > 1e-3) .* (2 - LASSO_lambda ./ ((gamma - Rho) / (1 - Rho) * abs(x_LASSO) + LASSO_lambda))) / 2 / N;
diff = abs(Rho - Rho_pre);
end
Q_hat = (gamma - Rho) / (1 - Rho);
x_d_CROD = x_LASSO + A' * (y_noise - A * x_LASSO) / Q_hat;
x_hat = x_d_CROD;
RSS = 1 / sz(1) * norm(y_noise - A * x_LASSO, 2) ^ 2;
sigma_w_2 = (gamma * (1 - gamma)) / ((gamma - Rho) ^ 2) * RSS + noise_sigma_2;
threshold = -sigma_w_2 * log(P_fa);
xx = x_LASSO;
FAR_M = 1 / gamma;
mean_xx = mean(xx(FAR_M+1: 2*FAR_M));
end