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;

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

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