Storing residual standard errors in a recursive regression
Posted: Tue Apr 08, 2014 5:31 am
Hi
I have modified the example rolling regression programs to work as a recursive FMOLS estimation storing the recursive coefficient estimates. Everything works fine. However, in addition to storing the coefficients I would need to get the residual standard error for each recursive estimation. How could I do that?
Many thanks in advance (the current program is shown below, I use Eviews7).
' get size of workfile
!length = @obsrange
' set window size
!window = 32
' set step size
!step = 1
' declare equation for estimation
equation eq1
' calculate number of rolls
!nrolls = @round((!length-!window+1)/!step)
' matrix to store coefficient estimates
matrix(2,!nrolls) coefmat ' where 2 is the number of coefficients
' variable keeping track of how many rolls we've done
!j=0
' move sample !step obs at a time
for !i = 1 to !length-!window+1-!step step !step
!j=!j+1
' set sample to estimation period
smpl @first @first+!i+!window-2
' estimate equation
eq1.cointreg(method=fmols, trend=const, regtend=none, lag=a, info=sic, kern=Bart,bw=andrews) p di
' store coefficients
colplace(coefmat,eq1.@coefs,!j)
next
show coefmat
I have modified the example rolling regression programs to work as a recursive FMOLS estimation storing the recursive coefficient estimates. Everything works fine. However, in addition to storing the coefficients I would need to get the residual standard error for each recursive estimation. How could I do that?
Many thanks in advance (the current program is shown below, I use Eviews7).
' get size of workfile
!length = @obsrange
' set window size
!window = 32
' set step size
!step = 1
' declare equation for estimation
equation eq1
' calculate number of rolls
!nrolls = @round((!length-!window+1)/!step)
' matrix to store coefficient estimates
matrix(2,!nrolls) coefmat ' where 2 is the number of coefficients
' variable keeping track of how many rolls we've done
!j=0
' move sample !step obs at a time
for !i = 1 to !length-!window+1-!step step !step
!j=!j+1
' set sample to estimation period
smpl @first @first+!i+!window-2
' estimate equation
eq1.cointreg(method=fmols, trend=const, regtend=none, lag=a, info=sic, kern=Bart,bw=andrews) p di
' store coefficients
colplace(coefmat,eq1.@coefs,!j)
next
show coefmat