Hello,
I am trying to compute fitted values from an estimated ARMA model, but my results are not correct.
boxjenk(constant,ar=1,ma=1,inputs=0,iter=1000,define=equation) dsp 1995:1 2008:12 res1
set fitted = 0.0
do t=1995:3,2008:12
com fitted(t)= %beta(1) + %beta(2)*dsp(t-1) + %beta(3)*res1(t-1)
end do
set fit = dsp-res1
The difference between fitted and fit is always equal to -1.42, starting from 1995:3 onwards.
Am I computing fitted wrong?
Fitted Values from ARMA
Re: Fitted Values from ARMA
The constant in the BOXJENK formulation is the process mean, not the intercept in an ARMA equation. To convert that into the form you're using, the equivalent representation is:
y-%beta(1) = %beta(2)*(y{1}-%beta(1))+eps+%beta(3)*eps{1}
or
y = %beta(1)*(1-%beta(2))+%beta(2)*y{1}+eps+%beta(3)*eps{1}
So instead of using %beta(1) as the intercept, use %beta(1)*(1-%beta(2)).
BTW, the PRJ instruction will work after a BOXJENK. You could just do
prj fitted 1995:3 2008:12
instead of the loop.
y-%beta(1) = %beta(2)*(y{1}-%beta(1))+eps+%beta(3)*eps{1}
or
y = %beta(1)*(1-%beta(2))+%beta(2)*y{1}+eps+%beta(3)*eps{1}
So instead of using %beta(1) as the intercept, use %beta(1)*(1-%beta(2)).
BTW, the PRJ instruction will work after a BOXJENK. You could just do
prj fitted 1995:3 2008:12
instead of the loop.