turn on suggestions

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

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Forecasting
- /
- scoring code from proc autoreg - help

Topic Options

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-27-2014 10:35 AM

Hello group,

I need some help to write scoring code from proc autoreg. What is the actual code that can replicate the predicted quantities from the output out = dataset?

It's easy enough to calculate the predicted model component (using standard coefficients) but how does one incorporate the AR coefficients?

Any help will be greatly appreciated.

I'm struggling even with a simple example: consider the example given in SAS online documentation:

data a;

ul = 0; ull = 0;

do time = -10 to 36;

u = + 1.3 * ul - .5 * ull + 2*rannor(12346);

y = 10 + .5 * time + u;

if time > 0 then output;

ull = ul; ul = u;

end;

run;

**auto-reg model** - produce an output dataset with predicted quatitites: *QUESTION: HOW CAN I USE MODEL EFFECTS TO REPLICATE PREDICTED VALUES*?

**proc** **autoreg** data=a outest = autoreg_parms;

aut: model y = time / nlag=**2** method=ml;

output out = pred_a p = pred_y ;

**run**;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to danilo276

04-27-2014 01:27 PM

There are two types of predicted values for AR models, conditional and unconditional, depending on your needs. Which one would you like to compute? See

PG

PG

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to PGStats

04-28-2014 05:05 AM

Thanks for your reply. I'm after the conditional mean values. The descriptions in the user guide are all nice and well for t > nlag. However, there is nothing on how to start the predicted series: the auto-regressive formula

v_t = -phi_2*v_t-2 - phi_1*v_t-1 (for AR(2) say) doesn't say how to compute v_1 and v_2. This is my whole problem.

Do you know how SAS actually does this?

Dan.