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-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

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