[*] functions marked by [*] operate on mxn matrices in the same way they operate on the corresponding m*n-length column vector. Remarks:
Functions in alphabetical order
prox_quadratic
Usage: prox_quadratic(x,A,b,alpha)
Input:
x - vector to be projected
A - positive semidefinite matrix
b - vector
alpha - positive scalar
Method: employs the formula
where
Example: the prox of the vector [2;3] w.r.t. the quadratic function f with A=[2,1;1,2] and b= [1;-1] is
>> A=[2,1;1,2];b=[1;-1]; >> prox_quadratic([2;3],A,b,1) ans = -0.1250 1.3750 Usage: prox_Euclidean_norm(x,alpha)
Input:
x - point to be projected (vector/matrix)
alpha - positive scalar
Method: employs the formula
Example: the prox of the matrix [2,3,1;0,1,4] w.r.t. the function g(x)=norm(x,'fro') is computed the commands
>> A=[2,3,1;0,1,4]; >> prox_Euclidean_norm(A,1) ans = 1.6408 2.4612 0.8204 0 0.8204 3.2816 Usage: prox_l1(x,alpha)
Input:
x - point to be projected (vector/matrix)
alpha - positive scalar
Method: employs the formula
Example: the prox of the vector [4;2;3] w.r.t. the function g(x)=2*norm(x(:),1) is
>> prox_l1([4;2;3],2) ans = 2 0 1 Usage: prox_neg_sum_log(x,alpha)
Input:
x - point to be projected (vector/matrix)
alpha - positive scalar
Method: employs the formula
Example: the prox of the vector [2;3;1] w.r.t. the function g(x)=-sum(sum(log(x))) is
>> prox_neg_sum_log([2;3;1],1) ans = 2.4142 3.3028 1.6180 Usage: prox_linf(x,alpha)
Input:
x - point to be projected (vector/matrix)
alpha - positive scalar
Method: employs the formula
(utilizes the function proj_l1_ball)
Example: the prox of the vector [1;2;3;4] w.r.t. the function g(x)=2*norm(x(:),Inf) is
>> x=[1;2;3;4]; >> prox_linf(x,2) ans = 1.0000 2.0000 2.5000 2.5000 The same result will be obtained if the vector will be reshaped as a 2x2 matrix and then reshaped back to a 4-length column vector
>> X=reshape(x,2,2) X = 1 3 2 4 >> prox_linf(X,2) ans = 1.0000 2.5000 2.0000 2.5000 Usage: prox_max(x,alpha)
Input:
x - point to be projected (vector/matrix)
alpha - positive scalar
Method: employs the formula
(utilizes the function proj_simplex)
Example: the prox of the vector [1;2;3;4] w.r.t. the function g(x)=max(x(:)) is
>> prox_max([1;2;3;4],1) ans = 1.0000 2.0000 3.0000 3.0000 Usage: prox_Huber(x,mu,alpha)
Input:
x - point to be projected (vector/matrix)
mu - positive scalar
alpha - positive scalar
Method: employs the formula
Example: the prox of the vector [1;2;3;4] w.r.t. twice Huber function with parameter 3 is
>> prox_Huber([1;2;3;4],3,2) ans = 0.6349 1.2697 1.9046 2.5394 prox_sum_k_largest
Usage: prox_sum_k_largest(x,k,alpha)
Input:
x - point to be projected (vector/matrix)
k - positive integer
alpha - positive scalar
Method: employs the formula
(utilizes the function
)
Example: the prox of the vector [1;2;3;4] w.r.t. the function g(x)=2x[1]+2x[2] is
>> prox_sum_k_largest([1;2;3;4],2,2) ans = 1.0000 1.5000 1.5000 2.0000 The prox of the vector [1;2;3;4] w.r.t. the function g(x)=3x[1] is
>> prox_sum_k_largest([1;2;3;4],1,3) ans = 1.0000 2.0000 2.0000 2.0000 Obviously, since x[1]=max(x), the same result can be obtain using the function prox_max
>> prox_max([1;2;3;4],3) ans = 1.0000 2.0000 2.0000 2.0000 Usage: prox_sum_k_largest_abs(x,k,alpha)
Input:
x - point to be projected (vector/matrix)
k - positive integer
alpha - positive scalar
Method: employs the formula
(utilizes the function
)
Example: the prox of the vector [1;0;-1;2] w.r.t. the function g(x)=|x<1>|+|x<2>| is
>> prox_sum_k_largest_abs([1;0;-1;2],2,1) ans = 0.5000 0 -0.5000 1.0000 Essentially the same result is obtained (but reshaped as a matrix) if we compute the prox of the matrix [1,0;-1,2] w.r.t. the same function
>> prox_sum_k_largest_abs([1,0;-1,2],2,1) ans = 0.5000 0 -0.5000 1.0000 the prox of [1;0;-1;2] w.r.t. norm(x,'Inf') can be computed by either prox_sum_k_largeat_abs
prox_sum_k_largest_abs([1;0;-1;2],1,1) ans = 1 0 -1 1 or by prox_linf
>> prox_linf([1;0;-1;2],1) ans = 1 0 -1 1 Usage: prox_norm2_linear(x,A,alpha)
Input:
x - vector to be projected
A - matrix
alpha - positive scalar
Method: employs the formula
where
The root is found by bisection.
Example: the prox of the vector [1;2;3] w.r.t. the function
is
>> prox_norm2_linear([1;2;3],[1,-1,0;0,1,-1],1) ans = 1.7071 2.0000 2.2929 To compute the prox of [1;2;3] w.r.t. the l2-norm function we can use prox_norm2_linear and the result is obviously the same as the one produced by prox_Eulidean_norm
>> prox_norm2_linear([1;2;3],eye(3),1) ans = 0.7327 1.4655 2.1982 >> prox_Euclidean_norm([1;2;3],1) ans = 0.7327 1.4655 2.1982 Usage: prox_l1_squared(x,alpha)
Input:
x - point to be projected (vector/matrix)
alpha - positive scalar
Method: employs the formula
where
with
Example: the prox of the matrix [1,2;2,3] (treated as a 4-length column vector) w.r.t. twice the l1-squared norm function is
>> prox_l1_squared([1,2;2,3],2)
ans =
0 0
0 0.6000
Usage: prox_max_eigenvalue(X,alpha)
Input:
X - symmetric matrix to be projected
alpha - positive scalar
Method: employs the formula
where
Example: the prox of the matrix [1,2,0;2,1,2;0,2,1] w.r.t. the maximum eigenvalue function is
>> prox_max_eigenvalue( [1,2,0;2,1,2;0,2,1],1) ans = 0.7500 1.6464 -0.2500 1.6464 0.5000 1.6464 -0.2500 1.6464 0.7500 Usage: prox_neg_log_det(X,alpha)
Input:
X - symmetric matrix to be projected
alpha - positive scalar
Method: employs the formula
where
is a spectral decomposition of X.
Example: the prox of the matrix [1,2;2,1] w.r.t. the function f(X)=-logdet(X) is
>> prox_neg_log_det([1,2;2,1],1) ans = 1.9604 1.3424 1.3424 1.9604 Usage: prox_sum_k_largest_eigenvalues(X,k,alpha)
Input:
X - symmetric matrix to be projected
k - positive integer
alpha - positive scalar
Method: employs the formula
where
Example: the prox of the matrix [1,2,0;2,1,2;0,2,1] w.r.t. the sum of the first and second eigenvalues is
>> prox_sum_k_largest_eigenvalues([1,2,0;2,1,2;0,2,1],2,1) ans = 0.2500 1.6464 0.2500 1.6464 0.5000 1.6464 0.2500 1.6464 0.2500 Usage: prox_spectral(X,alpha)
Input:
X - matrix to be projected
alpha - positive scalar
Method: employs the formula
Example: the prox of the matrix [1,2,3;4,5,6] w.r.t. the function 2*norm(X,2) is
>> prox_spectral([1,2,3;4,5,6],2) ans = 0.6688 1.5625 2.4561 3.2092 3.9553 4.7014 Usage: prox_nuclear(X,alpha)
Input:
X - matrix to be projected
alpha - positive scalar
Method: employs the formula
Example: the prox of the matrix [1,2,3;4,5,6] w.r.t. the nuclear norm is
>> prox_nuclear([1,2,3;4,5,6],1) ans = 1.4089 1.8613 2.3137 3.3640 4.4441 5.5242 Usage: prox_Ky_Fan(X,k,alpha)
Input:
X - matrix to be projected
k - positive integer
alpha - positive scalar
Method: employs the formula
Example: the prox of the matrix [1,2,3,4;5,6,7,8;9,10,11,12] w.r.t.
is
>> prox_Ky_Fan([1,2,3,4;5,6,7,8;9,10,11,12],2,2) ans = 1.9556 2.2518 2.5480 2.8441 4.9028 5.6453 6.3878 7.1303 7.8499 9.0387 10.2276 11.4164 The prox of the same matrix w.r.t. f(X)=max(svd(X)) is
>> prox_Ky_Fan([1,2,3,4;5,6,7,8;9,10,11,12],1,1) ans = 0.9166 1.9039 2.8913 3.8786 4.7908 5.7591 6.7274 7.6958 8.6651 9.6143 10.5636 11.5129 This is the same result as the prox w.r.t. the spectral norm
>> prox_spectral([1,2,3,4;5,6,7,8;9,10,11,12],1) ans = 0.9166 1.9039 2.8913 3.8786 4.7908 5.7591 6.7274 7.6958 8.6651 9.6143 10.5636 11.5129 The prox of the matrix w.r.t. the nuclear norm can be computed by either prox_Ky_Fan or prox_nuclear
>> prox_Ky_Fan([1,2,3,4;5,6,7,8;9,10,11,12],3,1) ans = 1.5682 2.1616 2.7551 3.3485 4.9772 5.8329 6.6885 7.5441 8.3863 9.5041 10.6219 11.7397 >> prox_nuclear([1,2,3,4;5,6,7,8;9,10,11,12],1) ans = 1.5682 2.1616 2.7551 3.3485 4.9772 5.8329 6.6885 7.5441 8.3863 9.5041 10.6219 11.7397 |