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

Topic Options

- 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
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-01-2013 02:58 PM

Hi everyone,

I'm currently doing an event study of quarterly earnings announcements and are trying to produce an ARMA(1,1) forecast for the earnings per share (EPS). Due to the large number of events I'm trying to configurate the ARMAREG module (SAS/IML(R) 9.22 User's Guide) to loop and get the forecast as an output. Currently I've managed to loop and get the right estimates for the parameters, but I'm struggeling with getting the forecast to concurr with what I get in PROC ARIMA. I've read how the one-period ahead forecast should be done here,SAS/ETS(R) 9.2 User's Guide However I've not managed to replicate the result in order to loop the code.

I have only done changes to the bottom of the ARIMAREG code. The variable "estimate" are currently producing false results. I would be deeply thankful to anyone who are able to help me with this problem

Here is my current code:

/* everything above here is the same as in ARIMAREG */

/* Begin estimation for Grunfeld's investment models */

iphi=1; /*p*/

itheta=1; /*q*/

maxiter=10;

delta=0.0005;

ml=1;

/*---- To prevent overflow, specify starting values ----*/

par={-0.5 0.5 1.956306};

use work.eps;

read all var {EPS} into y;

EPSrow=nrow(Y);

params=J(3,4,0);

estimate=J(4,1,0);

do tt=1 to 4;

y=y[1:EPSrow-tt];

x=j(EPSrow-tt,1,1);

par={-0.5 0.5 1.956306};

run armareg; /*---- Perform ML estimation ----*/

Yrows=nrow(Y);

estimate[tt]=par[3]+par[2]*(-1)*Y[yRows]+par[1]*(-1)*resid[yRows];

params[,tt]=par[1:3];

end;

quit;

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

Posted in reply to DLstudent

06-01-2013 04:22 PM

It would be helpful to have some sample data for Y.

This module uses global variables, so there is no guarantee that the state of variables after the call are equivalent to the state prior to the call.

If the first iteration is correct, but not subsequent iterations, then clear out the old variables before the second iteration. For example, to clear all variables except for the ones listed below, use the following:

free / iphi itheta maxiter delta ml x y par estimate params;

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

Posted in reply to Rick_SAS

06-01-2013 04:31 PM

Hi,

Thank you for your response

here is the sample data.

the import procedure used is

PROC IMPORT OUT= WORK.EPS

DATAFILE= "filapath:\Hydro.xls"

DBMS=xls REPLACE;

GETNAMES=YES;

RUN;

However it is estimation of the one-period ahead forecast I'm struggeling with.

Edit: to clarify the ar, ma and mu parameters I get is correct, but the one-period ahead forecast is not

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

Posted in reply to DLstudent

06-01-2013 04:42 PM

Are you saying that the formula

estimate[tt]=par[3]+par[2]*(-1)*Y[yRows]+par[1]*(-1)*resid[yRows];

is not correct and that you want someone to tell you the correct formula to use?

If so, you might want to check with the Time series/forecating community. Someone there can help with the formula.

Or do you have the correct formula but you are getting wrong numbers, nonconvergence, or some other IML problem?

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

Posted in reply to Rick_SAS

06-01-2013 04:49 PM

Yes,

estimate[tt]=par[3]+par[2]*(-1)*Y[yRows]+par[1]*(-1)*resid[yRows];

is not the correct formula, I think the correct formula is stated here SAS/ETS(R) 9.2 User's Guide under "finite memory forecasts", but I do not know how to implement it.