BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Kevin_L_
Calcite | Level 5

Anyone know why the following produced different estimates?

Both should be the same, correct? Both are estimated via minimizing the SSE.

AR(1) in PROC REG:

data cej.cej;

set cej.cej;

ClosedEndJuniorLien_Bal_dif = dif(ClosedEndJuniorLien_Bal);

ClosedEndJuniorLien_Bal_dif_lag=lag(ClosedEndJuniorLien_Bal_dif);

run;

proc reg data=cej.cej;

model ClosedEndJuniorLien_Bal_dif = DEC2015 JUN2018 ClosedEndJuniorLien_Bal_dif_lag;

run;

AR(1) in PROC ARIMA

proc arima data=cej.cej;

identify var=ClosedEndJuniorLien_Bal(1) scan crosscorr=( DEC2015 JUN2018) stationarity=(adf=6);

estimate p=1 method=uls input=( DEC2015 JUN2018);

run;

Shouldnt the ULS and OLS estimates be the same? What is strange is when the series does not include the lag, the estimates are the same. Why would they be different? Does the PROC step compute lags differently than DATA step?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
rselukar
SAS Employee

I am not a regular user but I think, by default, VARX models are estimated with OLS in PROC VARMAX (see https://go.documentation.sas.com/?docsetId=etsug&docsetTarget=etsug_varmax_details23.htm&docsetVersi... ).  A quick check seems to work:

 

data test;
retain y 0;
do t=-10 to 60;
x = 2 + ranuni(1);
y = 0.8*y + 5 + 1.5 * x + rannor(2);
if t > 50 then y = .;
if t >= 1 then output;
end;
run;
data test;
set test;
y1 = lag(y);
run;

 

proc reg data=test plots=none;
model y = y1 x;
quit;

 

proc varmax data=test;
model y = x / p=1;
output;
run;

View solution in original post

3 REPLIES 3
rselukar
SAS Employee

 

ARIMA ULS and the REG OLS methods of parameter estimation are different (unless the ARMA model is trivial, p=q=0).  Please refer to the "Estimation Methods" section of the ARIMA doc (https://go.documentation.sas.com/?docsetId=etsug&docsetTarget=etsug_arima_details15.htm&docsetVersio... ) for additional details.

 

As mentioned there, the ULS method (and the ML method) is based on the ARMA correlation structure.  ULS method minimizes the weighted sum of squares (the weight matrix being the inverse of the covariance matrix) of the "x" values (x = differenced response values minus the mean structure including the regression and transfer function effects).  In the OLS case this covariance matrix will be identity.  So the REG and ARIMA parameter estimates will be different.

Kevin_L_
Calcite | Level 5

Thank you for the response. Given this, am I to understand there is no way to run obtain OLS estimates of an AR(P) model and forecast it within a PROC. Thanks.

rselukar
SAS Employee

I am not a regular user but I think, by default, VARX models are estimated with OLS in PROC VARMAX (see https://go.documentation.sas.com/?docsetId=etsug&docsetTarget=etsug_varmax_details23.htm&docsetVersi... ).  A quick check seems to work:

 

data test;
retain y 0;
do t=-10 to 60;
x = 2 + ranuni(1);
y = 0.8*y + 5 + 1.5 * x + rannor(2);
if t > 50 then y = .;
if t >= 1 then output;
end;
run;
data test;
set test;
y1 = lag(y);
run;

 

proc reg data=test plots=none;
model y = y1 x;
quit;

 

proc varmax data=test;
model y = x / p=1;
output;
run;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1823 views
  • 0 likes
  • 2 in conversation