Page 1 of 1
ROLLREG—rolling (linear) regressions
Posted: Fri Jun 25, 2010 1:25 pm
by TomDoan
@ROLLREG is a modernization of the Bank of Canada's
ROLLREG procedure, which was written originally for version 4. This does three types of "rolling" linear regressions; the most important of which is done with the
MOVE option; that does a moving window of a fixed width. (The
ADD option can be done more efficiently and with more options using the
RLS instruction).
Detailed description
Re: ROLLREG - rolling (linear) regressions
Posted: Fri May 27, 2011 11:39 am
by challenges
Dear all,
I have to implement in the rollreg.src a normality test of Jarque-Bera on the residuals of my regression at each iteration inside my loop. I do not need to save my residuals, but I need to print the statistics of my test as well as the p-values associated to the test. Could you please help me? I have tried to do it myself but I got errors in my program.
Thank you in advance.
Re: ROLLREG - rolling (linear) regressions
Posted: Mon Jun 06, 2011 9:04 am
by TomDoan
challenges wrote:Dear all,
I have to implement in the rollreg.src a normality test of Jarque-Bera on the residuals of my regression at each iteration inside my loop. I do not need to save my residuals, but I need to print the statistics of my test as well as the p-values associated to the test. Could you please help me? I have tried to do it myself but I got errors in my program.
Thank you in advance.
If you do a STATISTICS instruction on the residuals, it will produce %JBSTAT and %JBSIGNIF as the J-B statistic and p-value. You would just need to save those into a series the way the F-statistics are saved in the revised procedure that I posted.
Re: ROLLREG - rolling (linear) regressions
Posted: Mon Jul 09, 2012 8:35 am
by basher
Hi Tom,
I am using your revised rollreg procedure for a regression of "y" on "x". As I also want to perform a hypothesis test on the slope of "x" (i.e. b=1), I replaced
if %defined(fhistory) ; compute fhistory(cut)=%fstat
with
test(noprint)
# 2
# 1
if %defined(fhistory) ; compute fhistory(cut)=%fstat
every place the first line occurs in the revised ROLLREG. However, when I write "print FHISTORY", I get error message. Also, how can I obtain the associated standard errors for the slope coefficients (along with the f-stat)? Thank you.
Re: ROLLREG - rolling (linear) regressions
Posted: Mon Jul 09, 2012 12:13 pm
by TomDoan
basher wrote:Also, how can I obtain the associated standard errors for the slope coefficients (along with the f-stat)? Thank you.
Instead of trying to adapt the ROLLREG procedure to do so many other things, you're probably better off just doing the rolling regression as described in the
User's Guide and doing whatever additional calculations you want after each regression.
Re: ROLLREG - rolling (linear) regressions
Posted: Mon Jul 09, 2012 4:25 pm
by basher
Hi, I am still unable to obtain FHISTORY using "print / fhistory". I guess I need to know how to print the output options (e.g. COHISTORY, SEHISTORY, FIHISTORY) associated with this specific routine. Thank you.
Re: ROLLREG - rolling (linear) regressions
Posted: Mon Apr 23, 2018 3:47 pm
by TomDoan
With a PRINT instruction as was just explained:
Code: Select all
@rollreg(cohist=cohist,fhistory=fhist,sehist=sehist,move=32) y
# constant x2 x3
print / cohist sehist fhist
If that doesn't work, you must have broken something in trying to change the procedure. The loop for a moving window is four lines long. It will be much easier to start with that than to try to change a procedure.