how to find the optimal value of a matrix that minimize a function?
Show older comments
I have a matrix W which is a block diagonal matrix with dimensions
, and each of its two block diagonal is
vector. I want to find the values of its enteries that minimze the difference between the following function:
, and each of its two block diagonal is
vector. I want to find the values of its enteries that minimze the difference between the following function: 
Where: W is the required
block diagonal matrix to be optimized, B is a
matrix, H is a given
matrix, and A is a
matrix. A and B are calculated using the functions used in the attached code.
block diagonal matrix to be optimized, B is a
matrix, H is a given
matrix, and A is a
matrix. A and B are calculated using the functions used in the attached code.It tried this attached code, but I think it is now in infinte loop and I don't know what should I do?
while ((B*H)-(A*W)~=zeros(2,4))
w1=randn(1,2); % generate the first block diagonal vector with dimensions 1*2. The values of each entry of the block
% diagonal vector may be not the same.
w2=randn(1,2); % generate the second block diagonal vector with dimensions 1*2.
W=blkdiag(w1,w2); % bulid the block diagonal matrix that I want to optimize with dimmensions 2*4.
R=sqrtm(W*inv(inv(P)+(H'*inv(eye(2)+D)*H))*W'); % R is 2*2 matrix that will be used to calculate matrix A using LLL lattice
% reduction algorithm. The values of P (4*4 matrix), H (2*4 matrix) and D (2*2 matrix) are given. It's clear here that
% matrix R is a function of W.
A= LLL(R,3/4); % I use here LLL lattice reduction algorithm to obtain 2*2 matrix A which is function of R.
B=A'*W*P*H'*inv(eye(2)+D+H*P*H'); % B is 2*2 matrix which is function of A and W. The values of P (4*4 matrix),
% H (2*4 matrix) and D (2*2 matrix) are given.
end
Accepted Answer
More Answers (0)
Categories
Find more on Operating on Diagonal Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!