Single elements of a matrix: how to get

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

hum2004
Posts: 12
Joined: Tue Apr 07, 2009 6:46 am

Single elements of a matrix: how to get

Postby hum2004 » Sun Mar 23, 2014 10:03 am

Dear All,

I do have a matrix (KxN) and I need to extract certain elements of this matrix.

For each row of the matrix i need just one single element out of all columnes. The problem is that the columne I am looking for is not constant. E.g. For the first 100 rows i might need the values of my matrix in the 5th row, for the next 50 rows i might need the values of my matrix in the 13 th row etc, pp.
The information -which columne is relevant for row 1....K - is in a vector (Kx1)

Do you know how to solve this problem?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13586
Joined: Tue Sep 16, 2008 5:38 pm

Re: Single elements of a matrix: how to get

Postby EViews Gareth » Sun Mar 23, 2014 10:33 am

I don't understand what you are asking.

hum2004
Posts: 12
Joined: Tue Apr 07, 2009 6:46 am

Re: Single elements of a matrix: how to get

Postby hum2004 » Mon Mar 24, 2014 2:27 am

Sorry for not beeing clear.

I have a matrix from wich i want to extract from each row one single element. The element i am looking for is not always in the same columne. The information from which column i want to draw the element is in a series (consisting numerical values).

I tried to use @columnextract! But this needs a constant arg2 so it does not help.



I can show my problem from a diifferent angle, too.

I have two groups: IR and DOD, both have the dimension 3654x100.

IR consists of rolling information ratios. DOD consists of the daily performance data. Both groups are such, that the columnes are related to the same trading model. I want to select the daily performance data at every time from the model with the max IR.

The IR group therefore indicates which performance data should be selected and can be thought of as a filter for the performance data. This is the problem to solve.

So far i did:
Series maxi= @rimax(IR)' shows for each day in which columne is the max IR-value.

Now i need to know how to extract for eachday the value in the DOD group in columne as indicated in maxi.



I would appreaciate your help very much.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13586
Joined: Tue Sep 16, 2008 5:38 pm

Re: Single elements of a matrix: how to get

Postby EViews Gareth » Mon Mar 24, 2014 9:00 am

You're mixing up vectors/series and groups/matrices. Everything is in series/group form, or is it in vector/matrix form?

hum2004
Posts: 12
Joined: Tue Apr 07, 2009 6:46 am

Re: Single elements of a matrix: how to get

Postby hum2004 » Mon Mar 24, 2014 9:09 am

What ever you want. Initially it is groups. Then i transformed into martrices because i was not able to solve my problem with groups and series

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13586
Joined: Tue Sep 16, 2008 5:38 pm

Re: Single elements of a matrix: how to get

Postby EViews Gareth » Mon Mar 24, 2014 9:35 am

Something like:

Code: Select all

series result = dod(@rimax(ir)) show result


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests