Page 1 of 1
Single elements of a matrix: how to get
Posted: Sun Mar 23, 2014 10:03 am
by hum2004
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?
Re: Single elements of a matrix: how to get
Posted: Sun Mar 23, 2014 10:33 am
by EViews Gareth
I don't understand what you are asking.
Re: Single elements of a matrix: how to get
Posted: Mon Mar 24, 2014 2:27 am
by hum2004
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.
Re: Single elements of a matrix: how to get
Posted: Mon Mar 24, 2014 9:00 am
by EViews Gareth
You're mixing up vectors/series and groups/matrices. Everything is in series/group form, or is it in vector/matrix form?
Re: Single elements of a matrix: how to get
Posted: Mon Mar 24, 2014 9:09 am
by hum2004
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
Re: Single elements of a matrix: how to get
Posted: Mon Mar 24, 2014 9:35 am
by EViews Gareth
Something like:
Code: Select all
series result = dod(@rimax(ir))
show result