re: bugs when loop thru a large group of stocks
Posted: Sat Nov 23, 2013 6:04 pm
Dear Sir,
I am using an Eviews 8 with a build of 19th November 2013. I am trying to run a CAPM market model for each stock of a group (the group contains 5000 stocks) over the 1994-2012.
While the workfile is structured as daily data, I am sampling them using quarters (smpl 1994q1 1994q1, etc) so that a regression is run on the daily observations for each stock in each quarter. I have an exclusion criteria that only stocks with more than 50 trading days available in each quarter is to be estimated.
However, each time I run this programme, Eviews just crashed. Then I tried with Eviews 7, the crash still occurred. Would you please look into this issue? Eviews has always been my favourite software as it is very efficient and convenient.
Here is the code I am using:
smpl @all
!rowcounter=2
table(10,500000) tab
tab(1, 1)="year"
tab(1,2)="quarter"
tab(1,3)="beta"
tab(1,4)="total risk"
tab(1,5)="ivol"
tab(1,6)="avail_obs"
tab(1,7)="name"
for !year=1994 to 2012
for !q=1 to 4
%date=@str(!year) + "q" + @str(!q)
smpl %date %date
for !h = 1 to ret.@count
%name= ret.@seriesname(!h)
scalar obss=@obs({%name})
if obss>=50 then
tab(!rowcounter, 1)=!year
tab(!rowcounter,2)=!q
equation eq1.ls(n) {%name}-rf c mkt_rf int
tab(!rowcounter, 3)=eq1.@coefs(2)
genr resid1=resid
resid=0
tab(!rowcounter, 5)=@stdev(resid1)*7.74597
genr new={%name}-rf
tab(!rowcounter,4)=@stdev(new)*7.74597
delete resid1
delete new
tab(!rowcounter,6)=obss
tab(!rowcounter,7)=%name
delete obss
!rowcounter=!rowcounter+1
else
endif
next
next
next
The workfile is quite large and I am not sure how I can upload it.
Thanks again for helping in this matter. Please advise whether this is my code that created the crash or is it a bug issue?
Many thanks,
SL
I am using an Eviews 8 with a build of 19th November 2013. I am trying to run a CAPM market model for each stock of a group (the group contains 5000 stocks) over the 1994-2012.
While the workfile is structured as daily data, I am sampling them using quarters (smpl 1994q1 1994q1, etc) so that a regression is run on the daily observations for each stock in each quarter. I have an exclusion criteria that only stocks with more than 50 trading days available in each quarter is to be estimated.
However, each time I run this programme, Eviews just crashed. Then I tried with Eviews 7, the crash still occurred. Would you please look into this issue? Eviews has always been my favourite software as it is very efficient and convenient.
Here is the code I am using:
smpl @all
!rowcounter=2
table(10,500000) tab
tab(1, 1)="year"
tab(1,2)="quarter"
tab(1,3)="beta"
tab(1,4)="total risk"
tab(1,5)="ivol"
tab(1,6)="avail_obs"
tab(1,7)="name"
for !year=1994 to 2012
for !q=1 to 4
%date=@str(!year) + "q" + @str(!q)
smpl %date %date
for !h = 1 to ret.@count
%name= ret.@seriesname(!h)
scalar obss=@obs({%name})
if obss>=50 then
tab(!rowcounter, 1)=!year
tab(!rowcounter,2)=!q
equation eq1.ls(n) {%name}-rf c mkt_rf int
tab(!rowcounter, 3)=eq1.@coefs(2)
genr resid1=resid
resid=0
tab(!rowcounter, 5)=@stdev(resid1)*7.74597
genr new={%name}-rf
tab(!rowcounter,4)=@stdev(new)*7.74597
delete resid1
delete new
tab(!rowcounter,6)=obss
tab(!rowcounter,7)=%name
delete obss
!rowcounter=!rowcounter+1
else
endif
next
next
next
The workfile is quite large and I am not sure how I can upload it.
Thanks again for helping in this matter. Please advise whether this is my code that created the crash or is it a bug issue?
Many thanks,
SL