Hi
I am using the following program taken from this forum to do rolling regression of monthly stocks returns on market index. Each stock has monthly returns data and market return as well (see attached file). The estimation window moves forward one month at a time.
!iwindow = 30
!istep = 1
!length = @obsrange
equation eq1
!nrolls = @round((!length-!iwindow)/!istep)
matrix(2,!nrolls) coefmat
!j=0
for !i = !iwindow to !length
!j=!j+1
smpl @first+!i-1 @first+!i-1+!iwindow
eq1.ls sr2 c mrp
Colplace(coefmat,eq1.@coefs,!j)
next
I want to get log of the sum squared residuals after each estimation window. At the end of program I do not know how can I get a table for all these SSR . I would appreciate your help. thanks
Rolling regression
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
Rolling regression
- Attachments
-
- eviews1.wf1
- (13.96 KiB) Downloaded 524 times
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13586
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Rolling regression
Create a vector the same size as the number of estimations you'll be doing, then store the @ssr data member of the equation into that vector, in the same way you're storing the coefficients.
Re: Rolling regression
Is the following syntax correct for getting SSR after each regression, where number of obs are 30 months data points and rolling window length 1. I would appreciate your reply thanks
matrix output_ssr{!iwindow}=output{!iwindow}.@ssr
matrix output_ssr{!iwindow}=output{!iwindow}.@ssr
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13586
- Joined: Tue Sep 16, 2008 5:38 pm
Rolling regression
You need equation.@ssr
Re: Rolling regression
Hi Gareth
Many thanks for your prompt reply. Unfortunately my lack of programming skills, is this equation.@ssr be placed at the end of program?
Many thanks for your prompt reply. Unfortunately my lack of programming skills, is this equation.@ssr be placed at the end of program?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13586
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Rolling regression
It is probably better for you to read through the programming guide, and more of example programs and get an understanding of how what you currently have works, so that you can extend it more easily.
Re: Rolling regression
Hi,
I am using Rolling Regression technique using the following program. Please find attached the EViews workfile. However, after running this program, the estimated coefficients are not getting reflected in the "coefmat". Did i made an error in the program below. Kindly help me on this. Thank you so much!
!iwindow = 100
!istep = 1
!length = @obsrange
equation eq1
!nrolls = @round((!length-!iwindow)/!istep)
matrix(4,!nrolls) coefmat
!j=0
for !i = !iwindow to !length
!j=!j+1
smpl @first+!i-1 @first+!i-1+!iwindow
eq1.ls y c x1 x2 x3
Colplace(coefmat,eq1.@coefs,!j)
next
show coefmat
I am using Rolling Regression technique using the following program. Please find attached the EViews workfile. However, after running this program, the estimated coefficients are not getting reflected in the "coefmat". Did i made an error in the program below. Kindly help me on this. Thank you so much!
!iwindow = 100
!istep = 1
!length = @obsrange
equation eq1
!nrolls = @round((!length-!iwindow)/!istep)
matrix(4,!nrolls) coefmat
!j=0
for !i = !iwindow to !length
!j=!j+1
smpl @first+!i-1 @first+!i-1+!iwindow
eq1.ls y c x1 x2 x3
Colplace(coefmat,eq1.@coefs,!j)
next
show coefmat
- Attachments
-
- workfile.wf1
- (54.74 KiB) Downloaded 484 times
Last edited by pgupta on Wed Jun 19, 2013 1:02 pm, edited 1 time in total.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13586
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Rolling regression
I just ran that program on that workfile, and coefmat was filled in.
Re: Rolling regression
Thank you so much for such a quick reply. I ran it again. Same problem. Can this be something with the version? I am using EViews 7. Thanks again.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13586
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Rolling regression
Thank you again. I tried it again and it worked!!! :) :)
I just wanted to ask one more question please. Is there any way to check for autocorrelation in all the regressions(141 in this case) run under Rolling Regression program?
I just wanted to ask one more question please. Is there any way to check for autocorrelation in all the regressions(141 in this case) run under Rolling Regression program?
Who is online
Users browsing this forum: No registered users and 2 guests
