Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Forecasting
- /
- Dynamic Forecast in PROC AUTOREG

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 04-11-2019 12:55 PM
(767 views)

I have built a simply dynamic model in PROC AUTOREG, such that y is a function of the previous month's (y_{t-1}), and some exogenous regressors. I see that PROC AUTOREG can handle forecasting of static models, but when a model with a lagged dependent variable is specified PROC AUTOREG cannot dynamically forecast that model.

Are there other, simpler options for forecasting dynamic models aside from writing the model out and forecasting via a datastep or using PROC SIMLIN? It would be nice if PROC AUTOREG had the capability...Suggestions would be helpful.

Working with SAS 9.4.

4 REPLIES 4

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

You might want to consider using PROC VARMAX to fit and forecast your dynamic regression model. For example, let's assume you have a data set with Y, X1 and X2 and you want to fit a model where Y is a function of X1, X2 and a lag 1 of Y. Let's also assume your input data set as 12 future values of your exogenous variables, X1 and X2. You can fit and forecast your model using the following code:

```
proc varmax data=a;
model y = x1 x2 / p=1;
output out=out lead=12;
run;
```

For more information about the above model specification, please see the *Vector Autoregressive Model with Exogenous Variables* section of the PROC VARMAX documentation at the following link:

I hope this helps!

DW

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hi Eric_sas_1,

Thanks for your reply. Would it be possible for you to provide the details of the mathematical model you are trying to fit, as well as information regarding your input data set, such as whether or not future values of the exogenous variables are provided? Once we have this information, we will be better able to suggest a procedure to use.

Thanks!

DW

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Thanks. I'm trying to fit a model to time-series data such that y_t is a function of y_{t-1} and a series of contemporaneous exogenous factors **x***, *with a model for autocorrelated disturbances, **v_t***.*

Model detail:

- y_t =
**x'**B + v_t - v_t = e_t - B(v_{t-1}) - ... B(v_{t-n})

I'm using PROC AUTOREG with the following code:

```
PROC AUTOREG data=test;
model y = lagy x1 x2 x3 / lagdep=lagy nlag=12 backstep method=ml;
output out=out_test predicted=p residual=r;
run;
```

I would like to forecast this model using PROC AUTOREG. Future values of the exogenous variables are provided, **except** for the lagged dependent variable. I can easily estimate and forecast a static model with no lagged dependent variable. Is PROC AUTOREG capable of dynamic forecasting? What is the best alternative in SAS to do so? Currently, there are two options I have been using to forecast (see below), would be nice if AUTOREG had this capability.

- Manual calculation in data step, making use of the retain function
- PROC SIMLIN can forecast dynamic models

Sample dataset:

```
data input_data;
input y lagy x1 x2 x3
datalines;
212 204 0 18223 2.282
187 212 1 18121 2.212
180 187 0 18507 4.063
. 180 0 17660 3.011
. . 0 17782 2.799
. . 0 17887 2.399
. . 1 17998 2.500
;
```

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. **

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.