BookmarkSubscribeRSS Feed
logbaseten
Fluorite | Level 6

I have a weird question and I dunno if this can be answered, but Im looking for info on comparing the speed/efficiency of IML vs. other software like R or Matlab.  Trying to convince a colleague that IML performs better than R and looking for existing info.  So any resources or ideas would be dope!

2 REPLIES 2
Rick_SAS
SAS Super FREQ

An issue with your question is that "performance" depends  on 

1) What you are trying to accomplish, and

2) How well you program it in each language

In matrix/vector languages, a well-written program will outperform a badly written program. A well-written program will vectorize most operations. For example, you can compare the performance of various operations that use Level-1, Level-2, and Level-3 BLAS (basic linear algebra subroutines). 

 

I have written many blog posts about how to write an efficient program in SAS/IML. Some of them are tagged with a "vectorization" keyword to indicate that the program includes a vectorized step that results in better performance compared to a naive implementation. 

 

Full disclosure: I work at SAS and develop the SAS/IML language. In my opinion, these languages are comparable in terms of performance for many common data analysis tasks, so you might want to use other criteria to guide you.

  • SAS/IML is integrated with the rest of SAS and shares syntax with the DATA step, so the workflow (DATA step, procedures, IML,...) for SAS programmers is straightforward. SAS/IML doesn't try to support every analysis natively. Instead, programmers call other procedures for statistical analysis and visualization and use IML for computing things that are not available elsewhere. Browse my blog  (search: "proc iml" site:blogs.sas.com) for hundreds of examples.
  • MATLAB has a huge fan-base among engineers, numerical analysts, and signal processing. 
  • R is best known for its packages, which provide a way to access statistical computations in every imaginable area of statistical research, visualization,  and niche applications.
  • SAS/IML is excellent at statistical simulation. I have written many blog posts (and a book) about how to simulate data in SAS.
  • Support: Each language has communities that support its users. You might want to browse those communities to see which are friendly and focused. (SAS also provides free Technical Support for customers.)

One last comment: Since the mid 2000s, SAS has supported calling R from a SAS/IML program. Since then, other products in SAS also enable you to call R. In SAS Viya, you can use R to call actions (including the IML action). So the question does not need to be SAS or R. Your solutions can include both SAS and R.

 

Now I will bow out and let others express their opinions. Good luck!

 

logbaseten
Fluorite | Level 6

@Rick_SAS,

 

Thanks for the info and thorough response! 

Yeah I know that my question was vague and a little difficult to answer (my bad), partly because I dunno exactly what is out there and cuz Im open to different feedback people may have. Optimally, I wanted an apples-to-apples runtime comparison for common matrix operations, knowing that may be a pipe dream. 

 

So thank you for your feedback, your attempt to answering my question, and your references. I’ve seen your blog and I was wishing that you would chime in because, many a posts you’ve written, I have found useful.

 

Your comment about calling R from IML is money. It rings a bell but I totally forgot about it and never tried it but that is rad. Truthfully, that alone should be sufficient to convince my colleagues to roll with SAS since thats the best of both worlds. Great that it’s now SAS and R and not SAS or R! More open source integration, the better, IMHO.

SAS INNOVATE 2024

innovate-wordmarks-white-horiz.png

SAS is headed back to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team.

Interested in speaking? Content from our attendees is one of the reasons that makes SAS Innovate such a special event!

Submit your idea!

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
  • 505 views
  • 4 likes
  • 2 in conversation