Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-03-2016 04:11 PM - edited 02-03-2016 04:12 PM

Hello,

I would like to konw which method give the best result for the matrix with the number between 0 et 1:

==> I have two matrix A and B, 0<=Aij<=1, 0<= Bij<=1

Which metho gives the best results :

1- IML Proc

or

2- proc sql

do i=1 to L;

proc sql;

create table prod as

select (...)+(....) as Vi

t1 m ,Tran_t2 n;

quit;

end;

Any documentation for that are welcomed

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-03-2016 04:45 PM

For matrix computations, use IML.

Your title says "matrix product," by which I assume you want the standard matrix multiplication:

C = A*B;

However, read this article "Ways to multiply in the SAS/IML language" if you want a different product.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-03-2016 05:27 PM

Thank you for your answer.

Yes, I want to do C=A*B

But, I can use IML proc or SQL proc , I have a small number.

Please, which method (IML or SQL) is better for the small number ?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-03-2016 06:54 PM

As I said, you should use IML for matrix computations.

All SAS procedures use double precision computations. If your numbers are so small that you think the computation will result in a numerical overflow or underflow, it probably doesn't make a difference how you perform the computation. If you post the data and a sample program, we might be able to say more.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-07-2016 06:43 AM

Thank you for your message.

As an exemple,

You can take

A= (Aij)==> 0<Aij<1

B = (Bij)==> 0<Bij<1

Methode 1: Using IML proc

C=A*B

Method 2: Using SQl poc

C= A*transpose(B)

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-03-2016 10:07 PM - edited 02-04-2016 02:58 AM

For the precise problem , you'd better use IML's function XMULT() to calculate Matrix Product.

```
z = xmult(x,y);
print z;
```

Look like FORMAT is not good for displaying precision.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-07-2016 06:46 AM

Thank you for your answer.

It is a good idea.

What's about the results found by sql proc ? C=A*transpose(B)