Solving constrained optimization problem

6 Ansichten (letzte 30 Tage)
Ali Alansari
Ali Alansari am 14 Feb. 2022
Bearbeitet: Ali Alansari am 17 Feb. 2022
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?

Akzeptierte Antwort

John D'Errico
John D'Errico am 15 Feb. 2022
Bearbeitet: John D'Errico am 15 Feb. 2022
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 Kommentare
Bruno Luong
Bruno Luong am 17 Feb. 2022
"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 am 17 Feb. 2022
Bearbeitet: Ali Alansari am 17 Feb. 2022
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!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Bruno Luong
Bruno Luong am 17 Feb. 2022
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

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by