BookmarkSubscribeRSS Feed
shark
Calcite | Level 5

I am using proc autoreg and when I compare the model's predicted values against actuals the model's predicted values appear to be offset by one period.  For instance, if I shift the model's predicted values back one period, that is, actuals for January are matched with the model's predicted value for February instead of January to January, the two line up a lot better.  Does this mean I am misspecifying the model, ignoring something or just don't know what I'm doing?  Any insight you can provide into this is greatly appreciated.

Manuel

4 REPLIES 4
udo_sas
SAS Employee

Hello -

In the case of a first-order AR process where the autoregressive parameter is exactly 1, the best prediction of the future is the immediate past.

With other words, you may be fitting a a random walk model.

Thanks,

Udo

shark
Calcite | Level 5

Hi Udo,

Thank you for the reply.  I think I need to provide more information.  I have monthly data on balances and monthly data for economic variables, like gdp, unemployment, etc.  The code I am running is something like this:

proc autoreg data=work.data;

model balances = gdp unemployment / nlag=12 method=ml backstep dw dwprob archtest;

output out=result p=fit r=resid ucl=ucl lcl=lcl;

run;

Now, say that gdp and unemployment are significant and that proc autoreg fits an AR(1) process for the error term.  Now, when I plot fit and balances it looks like fit is "offset" by a period.  What I mean is that if I plot fit against lag(balances) the two line up better and the differences are smaller.  Balances has spikes and dips and the model fit reflects these spikes and dips but it does so on a lag.  The residuals are stationary and normally distributed but the MAPE is relatively high.  I can get MAPE to be lower if I get the differences between model fit and lag(balances), but I know that this is not right.

So, my question is this, is this something that normally happens or am I probably misspecifying the model?  All me test statistics pass (DW, Het-sked, normality, etc.).  Do you have insight into this?

Thank you,

Manuel

udo_sas
SAS Employee

Hi Manuel -

Would it be possible to share WORK.DATA as well?

Thanks,

Udo

ChaseO
Calcite | Level 5

Realizing that this is old thread, but it is still unanswered...

Manuel, what you are observing as an 'offset' in the plot is the error correction mechanism in action. The best way to observe the effects of the ECM would be to revise your plot and show actuals, structural (unconditional) forecasts, and error corrected (conditional) forecasts. On your output statement, use PREDICTEDM= and PREDICTED= for the structural and conditional forecasts, respectively. You will find that there is a substantial difference in fit visually. This is because, in an AR(1) model, the ECM 'corrects' the structural forecast for the current period by applying a percentage of the last period's residual (something a little different happens in the out-of-sample period). Your ECM forecasts will always be expected to 'follow' your actual values in the in-sample period. Be very cautious of relying on the goodness of the in-sample fit, as for this type of model, that may or may not be indicative of accurate forecasts.

Hope this helps any stragglers coming across this post!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 4 replies
  • 1588 views
  • 0 likes
  • 3 in conversation