Linear least-square optimization problem, help!

Hi, I'm stuck in one optimization problem by using Matlab. The problem is defined as below.
X1 (361 by 361) * lambda (361 by 1) = Y1 (361 by 1)
X2 (361 by 361) * lambda (361 by 1) = Y2 (361 by 1)
X3 (361 by 361) * lambda (361 by 1) = Y3 (361 by 1)
...
X158 (361 by 361) * lambda (361 by 1) = Y158 (361 by 1)
I'm trying to find the optimal non-negative lambda minimizing the sum of squared error between Y and predicted Y. And, I have 158 examples. Please give any clues to solve this problem!

답변 (1개)

John D'Errico
John D'Errico 2017년 7월 30일
편집: John D'Errico 2017년 7월 30일

1 개 추천

WTP? If it is the same vector lambda that must apply to all cases, then you have ONE nonnegative (but linear) least squares problem, with 361*150 rows, and 361 columns.
Concatenate the matrices into ONE array. Then call lsqnonneg.
This is NOT an optimization problem. Only lsqnonneg is required.
And, by the way, next time, don't be foolish and create numbered variables. Instead, learn to use multidimensional arrays or cell arrays. Your code will improve, making this into a trivial problem.

댓글 수: 1

HOJIN JANG
HOJIN JANG 2017년 7월 30일
편집: HOJIN JANG 2017년 7월 30일
You're right, it can be solved by just concatenating all of samples and using lsqnonneg. Thanks!

댓글을 달려면 로그인하십시오.

카테고리

질문:

2017년 7월 30일

편집:

2017년 7월 30일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by