Re: Least square minimization, particular case
- From: "Miroslav Balda" <miroslav.nospam@xxxxxxxx>
- Date: Mon, 9 Jun 2008 20:07:01 +0000 (UTC)
"John D'Errico" <woodchips@xxxxxxxxxxxxxxxx> wrote in
message <g2joiu$hnc$1@xxxxxxxxxxxxxxxxxx>...
"Emilie Nf" <emilie@xxxxxxxxx> wrote in messageHi
<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
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
.
- Follow-Ups:
- Re: Least square minimization, particular case
- From: John D'Errico
- Re: Least square minimization, particular case
- From: Miroslav Balda
- Re: Least square minimization, particular case
- References:
- Least square minimization, particular case
- From: Emilie Nf
- Re: Least square minimization, particular case
- From: John D'Errico
- Least square minimization, particular case
- Prev by Date: Re: Calling a Python executable script from MATLAB
- Next by Date: Re: Problem with scatter
- Previous by thread: Re: Least square minimization, particular case
- Next by thread: Re: Least square minimization, particular case
- Index(es):
Relevant Pages
|