Solving constrained optimization problem

조회 수: 4 (최근 30일)
Ali Alansari
Ali Alansari 2022년 2월 14일
편집: Ali Alansari 2022년 2월 17일
I am trying to implement the following probelm into MATLAB. I have matrix A defined and am trying to solve the optimization problem, but I am not sure which is the best approach and how to implent it given the constraint. How can I implement argmin for A and h in this case?

채택된 답변

John D'Errico
John D'Errico 2022년 2월 15일
편집: John D'Errico 2022년 2월 15일
No problem. Build the matrix A. There is no need to transpose the A_i submatrices, then transpose the result again. Just learn to use VERTICAL catenation. So
A = [A_1;A_2;...]
etc. That is, learn what the semicolon does, or learn to use the vertcat function.
Now you have a simple homogeneous linear least squares problem, so a zero right hand side. Solve it using SVD. That is, the solution that minimizes the norm you want, AND has norm(h) == 1, is given by an appropriate column (actually, the last column) of the matrix V, as returned by svd.
[~,~,V] = svd(A);
h = V(:,end);
If the matrix A has less than full rank, then there may be multiple vectors h that satisfy the requirement, but you did not ask for uniqueness, or for all possible solutions in that case. You can simply discard the first two arguments, thus U and S as returned from the SVD, as I did here.
  댓글 수: 4
Bruno Luong
Bruno Luong 2022년 2월 17일
"Are there other methods to compute H? After implementing this method, the results were a bit off compared to what I expected"
Show us the quantities
norm(A*h)/norm(h)
with h from SVD and the one that you expect. If the (singular space) null space has dimension > 1, you might get different h with the same smallest singular value.
Ali Alansari
Ali Alansari 2022년 2월 17일
편집: Ali Alansari 2022년 2월 17일
I don't have an expected value of h, however, I am using h in a calibration process to map between radar data and location as detected by a camera. I used all the data as training data just to test out the results expecting low percent differences between the calibrated data and the measured data. For the majority it seems good except for a few outliers so I think I should just collect more data points to improve the results, as even the different methods for finding h provided the same result.
When I calculate the ratio that you mentioned it is <1 (roughly 0.046)
Thank you all for your help I really appreciate it!

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

추가 답변 (1개)

Bruno Luong
Bruno Luong 2022년 2월 17일
A=randn(6,2)
A = 6×2
0.0044 -0.7364 -1.8992 -0.5647 0.5874 -1.1350 2.4187 -0.6012 -0.2084 0.0031 0.7188 -0.8987
[h,lambdamin] = svds(A.',1,'smallest')
h = 2×1
0.2228 0.9749
lambdamin = 1.7118

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by