MATLAB Answers

0

How to generate a symmetric positive definite matrix?

Asked by Riccardo Canola on 17 Oct 2018
Latest activity Commented on by Andrei Bobrov
on 2 Oct 2019
I have to generate a symmetric positive definite rectangular matrix with random values.

  0 Comments

Sign in to comment.

Tags

2 Answers

Answer by Elias Hasle on 2 Oct 2019
Edited by Elias Hasle on 2 Oct 2019
 Accepted Answer

What are the requirements to the distributions of the resulting random variables?
I think a crucial insight is that multiplying a matrix with its transpose will give a symmetrical square matrix.

  1 Comment

m = 4;
ii = rand(m);
out = ii*ii.';

Sign in to comment.


Answer by madhan ravi
on 17 Oct 2018
Edited by madhan ravi
on 17 Oct 2018

  4 Comments

Show 1 older comment
m = 4;
ii = rand(sum(1:m),1);
out = ii(symdec(m,0));
Andrei your solution does not produce necessary sdp matrix (which does not meant the matrix elements are positive)
I agree with you, Bruno.

Sign in to comment.