BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
sasalex2024
Quartz | Level 8

Dear SAS Community,

In one of the previous discussion threads, I received help from you conducting a heteroskedasticity test for a time series variable. Essentially, the problem is that I have an ARIMA model, and I want to thoroughly check if the fitted residuals exhibit heteroskedasticity. I was recommended (as the code below illustrates) to use the 'archtest' option in 'proc autoreg' for a sample ARIMA model.

However, it is my understanding that this tests for conditional heteroskedasticity. Yet is seems like, technically, the absence of conditional heteroskedasticity does not imply the absence of unconditional heteroskedasticity (I hope I am using the correct terminology), where variance changes proportionally with the trend. In the latter case, data transformations often help stabilize the variance of the residuals of the fitted model.

Nonetheless, my question is: if I have run an ARIMA model and want to conduct heteroskedasticity tests for model residuals, should I also use the 'White and Breusch' options in 'proc model'? Is that correct?

Kindly see the code below.

Thank you!

/*-- Seasonal Model for the Airline Series --*/
data seriesg;
 set sashelp.air;
 xlog = log( air );
run;

proc arima data=seriesg;
   identify var=xlog(1,12);
   estimate q=(1)(12) noint method=ml;
   forecast id=date lead=0 interval=month printall out=b;
run;
quit;

data c;
 set b;
 where residual is not missing;
 Time + 1;
run;

/* Test for Conditional Heteroscedasticity in Residuals */
proc autoreg data=c;
   model residual = Time / archtest=(all);
   output out=r r=yresid;
run;

/* Test for Unconditional Heteroscedasticity in Residuals */
proc model data=c; 
parms const beta;
residual = const + beta * time;
fit residual / white breusch=(1 time); 
run;
1 ACCEPTED SOLUTION

Accepted Solutions
SASCom1
SAS Employee

To determine the correct code to specify, you need to know which series you want to test for heteroskedasticity. As mentioned earlier, the heteroskedasticity tests are all designed to test for heteroskedasticity in the residuals from the regression model specified in the procedures. If you specify,

 

y = const + beta*x ;

fit y /white breusch = (1 z1 z2); 

 

You are testing heteroskedasticity in the residuals from the regression of y on const and x, i.e.,

residual = y - const^ - beta^*x ;

 

If you have already obtained residual series from the regression, or some regression somewhere, and you now specify 

 

residual = const + beta*time ;

fit residual /white breusch=(1 time) ;

 

You are then testing the heteroskedasticity of the residual, call it residual2, from the regression of residual on const and time, i.e., 

 

residual2 = residual - const^ - beta^*time 

 

rather than testing the heteroskedasticity in the original residual series itself. 

 

I hope this helps.

View solution in original post

10 REPLIES 10
sbxkoenk
SAS Super FREQ
  • Conditional heteroskedasticity identifies nonconstant volatility related to prior period's (e.g., daily) volatility.
  • Unconditional heteroskedasticity refers to general structural changes in volatility that are not related to prior period volatility.
  • PROC AUTOREG archtest : the ARCH test assesses the null hypothesis that a series of residuals (rt) exhibits no conditional heteroscedasticity (ARCH effects), against the alternative that an ARCH(L) model describes the series.
  • PROC MODEL (modified) Breusch-Pagan test : is a test for conditional heteroskedasticity
  • PROC MODEL White’s test : the White test begins by allowing the heteroskedasticity process to be a function of one or more of your independent variables. It’s similar to the Breusch-Pagan test, but the White test allows the independent variable to have a nonlinear and interactive effect on the error variance.

To me (but I might be wrong!) , all three tests are for conditional heteroskedasticity because the alternative hypothesis says the heteroskedasticity is subject to or dependent upon a condition. The conditions are 3 times different though.

 

Maybe @SASCom1 can shed some light.

 

Ciao, Koen

SASCom1
SAS Employee

My understanding is that, the ARCH tests supported in PROC AUTOREG, the Breusch-Pagan test and White test supported in PROC MODEL, they all test for heteroskedasticity in the residuals, but they are just testing against different forms of heteroskedasticity, or no form specified in the White test case. I have only seen the ARCH model being referenced as 'conditional heterskedastic', due to Engle(1982), which describes the conditional variance depending on the past.

 

For the ARCH test, it is testing against alternative of ARCH process, which means, 

h_t = alpha0 + alpha1*(epsilon_t-1)^2 + alpha2*(epsilon_t-2)^2 + ..... + alpha_p*(epsilon_t-p)^2, not all alpha_i equal to 0. 

 

 

For the Breusch-Pagan test, it is testing against alternative that error variance depends on a set of variables which you specify on the BREUSCH = (  ) option:

h_t = sigma^2*(alpha0 + alpha1*z1 + alpha2*z2 + ...  + ), not all alpha_i equal 0. 

 

You can do ARCH test in PROC AUTOREG, and Breusch-Pagan test in PROC MODEL. However, both of these procedures perform the test on the residuals directly from the specified regression in the procedure. If you get residuals outside of these procedures, and you want to perform these tests on the residual series, then you may fit a 'regression' of the residual series on zero mean and no regressor,  so that the residual from this 'regression' is still the residual series itself. For example,

 

/* ARCH test on the residuals */
proc autoreg data= residualdata;
model residual = /noint archtest=(all);
run;

 

/* Breusch-Pagan test on the residuals */
proc model data=residualdata;
parms const ;
residual = const ;
fit residual / breusch=(1 z1 z2);
restrict const = 0 ;
run;quit;

 

I hope this helps.

sasalex2024
Quartz | Level 8

Thank you very much SASCom1 for these great codes. I wanted to ask you if I may, in your last code, what is z1/z2 in "fit residual / breusch=(1 z1 z2)"? It gives me warning that these are not defined. Thanks a lot.

SASCom1
SAS Employee

You are welcome, @sasalex2024 .

z1 and z2 in the breusch=(1 z1 z2) option are the variables that you want to test in the Breusch-Pagan test, whether the error variance depend on these variables. You will need to have the variable(s) available in the data set read in by PROC MODEL in order to specify them in the Breusch = (  ) option. I hope this helps.

sasalex2024
Quartz | Level 8

Thank you SASCom1. I have residuals estimated from "outside" (arima) model, so I am not sure what to include in place of z1/z2? Is it supposed to be "time"? Thank you again.

SASCom1
SAS Employee

I am afraid I do not have answer to that question. When you perform a Breusch-Pagan test, you are making an assumption and test that assumption, that the error variance is not constant, but is changing with the variables z1, z2, etc. which you want to test, according to h_t = sigma^2*(alpha0 + alpha1*z1 + alpha2*z2 + ...  + ). Different data may have different variables, or may not have any  variables impacting the error variance. Similarly, the ARCH test is also making an assumption and testing that assumption, that the conditional error variance depends on the past errors, according to h_t = alpha0 + alpha1*(epsilon_t-1)^2 + alpha2*(epsilon_t-2)^2 + ..... + alpha_p*(epsilon_t-p)^2. You might examine the behavior and pattern of squared residuals and see if that gives you some indication. If you have reasons to suspect and make an assumption, you can test that assumption. Good luck!

sasalex2024
Quartz | Level 8

Thank you SASCom1. If I understood you correctly, the only proper way to go about it in SAS (and probably in other software) is to perform Engle's ARCH test on some (outside) residual series (say from a fitted ARIMA model), as given in your code below, but make sure to know the correct number of lags to look for. SAS automatically reports test results for many number of lags, so I suppose if for all of them the test is conclusive, that would be a strong evidence. Otherwise, the correct number of lags can be determined by using, for example, AIC or likelihood ratio tests. Is my understanding correct? Thanks again.

/* ARCH test on the residuals */
proc autoreg data= residualdata;
model residual = /noint archtest=(all);
run;

 

SASCom1
SAS Employee

I would like to clarify on the following:

 

1. All heteroskedasticity tests are valid tests for heterskedasticity, they just test for different forms of heteroskedasticity. Engle's ARCH test is only one test specifically to test for ARCH type of heteroskedasticity. The ARCHTEST = (ALL) option in PROC AUTOREG will produce a variety of ARCH type tests listed here, including Engle's ARCH test:

https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/etsug/etsug_autoreg_details27.htm#etsug.au...

 

The BREUSCH = ( ) option in PROC MODEL does Breusch-Pagan heteroskedasticity test. In order to do this test, you need to name the variable that is assumed to be in the conditional variance function.

 

2. When you do the ARCH tests in PROC AUTOREG, the procedure provides output for the tests for ARCH orders up to 12. The test results at all orders are helpful diagnostics that you can look at. The purpose of the test is to determine if there is ARCH type heteroskedasticity, and if so, you may need to account for it in your model. 

 

3. If the ARCH tests find significant ARCH effect, then you may want to account for the ARCH effect in your model. In practice it may not be an easy task to determine the ARCH/GARCH order. Information criteria is one commonly used method to help you decide on the ARCH/GARCH order. You may do some research in the literature to see if there are other selection methods proposed. 

 

I hope this helps. Good luck!

sasalex2024
Quartz | Level 8

Dear SASCom1,

Thank you very much for your detailed reply. I might have seen some recommendations to use for the time series to be tested (say, residuals obtained form an outside model )

residual = const + beta * time

 and for the BP test, then we apply

fit residual / white breusch=(1 time); 

 But I do not know if it is acceptable technique. Could you please let me know if you think it is not? Thanks a lot.

SASCom1
SAS Employee

To determine the correct code to specify, you need to know which series you want to test for heteroskedasticity. As mentioned earlier, the heteroskedasticity tests are all designed to test for heteroskedasticity in the residuals from the regression model specified in the procedures. If you specify,

 

y = const + beta*x ;

fit y /white breusch = (1 z1 z2); 

 

You are testing heteroskedasticity in the residuals from the regression of y on const and x, i.e.,

residual = y - const^ - beta^*x ;

 

If you have already obtained residual series from the regression, or some regression somewhere, and you now specify 

 

residual = const + beta*time ;

fit residual /white breusch=(1 time) ;

 

You are then testing the heteroskedasticity of the residual, call it residual2, from the regression of residual on const and time, i.e., 

 

residual2 = residual - const^ - beta^*time 

 

rather than testing the heteroskedasticity in the original residual series itself. 

 

I hope this helps.