Turn on suggestions

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

Showing results for

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 06-01-2013 02:58 PM
(941 views)

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;

4 REPLIES 4

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

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
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

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.