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;
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;
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
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?
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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.