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!
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;
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.
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.
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;
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.