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,

I’d appreciate your help with the pre-whitening command statements. Suppose my original Xt series has the best model as ARIMA(0,1,1) (with no constant). Obviously, I need to filter my original Yt series with the same ARIMA(0,1,1) model for Xt, and then cross-correlate the filtered response with the filtered input series. However, I am unsure about the correct command in the second “identify” statement (after "estimate"). The example given in the SAS ARIMA manual (on pp. 238-239) is for an ARMA(1,1) model for Xt, meaning Xt does not get differenced. Is the following code correct for my case? 

proc arima data=a;
identify var=Xt(1);
estimate p=0 q=1 method=ml noconstant;
identify var=Yt crosscorr=Xt;
run;

 Or do I need to include the “(1)” in the second "identify" statement? Should the code be then:

proc arima data=a;
identify var=Xt(1);
estimate p=0 q=1 method=ml noconstant;
identify var=Yt(1) crosscorr=Xt(1);
run;

Thank you for your assistance.

1 ACCEPTED SOLUTION

Accepted Solutions
SASCom1
SAS Employee

Hello @sasalex2024 ,

 

In your first PROC ARIMA code,

proc arima data=a;
identify var=Xt(1);
estimate p=0 q=1 method=ml noconstant;
identify var=Yt crosscorr=Xt;
run;

because differencing is specified for input series Xt in the first IDENTIFY statement, although no differencing is specified in CROSSCORR = Xt  option in the second IDENTIFY statement, the input Xt series is still applying the differencing for prewhitening, and the same differencing is also applied to output series Yt for prewhitening, as discussed in this section of documentation:

 

SAS Help Center: Prewhitening

Prewhitening and Differencing

If the VAR= and CROSSCORR= options specify differencing, the series are differenced before the prewhitening filter is applied. When the differencing lists specified in the VAR= option for an input and in the CROSSCORR= option for that input are not the same, PROC ARIMA combines the two lists so that the differencing operators used for prewhitening include all differences in either list (in the least common multiple sense).

 

In other words, both Xt and Yt series are differenced before prewhitening filter is applied in the above specification, although you did not specify Xt(1) and Yt(1) in the second IDENTIFY statement.

 

I hope this helps.

 

 

View solution in original post

6 REPLIES 6
sasalex2024
Quartz | Level 8

I think I might have figured it out. Please let me know if what I wrote below is correct.

 

Assume, for simplicity, the absence of any seasonality. If in the first identity line Xt is differenced, say Xt(1), the same differencing must be noted in the cross-correlation line, i.e., crosscorr=.

However, for Yt, whether it is Yt or Yt(1) depends on whether the original Yt series is stationary to begin with. The idea is to pre-whiten the stationary input (Xt or Xt(1)) first and apply the same filter to the stationary output, whether the latter is Yt or Yt(1).

If there is no need to difference Yt to induce stationarity, then we leave it as Yt in the last identify line. Otherwise, if it is necessary to difference Yt, we state it as Yt(1).

 

SASCom1
SAS Employee

Hello @sasalex2024 ,

 

In your first PROC ARIMA code,

proc arima data=a;
identify var=Xt(1);
estimate p=0 q=1 method=ml noconstant;
identify var=Yt crosscorr=Xt;
run;

because differencing is specified for input series Xt in the first IDENTIFY statement, although no differencing is specified in CROSSCORR = Xt  option in the second IDENTIFY statement, the input Xt series is still applying the differencing for prewhitening, and the same differencing is also applied to output series Yt for prewhitening, as discussed in this section of documentation:

 

SAS Help Center: Prewhitening

Prewhitening and Differencing

If the VAR= and CROSSCORR= options specify differencing, the series are differenced before the prewhitening filter is applied. When the differencing lists specified in the VAR= option for an input and in the CROSSCORR= option for that input are not the same, PROC ARIMA combines the two lists so that the differencing operators used for prewhitening include all differences in either list (in the least common multiple sense).

 

In other words, both Xt and Yt series are differenced before prewhitening filter is applied in the above specification, although you did not specify Xt(1) and Yt(1) in the second IDENTIFY statement.

 

I hope this helps.

 

 

sasalex2024
Quartz | Level 8

Dear SASCom1,

Thank you for your detailed and helpful reply.

So, I suppose this code is the correct one:

proc arima data=a;
identify var=Xt(1);
estimate p=0 q=1 method=ml noconstant;
identify var=Yt crosscorr=Xt;
run;

Is that right? If, for example, I write instead

proc arima data=a;
identify var=Xt(1);
estimate p=0 q=1 method=ml noconstant;
identify var=Yt(1) crosscorr=Xt(1);
run;

the latter will not be correct? I am somewhat confused, because when I read Pankratz (1991, p. 197), who writes:

"Consider the case of a single-input DR model. It is assumed that both X, and Y, have been transformed to induce constant variances. If differencing is needed to induce stationary means, we consider the differenced series, xt, and yt, with constant means mu_x and mu_y, respectively."

So, are we supposed to get crosscorrelation between xt and yt, or between X and Y? The 2nd code above gets CCF for xt (=Xt(1)) and yt (=Yt(1), but the first one gets CCF for X and Y. 

Thank you very much.

SASCom1
SAS Employee

In both your first PROC ARIMA code and second PROC ARIMA code, first differencing is applied to both response and input series before the MA prewhitening filter is applied. The filtered response series is then cross-correlated with the filtered input series. So your two steps of PROC ARIMA are essentially the same-- as mentioned earlier, the first code also applies differencing to both series before applying the prewhitening filter due to the differencing specified in previous IDENTIFY statement; the second code also applies differencing to both series before applying the prewhitening filter since differencing order is specified consistently in all VAR = and CROSSCORR = options. Personally, I prefer the second syntax specification since it is clearer. 

In general, you apply prewhitening on the input series to obtain white noise residuals. The same prewhitening filter is then applied to the response series, and the filtered response is cross correlated with the filtered input.

 

I hope this helps.

sasalex2024
Quartz | Level 8

Thank you again SASCom1, very much.

However, one code produces the graph of CCF of Xt and Yt, and the other code produces the graph of CCF of Xt(1) and Yt(1). From what I heard, they are similar for practical purposes, but technically are not identical. So, if the two codes are the same, I am curious why the CCF graphs produced are not. Thank you again.

SASCom1
SAS Employee

Hi  @sasalex2024 

 

When I said the two codes are 'essentially the same',  I was only saying in the sense that in both cases, first differencing is applied on both response series and input series before applying the prewhitening filter, even though the first code did not specify differencing on either the response series or the input series in the second IDENTIFY statement.  However, the two codes are *not exactly the same code*,  the different specifications could imply different handlings in some steps during the prewhitening stage, resulting in somewhat different prewhitened series, hence different ccfs. So it is a bit loose to say they are the same, and I should take the statement back to avoid confusion.

 

I hope that helps.