Perron Breaks
Perron Breaks
Dear Tom Doan,
I want to GLS-detrend the variables in the @perronbreaks procedure. So I modified the procedure as:
local real rhot
local series ygls cgls tgls
*
if trending==0 {
compute rhot = 1-7.0/nobs
set cgls startl endl = 1-rhot
set ygls startl endl = y-rhot*y{1}
compute fixed=||cgls||
}
else {
compute rhot = 1-13.5/nobs
set cgls startl endl = 1-rhot
set tgls startl endl = (1-rhot)*(t-startl+1)+rhot
set ygls startl endl = y-rhot*y{1}
compute fixed=||cgls,tgls||
}
However, I receive the the error message: ## SR10. Missing Values And/Or SMPL Options Leave No Usable Data Points. This message shows error in the regression part of:
if ao>=2 {
linreg(noprint) ygls startl endl u
# fixed dt
and
if io>=2 {
cmom
# du u{1} fixed dt du{1 to lags}
The problem is in the "fixed" term. But I cannot figure out the problem. I have tried startl+1 in the regression for ao case.
I will be grateful for your suggestions.
Best regards.
I want to GLS-detrend the variables in the @perronbreaks procedure. So I modified the procedure as:
local real rhot
local series ygls cgls tgls
*
if trending==0 {
compute rhot = 1-7.0/nobs
set cgls startl endl = 1-rhot
set ygls startl endl = y-rhot*y{1}
compute fixed=||cgls||
}
else {
compute rhot = 1-13.5/nobs
set cgls startl endl = 1-rhot
set tgls startl endl = (1-rhot)*(t-startl+1)+rhot
set ygls startl endl = y-rhot*y{1}
compute fixed=||cgls,tgls||
}
However, I receive the the error message: ## SR10. Missing Values And/Or SMPL Options Leave No Usable Data Points. This message shows error in the regression part of:
if ao>=2 {
linreg(noprint) ygls startl endl u
# fixed dt
and
if io>=2 {
cmom
# du u{1} fixed dt du{1 to lags}
The problem is in the "fixed" term. But I cannot figure out the problem. I have tried startl+1 in the regression for ao case.
I will be grateful for your suggestions.
Best regards.
Re: Perron Breaks
I'm not sure GLS detrending is proper in that case---you have to merge the detrending with the breaks. The @GLSDetrend procedure includes detrending with a break based upon Perron and Rodriguez(2003), "GLS Detrending, Efficient Unit Root Tests and Structural Change", Journal of Econometrics, vol 115, pp 1-27.
I don't see anything obviously wrong (other than the fact that you lose a data point in the first branch, but that would cost just one data point, not the whole range). You would have to send me the altered procedure (please don't name it perronbreaks.src) and I can check. Does the original perronbreaks work with that data set?
I don't see anything obviously wrong (other than the fact that you lose a data point in the first branch, but that would cost just one data point, not the whole range). You would have to send me the altered procedure (please don't name it perronbreaks.src) and I can check. Does the original perronbreaks work with that data set?
Re: Perron Breaks
Dear Tom Doan,
Thank you for the quick reply. I have attached the modified file.
The original perronbreaks.src procedure works properly. I do realize that, with breaks, the value of "cbar" has to be changed. I have also noticed that glsdetrend.src procedure detrends the dummy variables also. Is it necessary?
Best regards.
Thank you for the quick reply. I have attached the modified file.
The original perronbreaks.src procedure works properly. I do realize that, with breaks, the value of "cbar" has to be changed. I have also noticed that glsdetrend.src procedure detrends the dummy variables also. Is it necessary?
Best regards.
- Attachments
-
- p3ppp.SRC
- (13.06 KiB) Downloaded 922 times
Re: Perron Breaks
Yes. The break is part of the deterministic that you're pulling out of the data.n141 wrote: I have also noticed that glsdetrend.src procedure detrends the dummy variables also. Is it necessary?
Re: Perron Breaks
Dear Tom Doan,
Thank you for the clarification. To GLS-detrend the dummy variable, can I do the following:
local rect[series] dtgls
dim dtgls(nperbreak,breaks)
*
if meanbreak {
set dt(next,i) startl endl = (t>=bps(i)+1)
set dtgls(next,i) startl endl = dt(next,i)-rhot*dt(next,i){1}
compute next=next+1
}
Can you please take a look at my modifications on the perronbreaks procedure, sent in my previous post as p3ppp.src? What am I doing wrong there?
Best regards.
Thank you for the clarification. To GLS-detrend the dummy variable, can I do the following:
local rect[series] dtgls
dim dtgls(nperbreak,breaks)
*
if meanbreak {
set dt(next,i) startl endl = (t>=bps(i)+1)
set dtgls(next,i) startl endl = dt(next,i)-rhot*dt(next,i){1}
compute next=next+1
}
Can you please take a look at my modifications on the perronbreaks procedure, sent in my previous post as p3ppp.src? What am I doing wrong there?
Best regards.
Re: Perron Breaks
compute lower=startl+lags+1
compute upper=endl
compute nobs = %nobs
Nothing has defined %NOBS at this point. @GLSDETREND does a STATS instruction before doing any other calculations.
compute upper=endl
compute nobs = %nobs
Nothing has defined %NOBS at this point. @GLSDETREND does a STATS instruction before doing any other calculations.
Re: Perron Breaks
Dear Tom Doan,
Thank you for pointing towards the error. It works now.
For the AO model, I do not want to include aoshift(i) on the final regression (on the de-trended series). So I changed the code as:
***********************
if io>=2 {
*
* IO models remain unchanged. For the moment my focus is on AO models.
*
}
else {
compute nbase=0
cmom
# du u{1} du{1 to lags}
compute sweepxx=%sweeplist(%cmom,%seq(2,%ncmom))
@%%URGToS(lags=lags,slstay=slstay,nbase=nbase,method=method) sweepxx lagsused
*
* Redo the regression with the chosen number of lags and maximal range
*
cmom
# du u{1} du{1 to lagsused}
compute sweepxx=%sweeplist(%cmom,%seq(2,1+nbase+lagsused))
linreg(noprint) du
# u{1} du{1 to lagsused}
compute %ndf=%nobs-lagsused-(nbase+1)
}
*************************************************
After these changes, the procedure works. However, I am not sure whether any other changes are required for this purpose. I will highly appreciate your suggestions in this regard.
Best regards.
Thank you for pointing towards the error. It works now.
For the AO model, I do not want to include aoshift(i) on the final regression (on the de-trended series). So I changed the code as:
***********************
if io>=2 {
*
* IO models remain unchanged. For the moment my focus is on AO models.
*
}
else {
compute nbase=0
cmom
# du u{1} du{1 to lags}
compute sweepxx=%sweeplist(%cmom,%seq(2,%ncmom))
@%%URGToS(lags=lags,slstay=slstay,nbase=nbase,method=method) sweepxx lagsused
*
* Redo the regression with the chosen number of lags and maximal range
*
cmom
# du u{1} du{1 to lagsused}
compute sweepxx=%sweeplist(%cmom,%seq(2,1+nbase+lagsused))
linreg(noprint) du
# u{1} du{1 to lagsused}
compute %ndf=%nobs-lagsused-(nbase+1)
}
*************************************************
After these changes, the procedure works. However, I am not sure whether any other changes are required for this purpose. I will highly appreciate your suggestions in this regard.
Best regards.
Re: Perron Breaks
I'm not sure what the "purpose" is. If you're trying to come up with a new unit root test, you need to start with the null and the alternative and figure out what calculation that requires. You seem to be approaching this from the wrong direction.
Re: Perron Breaks
Dear Tom Doan,
I am not proposing any new process. I am following Carrion-i-Silvestre, Josep Lluís, Dukpa Kim, and Pierre Perron. "GLS-based unit root tests with multiple structural breaks under both the null and the alternative hypotheses." Econometric theory 25.06 (2009): 1754-1792.
This paper focuses on AO-type models. On page 11 of the paper it says that, for mean break, "...the limiting distribution in (i) is the same as that of the linear time trend
model with no break given in Ng and Perron (2001) because of the invariance of the tests to the break parameters in these models." (Ng, Serena, and Pierre Perron. "Lag length selection and the construction of unit root tests with good size and power." Econometrica 69.6 (2001): 1519-1554.)
Based on this, I am performing the GLS-based test for the mean break case and using the critical values from Ng and Perron (2001). Ng and Perron (2001) and the erstest.src procedure do not deal with structural breaks, and hence, they do not have aoshift(i) component on the final regression of de-trended series.
I will highly appreciate your suggestions on this issue.
Best regards.
I am not proposing any new process. I am following Carrion-i-Silvestre, Josep Lluís, Dukpa Kim, and Pierre Perron. "GLS-based unit root tests with multiple structural breaks under both the null and the alternative hypotheses." Econometric theory 25.06 (2009): 1754-1792.
This paper focuses on AO-type models. On page 11 of the paper it says that, for mean break, "...the limiting distribution in (i) is the same as that of the linear time trend
model with no break given in Ng and Perron (2001) because of the invariance of the tests to the break parameters in these models." (Ng, Serena, and Pierre Perron. "Lag length selection and the construction of unit root tests with good size and power." Econometrica 69.6 (2001): 1519-1554.)
Based on this, I am performing the GLS-based test for the mean break case and using the critical values from Ng and Perron (2001). Ng and Perron (2001) and the erstest.src procedure do not deal with structural breaks, and hence, they do not have aoshift(i) component on the final regression of de-trended series.
I will highly appreciate your suggestions on this issue.
Best regards.
Re: Perron Breaks
Dear Tom Doan,
I think there is an error in the code of PerronBreaks procedure. The IO and AO model has different degrees of freedom. However, in the latter part, it uses the same degrees of freedom:
compute %ndf =%nobs-(nbase+1+bestlag)
compute %cdstat=mint
compute %minent=bestbreaks(1)
compute %maxent=bestbreaks(2)
compute %%shifts=%reshape(bestshift,%size(bestshift)/breaks,breaks)
compute %%autop=bestlag
*
dim %beta(1+nbase) %tstats(1+nbase)
ewise %beta(i)=bestxx(i+1,1)
ewise %tstats(i)=%beta(i)/sqrt(bestxx(1,1)*bestxx(i+1,i+1)/%ndf)
However, this can be corrected by multiplying bestlag by nperlag in %ndf. Please correct me if I am wrong.
Best regards.
I think there is an error in the code of PerronBreaks procedure. The IO and AO model has different degrees of freedom. However, in the latter part, it uses the same degrees of freedom:
compute %ndf =%nobs-(nbase+1+bestlag)
compute %cdstat=mint
compute %minent=bestbreaks(1)
compute %maxent=bestbreaks(2)
compute %%shifts=%reshape(bestshift,%size(bestshift)/breaks,breaks)
compute %%autop=bestlag
*
dim %beta(1+nbase) %tstats(1+nbase)
ewise %beta(i)=bestxx(i+1,1)
ewise %tstats(i)=%beta(i)/sqrt(bestxx(1,1)*bestxx(i+1,i+1)/%ndf)
However, this can be corrected by multiplying bestlag by nperlag in %ndf. Please correct me if I am wrong.
Best regards.
Re: Perron Breaks
No. The %NDF depends upon NBASE and NBASE is different depending upon the options.
Re: Perron Breaks
Based on this value of %ndf, finally reported tstat "report(use=breport,atrow=8,atcol=1) "Y{1}" %beta(1) %tstats(1)" and %cdstat=mint shows different values for the AO models.
In previous part of the code, there is aolags. It contains aoshift. The %ndf in the last part do not take account of the lagged aoshift. The rest of the coding does that properly.
Best regards.
In previous part of the code, there is aolags. It contains aoshift. The %ndf in the last part do not take account of the lagged aoshift. The rest of the coding does that properly.
Best regards.
Re: Perron Breaks
You're correct that the AO branches weren't fully accounting for the degrees of freedom. I'm not sure you're correct about the source---it appears that it was because there was no correction for degrees lost in the preliminary detrending. We've posted a corrected version.