Re: Least square minimization, particular case



"John D'Errico" <woodchips@xxxxxxxxxxxxxxxx> wrote in
message <g2joiu$hnc$1@xxxxxxxxxxxxxxxxxx>...
"Emilie Nf" <emilie@xxxxxxxxx> wrote in message
<g2jl02$q84$1@xxxxxxxxxxxxxxxxxx>...
Hi all,

I am facing a least square minimization problem of the
form:
D=x*S + e
Where:
- d is a row vector of size n, known data
- x is a row vector of size k, my unknown
- S is a matrix of size (k,n), known data
- E is a vector of size n, the error to minimize

I want to minimize the error e, knowing D and S and with
the following constraints on x:
- all the values of the vector x must be positive
- their sum must be 1.

Usually, the least square problem is of the form D=S*x + e,
and algorithms have been done with the non-negativity
constraint for this equation.

Nevertheless, I have no idea of how to solve my particular
problem.

As Roger points out, transposing the
problem puts it in your standard form.

The problem is you will then need to
use a tool that can handle both your
non-negativity constraints as well as
the sum constraint, which is an equality
constraint. This will best be done with
the use of lsqlin, from the optimization
toolbox.

John

Hi
If you have no Optimization Toolbox at disposal, you may use
some function from File Exchange (FEX) collection of
functions. Say, using the function LMFnlsq (FEX Id 17534),
for the problem of nonlinear least squares
Ax - b = r,
you may declare known matrices and write the function to be
minimized:

A = S';
b = d';
w = 1e4; % user chosen weight for constraints
fun = @x [A*x - b
w*(x<0)
w*sum(x)-1];
[x,ssq,cnt] = LMFnlsq(fun,x0]

The solution is only an approximation dependent on the
chosen weight w. A problem is to set some initial estimate
x0. The closer is to the solution, the faster is a
convergence of the procedure.

Hope it helps

Mira


.



Relevant Pages

  • Re: Least square minimization, particular case
    ... I am facing a least square minimization problem of the ... d is a row vector of size n, ... the following constraints on x: ...
    (comp.soft-sys.matlab)
  • Least square minimization, particular case
    ... I am facing a least square minimization problem of the ... d is a row vector of size n, ... the following constraints on x: ...
    (comp.soft-sys.matlab)
  • Re: Rotated square in space
    ... computing coordinates of points of a square in R^3 knowing their ... images under projection to a plane from a single light source: ... adding additional constraints involving additional variables u_i: ... These polynomials generate an ideal I in the polynomial ring ...
    (sci.math)
  • Re: square through 4 points (was Re Soddy)
    ... >> square has vanished in the wind. ... > segment AB, Wolfgang said there are generally 6 solutions. ... and of course the other three constraints are similar. ... are already given then must lie in the lunes between two circles. ...
    (sci.math)
  • Re: Request for Peer Review - Refutation of Cantor Theorem Conclusion
    ... In the infinite case you are, ... YOU promised that the list would be SQUARE, ... purposes of OUR diagonal theorem. ... any constraints. ...
    (sci.logic)