unconstrained nonlinear optimization problem

Hello,
Kindly I have a question concerning nonlinear optimization problem. I have the following problem:
How I can define this objective function in matlab?
Thank you

댓글 수: 5

Matt J
Matt J 2020년 10월 16일
편집: Matt J 2020년 10월 16일
Why fmincon? You have no constraints. You probably should add some constraints, however, because the solution is currently not unique. Since the objective depends only on the differences , adding any constant to any optimal will produce another optimal solution.
Why isn't for all i a solution? Shouldn't that make every term in the sum zero, and that ought to be the smallest possible value...
John D'Errico
John D'Errico 2020년 10월 16일
편집: John D'Errico 2020년 10월 16일
And why would you bother to use fmincon to minimize a function that can be solved using multiple linear regression in the first place?
Not only are you wanting to use a Mack truck to carry a pea to Boston, but you never even needed any truck at all. A bycycle would suffice.
And as Bjorn points out, a trivial solution exists anyway.
Matt J
Matt J 2020년 10월 16일
편집: Matt J 2020년 10월 16일
I think Bjorn mean's . The solution set is for any scalar constant c.
Heborvi
Heborvi 2020년 10월 16일
Thank you for your replies and I am sorry because there is an error in writing the optimization problem. the problem is the diference between d_{ij} and the euclidean distance between vectors. I have changed it in the question.

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

 채택된 답변

Matt J
Matt J 2020년 10월 16일
편집: Matt J 2020년 10월 16일

0 개 추천

Still, there are no constraints, so I think you should be using fminunc. Also, your revised objective function is not differentiable near theta=X, so you'll have to hope that the optimizer doesn't search there.
N=nchoosek(n,2);
I=1:N;
J=nchoosek(1:n,2);
C=(sparse(I,J(:,1),1,N,n)+sparse(I,J(:,2),-1,N,n)).';
thetaOptimal=fminunc(@(theta) P(theta,X,C,d), theta0);
function fval=P(theta,X,C,d)
%theta - pxn matrix of unknowns
% X - known pxn matrix
% d - column vector of length nchoosek(n,2)
V=vecnorm((X-theta)*C,2,1);
fval=norm(d-V(:)).^2;
end

추가 답변 (0개)

카테고리

질문:

2020년 10월 16일

편집:

2020년 10월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by