How to generate random positive semi-definite matrix with ones at the diagonal positions?

2 ビュー (過去 30 日間)
I can create random positive semi-definite matrix, but how to force the ones at the diagonal positions? I need a random correlation matrix.

採用された回答

Abhiram Bhanuprakash
Abhiram Bhanuprakash 2015 年 5 月 26 日
Hi Mr. M,
I went through the code in the File Exchange submission 'RandomCorr.m' which you mentioned.
I could see that, in line 62 of that code,
p=min(eig(C));
So I guess this is to check whether the minimum eigen value of the correlation matrix is >= 0 (in other words, to check if the correlation matrix 'C' is PSD or not)
But, I am not sure about the variable 'K'. Perhaps if you refer to the paper or contact the author of the File Exchange submission himself, you would get a better answer.
See a related post here
Hope this helps,
Cheers!
Abhiram

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by