The following programme works only for some subsamples in our period, for example 2001-2002. For other samples we have the following error: Invalid permutation index vector in "MATRIX ORDONATE=@RAPPLYRANKS(COMPAV,RANK_BETA)".
Does anyone know how to help? Thanks.
scalar k=0
for !i=1 to 1127
smpl @first @last
vector v!i= @columnextract(germany,!i)
series s!i
series returns!i
mtos(v!i,s!i)
returns!i = s!i -rate_ger
rowvector(1127) betas
smpl 1/01/2001 1/01/2002
if @obs(returns!i) >125 then
k=k+1
equation regresie.ls (returns!i) c (msci_ger-rate_ger)
rowvector(k) betasort
betasort(k)=regresie.@coefs(2)
matrix(@obsrange,k) compav
colplace(compav,returns!i,k)
endif
delete returns!i
delete s!i
delete v!i
next
smpl @first @last
matrix(4435,k) new_ordonare
matplace(new_ordonare,compav)
rowplace(new_ordonare,betasort,4435)
rowvector rank_beta=@ranks(@rowextract(new_ordonare,4435),"a")
matrix ordonate=@rapplyranks(compav,rank_beta)
Error @rapplyranks for different samples
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Error @rapplyranks for different samples
@rapplyranks isn't sample based, so it is difficult to know what is causing the error.
Re: Error @rapplyranks for different samples
Thanks for your prompt reply. I have attached the workfile I on on.(due to the size limit of 2 mb, I have created and attached several archives.). I will post the program again, with a sample that gives that error. The program creates and fills the matrix of companies available, the matrix including the rowvector that we want to use for sorting, however it gives the error when it comes to the @rapplyranks line. As I previously mentioned, this program works well for some subsamples, for example, 1/01/2001 1/01/2002. Could you please take a look at the workfile and program and maybe tell me what am I doing wrong. Thank you!
scalar k=0
for !i=1 to 1127
smpl @first @last
vector v!i= @columnextract(germany,!i)
series s!i
series returns!i
mtos(v!i,s!i)
returns!i = s!i -rate_ger
rowvector(1127) betas
smpl 1/03/1994 1/02/1995
if @obs(returns!i) >125 then
k=k+1
equation regresie.ls (returns!i) c (msci_ger-rate_ger)
rowvector(k) betasort
betasort(k)=regresie.@coefs(2)
matrix(@obsrange,k) compav
colplace(compav,returns!i,k)
endif
delete returns!i
delete s!i
delete v!i
next
smpl @first @last
matrix(4435,k) new_ordonare
matplace(new_ordonare,compav)
rowplace(new_ordonare,betasort,4435)
rowvector rank_beta=@ranks(@rowextract(new_ordonare,4435),"a")
matrix ordonate=@rapplyranks(compav,rank_beta)
scalar k=0
for !i=1 to 1127
smpl @first @last
vector v!i= @columnextract(germany,!i)
series s!i
series returns!i
mtos(v!i,s!i)
returns!i = s!i -rate_ger
rowvector(1127) betas
smpl 1/03/1994 1/02/1995
if @obs(returns!i) >125 then
k=k+1
equation regresie.ls (returns!i) c (msci_ger-rate_ger)
rowvector(k) betasort
betasort(k)=regresie.@coefs(2)
matrix(@obsrange,k) compav
colplace(compav,returns!i,k)
endif
delete returns!i
delete s!i
delete v!i
next
smpl @first @last
matrix(4435,k) new_ordonare
matplace(new_ordonare,compav)
rowplace(new_ordonare,betasort,4435)
rowvector rank_beta=@ranks(@rowextract(new_ordonare,4435),"a")
matrix ordonate=@rapplyranks(compav,rank_beta)
- Attachments
-
- germ.part03.rar
- (1.91 MiB) Downloaded 193 times
-
- germ.part02.rar
- (1.91 MiB) Downloaded 198 times
-
- germ.part01.rar
- the workfile
- (1.39 MiB) Downloaded 200 times
Re: Error @rapplyranks for different samples
I have attached here the rest of the archives from the workfile.
- Attachments
-
- germ.part05.rar
- (711.6 KiB) Downloaded 189 times
-
- germ.part04.rar
- (1.91 MiB) Downloaded 199 times
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Error @rapplyranks for different samples
As I suspected, it has nothing to do with the sample.
For the iteration that is causing the error, your ranks vector, rank_betas has three values that are identical. Thus it cannot be used to apply ranks, since each value in the ranking vector has to be a unique integer.
For the iteration that is causing the error, your ranks vector, rank_betas has three values that are identical. Thus it cannot be used to apply ranks, since each value in the ranking vector has to be a unique integer.
Who is online
Users browsing this forum: No registered users and 1 guest
