Turn on suggestions

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

Showing results for

Options

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 06-08-2011 11:37 AM
(1336 views)

Hello,

I am a french student and i am studying an article where there is a SAS/IML code.

In this code, DES is a matrix of parameters, DELTA and EST are vectors. Delta={0,0,0,0} and EST is the vector of parameter estimates.

We calculate lambda=exp(DES*(-EST)) so lambda is a vector.

Then, to calculate the exposure at different time intervals (4 intervals) until time t=0 :

lambda_delta_t1=lambda # DELTA

In my application, # don't work because lambda and delta are vectors. I don't know how to do and I don't understand.

Thank you

I am a french student and i am studying an article where there is a SAS/IML code.

In this code, DES is a matrix of parameters, DELTA and EST are vectors. Delta={0,0,0,0} and EST is the vector of parameter estimates.

We calculate lambda=exp(DES*(-EST)) so lambda is a vector.

Then, to calculate the exposure at different time intervals (4 intervals) until time t=0 :

lambda_delta_t1=lambda # DELTA

In my application, # don't work because lambda and delta are vectors. I don't know how to do and I don't understand.

Thank you

7 REPLIES 7

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

The # operator is element-wise multiplication, so it should work with two vectors provided the dimensions match up correctly. Both operands should be the same type (m x 1 or 1 x m) vector and have the same number of elements. It would be helpful to look at the article to better understand the author's intentions.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

http://aje.oxfordjournals.org/content/171/7/837.full

You can see the code in appendix 3.

Thank you very much

You can see the code in appendix 3.

Thank you very much

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hello,

Can you at least explain to me what # should do between 2 vectors.

For example:

A={1,2,3,4};

B={5,6};

Is A#B={ 1*5 2*5 3*5 4*5,

1*6 2*6 3*6 4*6}

or A#B={1*5 1*6,

2*5 2*6,

3*5 3*6,

4*5 4*6}

?

Can you at least explain to me what # should do between 2 vectors.

For example:

A={1,2,3,4};

B={5,6};

Is A#B={ 1*5 2*5 3*5 4*5,

1*6 2*6 3*6 4*6}

or A#B={1*5 1*6,

2*5 2*6,

3*5 3*6,

4*5 4*6}

?

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hi,

The code you posted just results in an error as the dimensions of both vectors don't match.

You can find the answer to your question in the following blog post.

http://blogs.sas.com/iml/index.php?/archives/48-Shorthand-Notation-for-Row-and-Column-Operations.htm...

Nicolas

The code you posted just results in an error as the dimensions of both vectors don't match.

You can find the answer to your question in the following blog post.

http://blogs.sas.com/iml/index.php?/archives/48-Shorthand-Notation-for-Row-and-Column-Operations.htm...

Nicolas

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hi,

My dimensions are correct according to the article:

lambda is a vector with 4304 rows

delta is a vector with 4 rows

I need to understand what the result of this operation is, to compute it on R.

What I have done today, but I think it's not correct because my final result are negative and they don't have to be it's:

lambda # delta = matrix with 4304 rows and 4 columns where

column i is lambda*delta(i)

Do you think I am right ?

The blog don't talk about operation between two vectors, and it's my problem. Message was edited by: Adeline34000

My dimensions are correct according to the article:

lambda is a vector with 4304 rows

delta is a vector with 4 rows

I need to understand what the result of this operation is, to compute it on R.

What I have done today, but I think it's not correct because my final result are negative and they don't have to be it's:

lambda # delta = matrix with 4304 rows and 4 columns where

column i is lambda*delta(i)

Do you think I am right ?

The blog don't talk about operation between two vectors, and it's my problem. Message was edited by: Adeline34000

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

PLease, nobody can tell me what result # should give between two vectors??

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

It doesn't do anything as the dimensions don't match up. If you execute the code as you say you get errors.

**Available on demand!**

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

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.