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

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

06-08-2011 11:37 AM

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

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

Posted in reply to Adeline34000

06-08-2011 11:55 AM

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

Posted in reply to Hutch_sas

06-08-2011 12:12 PM

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

Posted in reply to Adeline34000

06-09-2011 06:54 AM

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

Posted in reply to Adeline34000

06-09-2011 11:21 AM

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

Posted in reply to nicolas_

06-09-2011 12:21 PM

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

Posted in reply to Adeline34000

06-10-2011 03:13 AM

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

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

Posted in reply to Adeline34000

06-10-2011 09:16 AM

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