7 views (last 30 days)

Matt J
on 8 Aug 2020

Edited: Matt J
on 8 Aug 2020

In the case where k truly is <<n, you can use my KronProd class to get the minimum norm solution

k=10; n=100;

X=rand(k,n);

Ztrue=rand(n); Z=Z+Z.';

M=X*Ztrue*X.';

K=KronProd({X,X});

tic;

Z = pinv(K)*M ;

toc; %Elapsed time is 0.005358 seconds.

Naturally, you should not expect the result to equal the under-determined Ztrue.

David Goodmanson
on 8 Aug 2020

KSSV
on 9 Aug 2020

Does this match your criteria?

k = 8 ; n = 5 ;

% create dummy data

X = rand(n,k) ;

Z = rand(n) ;

Z = Z+Z' ; % make Z symmetric

D = X'*Z*X ; % known value

%% solve for Z knowing D and X

Z0 = inv(X*X')*X*D*X'*inv(X*X') ; % this is same as Z

Bruno Luong
on 9 Aug 2020

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

Start Hunting!
## 5 Comments

## Direct link to this comment

https://ww2.mathworks.cn/matlabcentral/answers/576808-recover-matrix-z-from-xzx-z-es-symmetric-and-n-by-n-while-x-is-k-by-n-where-n-k#comment_964732

⋮## Direct link to this comment

https://ww2.mathworks.cn/matlabcentral/answers/576808-recover-matrix-z-from-xzx-z-es-symmetric-and-n-by-n-while-x-is-k-by-n-where-n-k#comment_964732

## Direct link to this comment

https://ww2.mathworks.cn/matlabcentral/answers/576808-recover-matrix-z-from-xzx-z-es-symmetric-and-n-by-n-while-x-is-k-by-n-where-n-k#comment_965074

⋮## Direct link to this comment

https://ww2.mathworks.cn/matlabcentral/answers/576808-recover-matrix-z-from-xzx-z-es-symmetric-and-n-by-n-while-x-is-k-by-n-where-n-k#comment_965074

## Direct link to this comment

https://ww2.mathworks.cn/matlabcentral/answers/576808-recover-matrix-z-from-xzx-z-es-symmetric-and-n-by-n-while-x-is-k-by-n-where-n-k#comment_965107

⋮## Direct link to this comment

https://ww2.mathworks.cn/matlabcentral/answers/576808-recover-matrix-z-from-xzx-z-es-symmetric-and-n-by-n-while-x-is-k-by-n-where-n-k#comment_965107

## Direct link to this comment

https://ww2.mathworks.cn/matlabcentral/answers/576808-recover-matrix-z-from-xzx-z-es-symmetric-and-n-by-n-while-x-is-k-by-n-where-n-k#comment_965356

⋮## Direct link to this comment

https://ww2.mathworks.cn/matlabcentral/answers/576808-recover-matrix-z-from-xzx-z-es-symmetric-and-n-by-n-while-x-is-k-by-n-where-n-k#comment_965356

## Direct link to this comment

https://ww2.mathworks.cn/matlabcentral/answers/576808-recover-matrix-z-from-xzx-z-es-symmetric-and-n-by-n-while-x-is-k-by-n-where-n-k#comment_965389

⋮## Direct link to this comment

https://ww2.mathworks.cn/matlabcentral/answers/576808-recover-matrix-z-from-xzx-z-es-symmetric-and-n-by-n-while-x-is-k-by-n-where-n-k#comment_965389

Sign in to comment.