No BSD License  

2.66667
2.7 | 3 ratings Rate this file 12 Downloads (last 30 days) File Size: 1.94 KB File ID: #10908 Version: 1.0

active set algorithm

by

Uriel Roque (view profile)

 

28 Apr 2006 (Updated )

solve linear least squares problem with nonnegative variables

| Watch this File

File Information
Description

This function solves linear least squares problem with nonnegative variables using the active set algorithm described in:
Portugal, Judice and Vicente, A comparison of block pivoting and interior point algorithms for linear least squares problems with nonnegative variables, Mathematics of Computation, 63(1994), pp. 625-643

Acknowledgements

This file inspired Lbfgsb (L Bfgs B) Mex Wrapper and Zero Sr1.

MATLAB release MATLAB 7.1.0 (R14SP3)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (3)
17 Apr 2007 Greg Reynolds

I experienced the same bug as the first comment.

01 Mar 2007 Christos B.

No comments.....

>> activeset(rand(13,3),rand(13,1))
??? Attempted to access r(1); index out of bounds because numel(r)=0.

Error in ==> activeset at 32
r = r(1);

>> activeset(rand(13,3),rand(13,1))
??? Attempted to access r(1); index out of bounds because numel(r)=0.

Error in ==> activeset at 32
r = r(1);

>> activeset(rand(13,3),rand(13,1))
??? Attempted to access r(1); index out of bounds because numel(r)=0.

Error in ==> activeset at 32
r = r(1);

>> activeset(rand(13,3),rand(13,1))
??? Attempted to access r(1); index out of bounds because numel(r)=0.

Error in ==> activeset at 32
r = r(1);

>> activeset(rand(13,3),rand(13,1))

ans =

0
0.5812
0.3521

>>

28 Apr 2006 John D'Errico

A few quick tests. The numbers can speak for themselves.

m=50;m=2*n;A=rand(n,m);b=rand(n,1);
tic,[x,y] = activeset(A,b);toc
Elapsed time is 0.089039 seconds.

tic,x0 = lsqnonneg(A,b);toc
Elapsed time is 1.265998 seconds.

std(x-x0)
ans =
2.5407e-16

m=10;n=20*m;A=rand(n,m);b=rand(n,1);
tic,[x,y] = activeset(A,b);toc
Elapsed time is 0.017188 seconds.

tic,x0 = lsqnonneg(A,b);toc
Elapsed time is 0.020343 seconds.

m=200;n=m;A=rand(n,m);b=rand(n,1);
tic,x0 = lsqnonneg(A,b);toc
Elapsed time is 10.426879 seconds.

tic,[x,y] = activeset(A,b);toc
Elapsed time is 0.245311 seconds.

What else is there to say? The help is reasonable, though not expansive. Lsqnonneg returns a bit more in terms of secondary information.

Did I forget to tell you to look at the times? Well done.

Contact us