turn on suggestions

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

Showing results for

Find a Community

Topic Options

- 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
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-13-2013 10:45 AM

Dear All,

I have a long time series of a covariance matrix stored in a sas dataset. For each observation, there are 7 variables variables like:

"date c11 c21 c31 c22 c32 c33"

where c11 - c33 are the lower triangle elements of the cov-matrix.

In order to make use of some matrix routines in IML, I would like to convert each row into a full matrix:

M= { c11 c21 c31,

c21 c22 c32,

c31 c32 c33 }

Could someone provide some suggestions on the transformation please?

Thanks you!

Accepted Solutions

Solution

05-14-2013
07:33 AM

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

Posted in reply to 1MoreThing

05-14-2013 07:33 AM

Have a look at the SQRSYM and SQRVECH functions which are designed for doing exactly this. If you have read your six variables into the matrix x, something like:

M=sqrvech(x[i,]);

should do the trick for the ith row.

All Replies

Solution

05-14-2013
07:33 AM

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

Posted in reply to 1MoreThing

05-14-2013 07:33 AM

Have a look at the SQRSYM and SQRVECH functions which are designed for doing exactly this. If you have read your six variables into the matrix x, something like:

M=sqrvech(x[i,]);

should do the trick for the ith row.