Optimization using lsqnonneg function

I have to find value of x that minimizes norm of|C*exp(x) - d| subject to x >= 0. I am finding the value of exp(x) that minimizes norm of|C*exp(x) - d| using lsqnonneg function of MATLAB and further I am taking logarthmic of exp(x) to find the value of x. Is this a correct approach or is there some other way in MATLAB to do so? I would appreciate suggestions.

10 件のコメント

Torsten
Torsten 2015 年 11 月 10 日
編集済み: Torsten 2015 年 11 月 10 日
minimize |C*y-(-C*ones(size(C,2))+d)|^2 subject to y>=0.
Solving this problem with lsqnonneg, x=log(y+1) will solve your original problem.
Best wishes
Torsten.
rihab
rihab 2015 年 11 月 10 日
What does this term (-C*ones(size(C,2)) indicate and why is it subtracted?
Torsten
Torsten 2015 年 11 月 10 日
exp(x)>=1 for x>=0.
So you will have to solve
min:||C*(x+1)-d||^2 subject to x>=0
Best wishes
Torsten.
rihab
rihab 2015 年 11 月 10 日
Thank you :) In the absence of constraints, will lsqnonneg function of MATLAB still solve the problem?
Torsten
Torsten 2015 年 11 月 10 日
You still have the constraint x>=0 ...
Best wishes
Torsten.
rihab
rihab 2015 年 11 月 10 日
But if I wish to solve the problem in absence of constraints, will lsqnonneg give me optimal value of the variable that will minimize the function?
Torsten
Torsten 2015 年 11 月 10 日
So which problem do you want to solve then ?
minimize the norm of ||C*exp(x)-d||^2
(without the constraint x>=0) ?
Best wishes
Torsten.
rihab
rihab 2015 年 11 月 10 日
Yes, exactly.
Torsten
Torsten 2015 年 11 月 10 日
Then solve
min: ||C*y-d||^2 subject to y>=0
with lsqnonneg. x=log(y) will be the solution of the original problem.
Best wishes
Torsten.
rihab
rihab 2015 年 11 月 10 日
thanks :)

回答 (0 件)

この質問は閉じられています。

質問済み:

2015 年 11 月 10 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by