BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Abyt
Calcite | Level 5

Anyone who will inform me how to generate Skew Symmetric Matrices in SAS/iml, please? Similarly a SAS/IML code to create a Full rank matrix, please? I thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

Just as Rick said, show what you have tried ,that is benefit to you and us .

Check if  the following code is what you need .

 

proc iml;
A=j(8,4);
call randseed(12345678);
call randgen(A,'normal');
cov=cov(A);
idx=loc(row(cov)<col(cov));
cov[idx]=-cov[idx];
skew_symmetric_matrix=cov;

matrix_rank=round(trace(ginv(skew_symmetric_matrix)*skew_symmetric_matrix));
print skew_symmetric_matrix ,matrix_rank;
quit;

View solution in original post

2 REPLIES 2
Rick_SAS
SAS Super FREQ

Although homework questions are welcome, when you ask for help you need to show what you've tried so far. Explain what you know and what you are confused about. Post some PROC IML code that indicates how you are attempting to solve the problem.

 

Here's a hint: A square matrix is skew-symmetric if A` = -A. Therefore you want to construct a matrix such that A[i,j] = -A[j,i] for all i,j.

Ksharp
Super User

Just as Rick said, show what you have tried ,that is benefit to you and us .

Check if  the following code is what you need .

 

proc iml;
A=j(8,4);
call randseed(12345678);
call randgen(A,'normal');
cov=cov(A);
idx=loc(row(cov)<col(cov));
cov[idx]=-cov[idx];
skew_symmetric_matrix=cov;

matrix_rank=round(trace(ginv(skew_symmetric_matrix)*skew_symmetric_matrix));
print skew_symmetric_matrix ,matrix_rank;
quit;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 2 replies
  • 852 views
  • 0 likes
  • 3 in conversation