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

HI,

I Want to forecast a mean revert process. The process is as following, y(t) = y(t-1) + a(b-y(t-1)). Here y(t-1) is lagged value for y(t). This is actually an AR(1) process. I have a data set with y value from 1960/01 to 2000/12. I want to use these data to estimate a mean revert (AR(1)) process, then I want to forecast y from 2001/01 for 10 months. How to do this? I searched and found that I can use proc model to estimate this model, but don't know how to forecast. Also I found that I may use proc arima to estimate and forecast, but don't quite know how to.

thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
udo_sas
SAS Employee

Hello -

In order to use PROC ARIMA (or any other forecasting procedure) you will make to make sure that your data is in time series format - with other words no gaps in the time dimension are allowed. It is ok to have missing values for the analysis variable for not observed periods (such as no value for March in your example), but your variable DATE needs to be modified. You could use the TIMESERIES procedure for example - see for example: http://support.sas.com/documentation/cdl/en/etsug/66840/HTML/default/viewer.htm#etsug_timeseries_exa....

Yes, you will need to tell the procedure about the periodicity of your data - in the case of the airline data (sashelp.air) the periodicity is monthly. See: http://support.sas.com/documentation/cdl/en/etsug/66840/HTML/default/viewer.htm#etsug_tsdata_sect029....

In your case ID will need to point to your column DATE and INTERVAL will be month.

CROSSCOR allows you to specify and cross-correlate input series or ARIMAX models. See: http://support.sas.com/documentation/cdl/en/etsug/66840/HTML/default/viewer.htm#etsug_arima_gettings... for more details.

Thanks,

Udo

View solution in original post

3 REPLIES 3
udo_sas
SAS Employee

Hello -

If you have access to SAS/ETS software you may want to use the ARIMA procedure to model this process.

Here is an example using SASHELP.AIR:

proc arima data=sashelp.air;

     identify var=air;

     estimate p=1;

     forecast id=DATE interval=MONTH lead=12 out=work.forecast;

quit;

Of course AR(1) is not a good model for this data, but you'll get the idea.

You will find many more examples here: http://support.sas.com/rnd/app/examples/ETSexamples.html

Thanks,

Udo

SeanZ
Obsidian | Level 7

Thank you for your help. In my dataset, I have one variable date showing the date of observations. These dates may not continue. For example, 2001/01, 2001/02, 2001/04, March is missing. But it's ok for me since I will use 2001/02 as the lag of 2001/04. There is no variable month. Do I have to include 'interval=month' in the codes? What is this for? Also, I found some examples using crosscorr= in the code. What is the difference if I change identify part into

     identify var=air crosscorr = (date);


Thanks.

udo_sas
SAS Employee

Hello -

In order to use PROC ARIMA (or any other forecasting procedure) you will make to make sure that your data is in time series format - with other words no gaps in the time dimension are allowed. It is ok to have missing values for the analysis variable for not observed periods (such as no value for March in your example), but your variable DATE needs to be modified. You could use the TIMESERIES procedure for example - see for example: http://support.sas.com/documentation/cdl/en/etsug/66840/HTML/default/viewer.htm#etsug_timeseries_exa....

Yes, you will need to tell the procedure about the periodicity of your data - in the case of the airline data (sashelp.air) the periodicity is monthly. See: http://support.sas.com/documentation/cdl/en/etsug/66840/HTML/default/viewer.htm#etsug_tsdata_sect029....

In your case ID will need to point to your column DATE and INTERVAL will be month.

CROSSCOR allows you to specify and cross-correlate input series or ARIMAX models. See: http://support.sas.com/documentation/cdl/en/etsug/66840/HTML/default/viewer.htm#etsug_arima_gettings... for more details.

Thanks,

Udo

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
  • 3 replies
  • 1995 views
  • 3 likes
  • 2 in conversation