Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: constrained regression/optimization
Date: Thu, 31 Jan 2013 19:58:08 +0000 (UTC)
Organization: Xoran Technologies
Lines: 25
Message-ID: <keeicg$39v$1@newscl01ah.mathworks.com>
References: <keefrt$m0f$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1359662288 3391 172.30.248.48 (31 Jan 2013 19:58:08 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 31 Jan 2013 19:58:08 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1440443
Xref: news.mathworks.com comp.soft-sys.matlab:787880

"Jelena Ivanovic" <ivanovic.jelena@yahoo.com> wrote in message <keefrt$m0f$1@newscl01ah.mathworks.com>...
> Dear all,
> 
> I am relatively new Matlab user, and I need to find a solution for coefficients a and b in the following equation:
> 
> X=a*Y + (1-a) * [Z + b*Q + (1-b) * W]
> 
> where:
> 
> - X, Y, Z, Q and W are data vectors;
> - constant should ideally be equal to zero (but this isn't necessary);
> - 1-a, b and 1-b all need to be positive.
> 
> Is there maybe something that could be done with lsqlin from the Optimization toolbox?
==================

Yes. You can rewrite this as

 min. norm([Y Z Q W]*c - X)
 s.t.
  c(1)+c(2)=1;
  c(3)+c(4) - c(2)=0;
  c(i)>=0

Now it is exactly in the form requested by  LSQLIN