ROLLREG—rolling (linear) regressions
ROLLREG—rolling (linear) regressions
@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
Detailed description
Last edited by TomDoan on Mon Apr 23, 2018 3:44 pm, edited 4 times in total.
Reason: Switch to description from HTML help
Reason: Switch to description from HTML help
-
challenges
- Posts: 11
- Joined: Thu Apr 14, 2011 12:29 pm
Re: ROLLREG - rolling (linear) regressions
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.
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
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.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.
Re: ROLLREG - rolling (linear) regressions
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.
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
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.basher wrote: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
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
With a PRINT instruction as was just explained:
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.
Code: Select all
@rollreg(cohist=cohist,fhistory=fhist,sehist=sehist,move=32) y
# constant x2 x3
print / cohist sehist fhistLast bumped by TomDoan on Mon Apr 23, 2018 3:47 pm.