View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Least-square with 2-norm constraint

Be the first to rate this file! 9 Downloads (last 30 days) File Size: 2.26 KB File ID: #27596 Version: 1.0

Least-square with 2-norm constraint


Bruno Luong (view profile)


Minimize |A*x-b|^2 such that |x| = cte

| Watch this File

File Information

This kind of problem arises in statistics, linear algebra, and regularization.

The method uses quadratic eigen-value problem (QEP).


This file inspired Trustregprob(Q,B,W,Do Equality).

MATLAB release MATLAB 7.10 (R2010a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (3)
22 Apr 2012 Matt J

Matt J (view profile)

Hi Bruno. I don't think the rank of A is the issue, because even in the following example where A is the simplest full rank matrix you can get, the same problem happens:

>> spherelsq(eye(2),[0;0],sqrt(2))

ans =


I think the real issue is that when b=0, the problem should reduce to finding the minimum singular value/vector and needs to be processed differently.

Comment only
22 Apr 2012 Bruno Luong

Bruno Luong (view profile)

Matt, true the code does not handle degenerated cases.

I recommend user to project x on on

V = Orthogonal(Kernel(A)),

formulate his/her least-square problem on this space before calling spherelsq().

Thus A is assumed to be fullrank when spherelsq() is invoked.

Comment only
20 Apr 2012 Matt J

Matt J (view profile)

Could be very useful, but the code doesn't seem to handle (or even give a warning in) certain degenerate cases. For example, in the following, not even a feasible solution is returned

>> spherelsq([1 -1; 1 -1],[0;0],sqrt(2))

ans =


Also, why not include a routine in the package that deals with the more general quadratic objective,

min. x'*H*x-g'*x
s.t. |x|=xnorm

since you convert to this form anyway, and the theory seems to accommodate it?

Comment only

Contact us