# matlab增广拉格朗日,[Opt] 拉格朗日乘子法 | ADMM | Basis pursuit

Lagrange Multiplier(拉格朗日乘子法)

Augmented Lagrangian Multiplier(增广拉格朗日乘子法，ALM)

是拉格朗日乘子。它的对偶函数为

是对偶问题的最优解，下面我们用梯度下降法求解它。迭代公式为

①总结拉格朗日乘子法的更新方法如下：

②类似拉格朗日乘子法，增广拉格朗日乘子法的更新方法如下：

convex)

Basis pursuit

表示指示函数，相关的内容我在 [Opt] 近端最小化算法 有写过。那么它的增广拉格朗日函数为

:

。上述问题为

在仿射集上的投影问题，求解参考[4]，具体原理等内容我在 [ML] 深入线性回归 提到过。

。

：

即可

④ 总结 Basis pursuit 更新方法如下：

MATLAB 代码

MATLAB 中在命令行窗口输入如下指令获取 basis_pursuit 函数

basis_pursuit.m

function[z, history] =basis_pursuit(A, b, rho, alpha)% basis_pursuit Solve basis pursuit via ADMM

%

% [x, history] = basis_pursuit(A, b, rho, alpha)

%

% Solves the following problem via ADMM:

%

% minimize ||x||_1

% subject to Ax = b

%

% The solution is returned in the vector x.

%

% history is a structure that contains the objective value, the primal and

% dual residual norms, and the tolerances for the primal and dual residual

% norms at each iteration.

%

% rho is the augmented Lagrangian parameter.

%

% alpha is the over-relaxation parameter (typical values for alpha are

% between 1.0 and 1.8).

%

%

t_start = tic;

%% Global constants and defaults

QUIET = 0;

MAX_ITER = 1000;

ABSTOL = 1e-4; % 绝对误差容限

RELTOL = 1e-2; % 相对误差容限

%% Data preprocessing

[~, n] = size(A);

x = zeros(n,1);

z = zeros(n,1);

u = zeros(n,1);

if ~QUIET

fprintf(‘%3s\t%10s\t%10s\t%10s\t%10s\t%10s\n‘, ‘iter‘, ...

‘r norm‘, ‘eps pri‘, ‘s norm‘, ‘eps dual‘, ‘objective‘);

end

% precompute static variables for x-update (projection on to Ax=b)

AAt = A*A‘;

P = eye(n) - A‘ * (AAt \ A);

q = A‘ * (AAt \ b);

for k = 1:MAX_ITER

% x-update

x = P*(z - u) + q;

% z-update with relaxation

zold = z;

x_hat = alpha*x + (1 - alpha)*zold; % 带松弛的更新方法

z = shrinkage(x_hat + u, 1/rho);

u = u + (x_hat - z);

% diagnostics, reporting, termination checks

history.objval(k) = objective(A, b, x);

history.r_norm(k) = norm(x - z); % primal residual

history.s_norm(k) = norm(-

11-08
06-22
12-11
01-07 3万+
02-22 3万+
03-13 1万+
11-08 4187
02-25 3310
12-12 7298

• 非常没帮助
• 没帮助
• 一般
• 有帮助
• 非常有帮助